From 630bf4ddf6be4761ce511907bad30a9d7cffb29a Mon Sep 17 00:00:00 2001 From: HyungKyu Song Date: Sat, 16 Feb 2013 00:53:53 +0900 Subject: Tizen 2.0 Release --- Artistic-2.0 | 191 + ChangeLog | 682 ++ INSTALL | 216 + Makefile | 135 + README | 142 + README-what-to-download.txt | 52 + README-windows-install.txt | 10 + README-windows.txt | 220 + README.maintainer | 143 + TODO | 178 + autoconf.mk.in | 41 + autogen.sh | 4 + config-mingw32 | 13 + config-mingw64 | 10 + config-msvc | 11 + config.guess | 1530 ++++ config.sub | 1773 ++++ configure.ac | 421 + copy_dlls | 126 + debian/changelog | 15 + doc/stylesheet.css | 284 + examples/Makefile | 1 + examples/build.mk | 40 + examples/examples.testcov | 19 + examples/pdf-bookmarks.cc | 257 + examples/pdf-create.cc | 183 + examples/pdf-double-page-size.cc | 110 + examples/pdf-invert-images.cc | 170 + examples/pdf-linearize.c | 80 + examples/pdf-mod-info.cc | 233 + examples/pdf-npages.cc | 55 + examples/qtest/bookmarks.test | 49 + examples/qtest/bookmarks/1.pdf | 1502 +++ examples/qtest/bookmarks/2.pdf | 79 + examples/qtest/bookmarks/3.pdf | 1 + examples/qtest/bookmarks/4.pdf | Bin 0 -> 11561 bytes examples/qtest/bookmarks/5.pdf | 1573 ++++ examples/qtest/bookmarks/encrypted.out | 11 + .../qtest/bookmarks/test.-show-open.-lines.out | 22 + .../qtest/bookmarks/test.-show-open.-numbers.out | 11 + examples/qtest/bookmarks/test.-show-open..out | 11 + examples/qtest/bookmarks/test..-lines.out | 22 + examples/qtest/bookmarks/test..-numbers.out | 11 + examples/qtest/bookmarks/test...out | 11 + examples/qtest/create.test | 29 + examples/qtest/create/orange-square.pdf | Bin 0 -> 1088 bytes examples/qtest/double-page-size.test | 32 + examples/qtest/double-page-size/in.pdf | 55 + examples/qtest/double-page-size/out.pdf | 69 + examples/qtest/invert-images.test | 32 + examples/qtest/invert-images/in.pdf | Bin 0 -> 4328 bytes examples/qtest/invert-images/out.pdf | Bin 0 -> 4328 bytes examples/qtest/linearize.test | 32 + examples/qtest/linearize/check.out | 6 + examples/qtest/linearize/input.pdf | 79 + examples/qtest/mod-info.test | 100 + examples/qtest/mod-info/dump.out | 11 + examples/qtest/mod-info/files/1.qdf | Bin 0 -> 6842 bytes examples/qtest/mod-info/files/2.qdf | 1338 +++ examples/qtest/mod-info/files/3.qdf | Bin 0 -> 6245 bytes examples/qtest/mod-info/files/4.qdf | Bin 0 -> 6252 bytes examples/qtest/mod-info/files/empty-info.pdf | Bin 0 -> 5802 bytes examples/qtest/mod-info/files/no-info.pdf | Bin 0 -> 5790 bytes examples/qtest/mod-info/files/source1.pdf | Bin 0 -> 5932 bytes examples/qtest/mod-info/files/source2.pdf | Bin 0 -> 157418 bytes examples/qtest/mod-info/usage.out | 5 + examples/qtest/npages.test | 23 + examples/qtest/npages/bad | 1 + examples/qtest/npages/minimal.pdf | 79 + include/qpdf/Buffer.hh | 53 + include/qpdf/BufferInputSource.hh | 30 + include/qpdf/Constants.h | 61 + include/qpdf/DLL.h | 18 + include/qpdf/FileInputSource.hh | 32 + include/qpdf/InputSource.hh | 35 + include/qpdf/Pipeline.hh | 65 + include/qpdf/Pl_Buffer.hh | 51 + include/qpdf/Pl_Concatenate.hh | 32 + include/qpdf/Pl_Count.hh | 41 + include/qpdf/Pl_Discard.hh | 32 + include/qpdf/Pl_Flate.hh | 42 + include/qpdf/Pl_StdioFile.hh | 40 + include/qpdf/PointerHolder.hh | 172 + include/qpdf/QPDF.hh | 1015 ++ include/qpdf/QPDFExc.hh | 63 + include/qpdf/QPDFObject.hh | 44 + include/qpdf/QPDFObjectHandle.hh | 565 ++ include/qpdf/QPDFTokenizer.hh | 159 + include/qpdf/QPDFWriter.hh | 391 + include/qpdf/QPDFXRefEntry.hh | 43 + include/qpdf/QTC.hh | 19 + include/qpdf/QUtil.hh | 88 + include/qpdf/Types.h | 11 + include/qpdf/qpdf-c.h | 379 + install-sh | 527 ++ ispell-words | 1207 +++ libqpdf.map | 4 + libqpdf.pc.in | 10 + libqpdf/BitStream.cc | 44 + libqpdf/BitWriter.cc | 28 + libqpdf/Buffer.cc | 94 + libqpdf/BufferInputSource.cc | 153 + libqpdf/FileInputSource.cc | 141 + libqpdf/InputSource.cc | 41 + libqpdf/MD5.cc | 440 + libqpdf/Makefile | 1 + libqpdf/PCRE.cc | 354 + libqpdf/Pipeline.cc | 24 + libqpdf/Pl_AES_PDF.cc | 226 + libqpdf/Pl_ASCII85Decoder.cc | 131 + libqpdf/Pl_ASCIIHexDecoder.cc | 109 + libqpdf/Pl_Buffer.cc | 66 + libqpdf/Pl_Concatenate.cc | 28 + libqpdf/Pl_Count.cc | 41 + libqpdf/Pl_Discard.cc | 22 + libqpdf/Pl_Flate.cc | 222 + libqpdf/Pl_LZWDecoder.cc | 228 + libqpdf/Pl_MD5.cc | 55 + libqpdf/Pl_PNGFilter.cc | 146 + libqpdf/Pl_QPDFTokenizer.cc | 198 + libqpdf/Pl_RC4.cc | 56 + libqpdf/Pl_StdioFile.cc | 50 + libqpdf/QPDF.cc | 2049 +++++ libqpdf/QPDFExc.cc | 86 + libqpdf/QPDFObject.cc | 1 + libqpdf/QPDFObjectHandle.cc | 1306 +++ libqpdf/QPDFTokenizer.cc | 522 ++ libqpdf/QPDFWriter.cc | 2476 +++++ libqpdf/QPDFXRefEntry.cc | 61 + libqpdf/QPDF_Array.cc | 98 + libqpdf/QPDF_Bool.cc | 22 + libqpdf/QPDF_Dictionary.cc | 115 + libqpdf/QPDF_Integer.cc | 24 + libqpdf/QPDF_Name.cc | 48 + libqpdf/QPDF_Null.cc | 11 + libqpdf/QPDF_Real.cc | 29 + libqpdf/QPDF_Reserved.cc | 13 + libqpdf/QPDF_Stream.cc | 481 + libqpdf/QPDF_String.cc | 211 + libqpdf/QPDF_encryption.cc | 930 ++ libqpdf/QPDF_linearization.cc | 2137 +++++ libqpdf/QPDF_optimization.cc | 556 ++ libqpdf/QPDF_pages.cc | 272 + libqpdf/QTC.cc | 45 + libqpdf/QUtil.cc | 335 + libqpdf/RC4.cc | 55 + libqpdf/bits.icc | 149 + libqpdf/build.mk | 83 + libqpdf/qpdf-c.cc | 593 ++ libqpdf/qpdf/BitStream.hh | 29 + libqpdf/qpdf/BitWriter.hh | 29 + libqpdf/qpdf/MD5.hh | 92 + libqpdf/qpdf/PCRE.hh | 117 + libqpdf/qpdf/Pl_AES_PDF.hh | 55 + libqpdf/qpdf/Pl_ASCII85Decoder.hh | 26 + libqpdf/qpdf/Pl_ASCIIHexDecoder.hh | 26 + libqpdf/qpdf/Pl_LZWDecoder.hh | 43 + libqpdf/qpdf/Pl_MD5.hh | 34 + libqpdf/qpdf/Pl_PNGFilter.hh | 52 + libqpdf/qpdf/Pl_QPDFTokenizer.hh | 41 + libqpdf/qpdf/Pl_RC4.hh | 32 + libqpdf/qpdf/QPDF_Array.hh | 33 + libqpdf/qpdf/QPDF_Bool.hh | 18 + libqpdf/qpdf/QPDF_Dictionary.hh | 40 + libqpdf/qpdf/QPDF_Integer.hh | 18 + libqpdf/qpdf/QPDF_Name.hh | 21 + libqpdf/qpdf/QPDF_Null.hh | 13 + libqpdf/qpdf/QPDF_Real.hh | 20 + libqpdf/qpdf/QPDF_Reserved.hh | 13 + libqpdf/qpdf/QPDF_Stream.hh | 61 + libqpdf/qpdf/QPDF_String.hh | 22 + libqpdf/qpdf/RC4.hh | 25 + libqpdf/qpdf/rijndael.h | 25 + libqpdf/rijndael.cc | 1206 +++ libtests/Makefile | 1 + libtests/aes.cc | 112 + libtests/ascii85.cc | 37 + libtests/bits.cc | 177 + libtests/buffer.cc | 71 + libtests/build.mk | 41 + libtests/concatenate.cc | 38 + libtests/flate.cc | 113 + libtests/hex.cc | 37 + libtests/libtests.testcov | 18 + libtests/lzw.cc | 60 + libtests/md5.cc | 74 + libtests/pcre.cc | 30 + libtests/png_filter.cc | 86 + libtests/pointer_holder.cc | 97 + libtests/qtest/aes.test | 71 + libtests/qtest/aes/data1 | Bin 0 -> 17041 bytes libtests/qtest/aes/data2 | Bin 0 -> 16000 bytes libtests/qtest/aes/test-vector.cipher | 1 + libtests/qtest/aes/test-vector.clear | Bin 0 -> 16 bytes libtests/qtest/ascii85.test | 23 + libtests/qtest/ascii85/base85.in | 43 + libtests/qtest/ascii85/binary.out | Bin 0 -> 2048 bytes libtests/qtest/bits.test | 18 + libtests/qtest/bits/bits.out | 59 + libtests/qtest/buffer.test | 18 + libtests/qtest/buffer/buffer.out | 11 + libtests/qtest/flate.test | 74 + libtests/qtest/flate/compressed | Bin 0 -> 147 bytes libtests/qtest/hex.test | 22 + libtests/qtest/hex/binary.out | Bin 0 -> 2048 bytes libtests/qtest/hex/hex.in | 70 + libtests/qtest/lzw.test | 39 + libtests/qtest/lzw/lzw1.in | Bin 0 -> 64355 bytes libtests/qtest/lzw/lzw1.out | 4299 +++++++++ libtests/qtest/lzw/lzw2.in | Bin 0 -> 38344 bytes libtests/qtest/lzw/lzw2.out | Bin 0 -> 143954 bytes libtests/qtest/md5.test | 18 + libtests/qtest/md5/md5.in | Bin 0 -> 250 bytes libtests/qtest/md5/md5.out | 16 + libtests/qtest/pcre.test | 47 + libtests/qtest/pcre/pcre-unicode-classes.out | 2 + libtests/qtest/pcre/pcre.out | 68 + libtests/qtest/ph.test | 18 + libtests/qtest/ph/ph.out | 17 + libtests/qtest/png_filter.test | 63 + libtests/qtest/png_filter/in1 | Bin 0 -> 3985 bytes libtests/qtest/png_filter/in2 | Bin 0 -> 339564 bytes libtests/qtest/png_filter/out1 | Bin 0 -> 3188 bytes libtests/qtest/png_filter/out2 | Bin 0 -> 282970 bytes libtests/qtest/qutil.test | 18 + libtests/qtest/qutil/qutil.out | 30 + libtests/qtest/rc4.test | 45 + libtests/qtest/rc4/test1.in | 1 + libtests/qtest/rc4/test1.out | 1 + libtests/qtest/rc4/test2.in | Bin 0 -> 8 bytes libtests/qtest/rc4/test2.out | 1 + libtests/qtest/rc4/test3.in | Bin 0 -> 8 bytes libtests/qtest/rc4/test3.out | 1 + libtests/qtest/rc4/test4.in | Bin 0 -> 10 bytes libtests/qtest/rc4/test4.out | 1 + libtests/qtest/rc4/test5.in | 1 + libtests/qtest/rc4/test5.out | Bin 0 -> 512 bytes libtests/qutil.cc | 199 + libtests/rc4.cc | 75 + ltmain.sh | 9661 ++++++++++++++++++++ m4/libtool.m4 | 8001 ++++++++++++++++ m4/ltoptions.m4 | 384 + m4/ltsugar.m4 | 123 + m4/ltversion.m4 | 23 + m4/lt~obsolete.m4 | 98 + make/gcc-linux.mk | 87 + make/installwin.mk | 21 + make/libtool.mk | 133 + make/mingw.mk | 83 + make/msvc.mk | 107 + make/proxy.mk | 10 + make/rules.mk | 49 + make_dist | 165 + make_windows_releases | 27 + make_windows_releases-finish | 24 + make_windows_releases-msvc | 21 + manual/Makefile | 1 + manual/README | 3 + manual/build.mk | 43 + manual/common.xsl | 9 + manual/fix-qdf.1.in | 18 + manual/html.xsl.in | 8 + manual/print.xsl.in | 69 + manual/qpdf-manual.xml | 3277 +++++++ manual/qpdf.1.in | 19 + manual/zlib-flate.1.in | 26 + mkinstalldirs | 162 + packaging/qpdf.spec | 105 + qpdf.manifest | 6 + qpdf.spec | 94 + qpdf/Makefile | 1 + qpdf/build.mk | 33 + qpdf/fix-qdf | 373 + qpdf/pdf_from_scratch.cc | 120 + qpdf/qpdf-ctest.c | 447 + qpdf/qpdf.cc | 1625 ++++ qpdf/qpdf.testcov | 244 + qpdf/qtest/qpdf.test | 1922 ++++ qpdf/qtest/qpdf/20-pages.pdf | Bin 0 -> 7343 bytes qpdf/qtest/qpdf/U25A0.1-ogen.c-check | 3 + qpdf/qtest/qpdf/U25A0.1-ogen.check | 6 + qpdf/qtest/qpdf/U25A0.1.c-check | 3 + qpdf/qtest/qpdf/U25A0.1.check | 6 + qpdf/qtest/qpdf/U25A0.10-ogen.c-check | 13 + qpdf/qtest/qpdf/U25A0.10-ogen.check | 17 + qpdf/qtest/qpdf/U25A0.10.c-check | 13 + qpdf/qtest/qpdf/U25A0.10.check | 17 + qpdf/qtest/qpdf/U25A0.11-ogen.c-check | 13 + qpdf/qtest/qpdf/U25A0.11-ogen.check | 17 + qpdf/qtest/qpdf/U25A0.11.c-check | 13 + qpdf/qtest/qpdf/U25A0.11.check | 17 + qpdf/qtest/qpdf/U25A0.12-ogen.c-check | 13 + qpdf/qtest/qpdf/U25A0.12-ogen.check | 17 + qpdf/qtest/qpdf/U25A0.12.c-check | 13 + qpdf/qtest/qpdf/U25A0.12.check | 17 + qpdf/qtest/qpdf/U25A0.2-ogen.c-check | 3 + qpdf/qtest/qpdf/U25A0.2-ogen.check | 6 + qpdf/qtest/qpdf/U25A0.2.c-check | 3 + qpdf/qtest/qpdf/U25A0.2.check | 6 + qpdf/qtest/qpdf/U25A0.3-ogen.c-check | 3 + qpdf/qtest/qpdf/U25A0.3-ogen.check | 6 + qpdf/qtest/qpdf/U25A0.3.c-check | 3 + qpdf/qtest/qpdf/U25A0.3.check | 6 + qpdf/qtest/qpdf/U25A0.4-ogen.c-check | 3 + qpdf/qtest/qpdf/U25A0.4-ogen.check | 6 + qpdf/qtest/qpdf/U25A0.4.c-check | 3 + qpdf/qtest/qpdf/U25A0.4.check | 6 + qpdf/qtest/qpdf/U25A0.5-ogen.c-check | 3 + qpdf/qtest/qpdf/U25A0.5-ogen.check | 6 + qpdf/qtest/qpdf/U25A0.5.c-check | 3 + qpdf/qtest/qpdf/U25A0.5.check | 6 + qpdf/qtest/qpdf/U25A0.6-ogen.c-check | 3 + qpdf/qtest/qpdf/U25A0.6-ogen.check | 6 + qpdf/qtest/qpdf/U25A0.6.c-check | 3 + qpdf/qtest/qpdf/U25A0.6.check | 6 + qpdf/qtest/qpdf/U25A0.7-ogen.c-check | 3 + qpdf/qtest/qpdf/U25A0.7-ogen.check | 6 + qpdf/qtest/qpdf/U25A0.7.c-check | 3 + qpdf/qtest/qpdf/U25A0.7.check | 6 + qpdf/qtest/qpdf/U25A0.8-ogen.c-check | 3 + qpdf/qtest/qpdf/U25A0.8-ogen.check | 6 + qpdf/qtest/qpdf/U25A0.8.c-check | 3 + qpdf/qtest/qpdf/U25A0.8.check | 6 + qpdf/qtest/qpdf/U25A0.9-ogen.c-check | 13 + qpdf/qtest/qpdf/U25A0.9-ogen.check | 17 + qpdf/qtest/qpdf/U25A0.9.c-check | 13 + qpdf/qtest/qpdf/U25A0.9.check | 17 + qpdf/qtest/qpdf/U25A0.pdf | Bin 0 -> 67790 bytes qpdf/qtest/qpdf/V4-aes-clearmeta-encryption.out | 15 + qpdf/qtest/qpdf/V4-aes-clearmeta.pdf | 417 + qpdf/qtest/qpdf/V4-aes-encryption.out | 15 + qpdf/qtest/qpdf/V4-aes.pdf | 396 + qpdf/qtest/qpdf/V4-clearmeta-encryption.out | 15 + qpdf/qtest/qpdf/V4-clearmeta.pdf | Bin 0 -> 15214 bytes qpdf/qtest/qpdf/V4-encryption.out | 15 + qpdf/qtest/qpdf/V4.pdf | Bin 0 -> 14770 bytes qpdf/qtest/qpdf/add-contents.pdf | 54 + qpdf/qtest/qpdf/aes-forced-check.out | 6 + .../qpdf/append-page-content-damaged-c-check.out | 21 + .../qpdf/append-page-content-damaged-check.out | 7 + qpdf/qtest/qpdf/append-page-content-damaged.out | 4 + qpdf/qtest/qpdf/append-page-content-damaged.pdf | 1592 ++++ qpdf/qtest/qpdf/append-page-content-damaged.qdf | 1614 ++++ qpdf/qtest/qpdf/append-page-content-good.qdf | 1408 +++ qpdf/qtest/qpdf/append-page-content.pdf | 1592 ++++ qpdf/qtest/qpdf/bad1-recover.out | 1 + qpdf/qtest/qpdf/bad1.out | 1 + qpdf/qtest/qpdf/bad1.pdf | 1 + qpdf/qtest/qpdf/bad10-recover.out | 9 + qpdf/qtest/qpdf/bad10.out | 1 + qpdf/qtest/qpdf/bad10.pdf | 79 + qpdf/qtest/qpdf/bad11-recover.out | 9 + qpdf/qtest/qpdf/bad11.out | 1 + qpdf/qtest/qpdf/bad11.pdf | 104 + qpdf/qtest/qpdf/bad12-recover.out | 7 + qpdf/qtest/qpdf/bad12.out | 7 + qpdf/qtest/qpdf/bad12.pdf | 122 + qpdf/qtest/qpdf/bad13-recover.out | 4 + qpdf/qtest/qpdf/bad13.out | 1 + qpdf/qtest/qpdf/bad13.pdf | 80 + qpdf/qtest/qpdf/bad14-recover.out | 4 + qpdf/qtest/qpdf/bad14.out | 1 + qpdf/qtest/qpdf/bad14.pdf | 80 + qpdf/qtest/qpdf/bad15-recover.out | 4 + qpdf/qtest/qpdf/bad15.out | 1 + qpdf/qtest/qpdf/bad15.pdf | 80 + qpdf/qtest/qpdf/bad16-recover.out | 4 + qpdf/qtest/qpdf/bad16.out | 1 + qpdf/qtest/qpdf/bad16.pdf | 80 + qpdf/qtest/qpdf/bad17-recover.out | 4 + qpdf/qtest/qpdf/bad17.out | 1 + qpdf/qtest/qpdf/bad17.pdf | 80 + qpdf/qtest/qpdf/bad18-recover.out | 4 + qpdf/qtest/qpdf/bad18.out | 1 + qpdf/qtest/qpdf/bad18.pdf | 80 + qpdf/qtest/qpdf/bad19-recover.out | 4 + qpdf/qtest/qpdf/bad19.out | 1 + qpdf/qtest/qpdf/bad19.pdf | 80 + qpdf/qtest/qpdf/bad2-recover.out | 9 + qpdf/qtest/qpdf/bad2.out | 1 + qpdf/qtest/qpdf/bad2.pdf | 76 + qpdf/qtest/qpdf/bad20-recover.out | 4 + qpdf/qtest/qpdf/bad20.out | 1 + qpdf/qtest/qpdf/bad20.pdf | 80 + qpdf/qtest/qpdf/bad21-recover.out | 4 + qpdf/qtest/qpdf/bad21.out | 1 + qpdf/qtest/qpdf/bad21.pdf | 80 + qpdf/qtest/qpdf/bad22-recover.out | 21 + qpdf/qtest/qpdf/bad22.out | 1 + qpdf/qtest/qpdf/bad22.pdf | 80 + qpdf/qtest/qpdf/bad23-recover.out | 21 + qpdf/qtest/qpdf/bad23.out | 1 + qpdf/qtest/qpdf/bad23.pdf | 80 + qpdf/qtest/qpdf/bad24-recover.out | 2 + qpdf/qtest/qpdf/bad24.out | 1 + qpdf/qtest/qpdf/bad24.pdf | 80 + qpdf/qtest/qpdf/bad25-recover.out | 10 + qpdf/qtest/qpdf/bad25.out | 1 + qpdf/qtest/qpdf/bad25.pdf | 80 + qpdf/qtest/qpdf/bad26-recover.out | 10 + qpdf/qtest/qpdf/bad26.out | 1 + qpdf/qtest/qpdf/bad26.pdf | 80 + qpdf/qtest/qpdf/bad27-recover.out | 10 + qpdf/qtest/qpdf/bad27.out | 1 + qpdf/qtest/qpdf/bad27.pdf | 80 + qpdf/qtest/qpdf/bad28-recover.out | 21 + qpdf/qtest/qpdf/bad28.out | 21 + qpdf/qtest/qpdf/bad28.pdf | 80 + qpdf/qtest/qpdf/bad29-recover.out | 4 + qpdf/qtest/qpdf/bad29.out | 1 + qpdf/qtest/qpdf/bad29.pdf | 80 + qpdf/qtest/qpdf/bad3-recover.out | 9 + qpdf/qtest/qpdf/bad3.out | 1 + qpdf/qtest/qpdf/bad3.pdf | 76 + qpdf/qtest/qpdf/bad30-recover.out | 6 + qpdf/qtest/qpdf/bad30.out | 6 + qpdf/qtest/qpdf/bad30.pdf | 93 + qpdf/qtest/qpdf/bad31-recover.out | 9 + qpdf/qtest/qpdf/bad31.out | 9 + qpdf/qtest/qpdf/bad31.pdf | 93 + qpdf/qtest/qpdf/bad32-recover.out | 10 + qpdf/qtest/qpdf/bad32.out | 1 + qpdf/qtest/qpdf/bad32.pdf | 80 + qpdf/qtest/qpdf/bad33-recover.out | 9 + qpdf/qtest/qpdf/bad33.out | 1 + qpdf/qtest/qpdf/bad33.pdf | 93 + qpdf/qtest/qpdf/bad34-recover.out | 23 + qpdf/qtest/qpdf/bad34.out | 1 + qpdf/qtest/qpdf/bad34.pdf | 81 + qpdf/qtest/qpdf/bad35-recover.out | 1 + qpdf/qtest/qpdf/bad35.out | 1 + qpdf/qtest/qpdf/bad35.pdf | Bin 0 -> 807 bytes qpdf/qtest/qpdf/bad4-recover.out | 9 + qpdf/qtest/qpdf/bad4.out | 1 + qpdf/qtest/qpdf/bad4.pdf | 77 + qpdf/qtest/qpdf/bad5-recover.out | 9 + qpdf/qtest/qpdf/bad5.out | 1 + qpdf/qtest/qpdf/bad5.pdf | 77 + qpdf/qtest/qpdf/bad6-recover.out | 6 + qpdf/qtest/qpdf/bad6.out | 6 + qpdf/qtest/qpdf/bad6.pdf | 122 + qpdf/qtest/qpdf/bad7-recover.out | 4 + qpdf/qtest/qpdf/bad7.out | 1 + qpdf/qtest/qpdf/bad7.pdf | 77 + qpdf/qtest/qpdf/bad8-recover.out | 9 + qpdf/qtest/qpdf/bad8.out | 1 + qpdf/qtest/qpdf/bad8.pdf | 104 + qpdf/qtest/qpdf/bad9-recover.out | 9 + qpdf/qtest/qpdf/bad9.out | 1 + qpdf/qtest/qpdf/bad9.pdf | 79 + qpdf/qtest/qpdf/badlin1.out | 380 + qpdf/qtest/qpdf/badlin1.pdf | Bin 0 -> 13103 bytes qpdf/qtest/qpdf/c-decrypt-with-owner.pdf | Bin 0 -> 9668 bytes qpdf/qtest/qpdf/c-decrypt-with-user.pdf | Bin 0 -> 9668 bytes qpdf/qtest/qpdf/c-ignore-xref-streams.pdf | Bin 0 -> 9976 bytes qpdf/qtest/qpdf/c-info-out.pdf | 44 + qpdf/qtest/qpdf/c-info1.out | 6 + qpdf/qtest/qpdf/c-info2-in.pdf | Bin 0 -> 926 bytes qpdf/qtest/qpdf/c-info2.out | 6 + qpdf/qtest/qpdf/c-invalid-password.out | 5 + qpdf/qtest/qpdf/c-linearized.pdf | Bin 0 -> 10729 bytes qpdf/qtest/qpdf/c-no-options.pdf | Bin 0 -> 9668 bytes qpdf/qtest/qpdf/c-no-original-object-ids.pdf | 1512 +++ qpdf/qtest/qpdf/c-no-recovery.out | 5 + qpdf/qtest/qpdf/c-normalized-content.pdf | Bin 0 -> 8917 bytes qpdf/qtest/qpdf/c-object-streams.pdf | Bin 0 -> 5195 bytes qpdf/qtest/qpdf/c-qdf.pdf | 1576 ++++ qpdf/qtest/qpdf/c-r2.pdf | Bin 0 -> 9893 bytes qpdf/qtest/qpdf/c-r3.pdf | Bin 0 -> 9897 bytes qpdf/qtest/qpdf/c-r4.pdf | Bin 0 -> 10881 bytes qpdf/qtest/qpdf/c-read-errors.out | 5 + qpdf/qtest/qpdf/c-read-warnings-and-errors.out | 20 + qpdf/qtest/qpdf/c-uncompressed-streams.pdf | 434 + qpdf/qtest/qpdf/c-write-damaged.out | 15 + qpdf/qtest/qpdf/c-write-errors.out | 5 + qpdf/qtest/qpdf/c-write-warnings-and-errors.out | 20 + qpdf/qtest/qpdf/check-ID.pl | 20 + qpdf/qtest/qpdf/compressed-metadata.pdf | Bin 0 -> 14007 bytes qpdf/qtest/qpdf/copied-encryption.out | 15 + qpdf/qtest/qpdf/copy-foreign-objects-errors.out | 3 + qpdf/qtest/qpdf/copy-foreign-objects-in.pdf | 335 + qpdf/qtest/qpdf/copy-foreign-objects-out1.pdf | 66 + qpdf/qtest/qpdf/copy-foreign-objects-out2.pdf | 81 + qpdf/qtest/qpdf/copy-foreign-objects-out3.pdf | 92 + qpdf/qtest/qpdf/damaged-stream-c-check.out | 1 + qpdf/qtest/qpdf/damaged-stream.out | 5 + qpdf/qtest/qpdf/damaged-stream.pdf | Bin 0 -> 77635 bytes qpdf/qtest/qpdf/decrypted-crypt-filter.pdf | Bin 0 -> 14383 bytes qpdf/qtest/qpdf/delete-and-reuse.pdf | 1573 ++++ qpdf/qtest/qpdf/delete-and-reuse.qdf | 1408 +++ qpdf/qtest/qpdf/diff-encrypted | 7 + qpdf/qtest/qpdf/diff-ignore-ID-version | 8 + qpdf/qtest/qpdf/empty-object.out | 3 + qpdf/qtest/qpdf/empty-object.pdf | 84 + qpdf/qtest/qpdf/enc-R2,V1,O=master.pdf | Bin 0 -> 17146 bytes qpdf/qtest/qpdf/enc-R2,V1,U=view,O=master.pdf | Bin 0 -> 17134 bytes qpdf/qtest/qpdf/enc-R2,V1,U=view.pdf | Bin 0 -> 17137 bytes qpdf/qtest/qpdf/enc-R2,V1.pdf | Bin 0 -> 17143 bytes qpdf/qtest/qpdf/enc-R3,V2,O=master.pdf | Bin 0 -> 17144 bytes qpdf/qtest/qpdf/enc-R3,V2,U=view,O=master.pdf | Bin 0 -> 17139 bytes qpdf/qtest/qpdf/enc-R3,V2,U=view.pdf | Bin 0 -> 17142 bytes qpdf/qtest/qpdf/enc-R3,V2.pdf | Bin 0 -> 17140 bytes qpdf/qtest/qpdf/enc-base.pdf | Bin 0 -> 16937 bytes qpdf/qtest/qpdf/enc-long-password.pdf | Bin 0 -> 17144 bytes qpdf/qtest/qpdf/encrypted-with-images.pdf | Bin 0 -> 50219 bytes qpdf/qtest/qpdf/encrypted1.out | 578 ++ qpdf/qtest/qpdf/eof-reading-token.out | 5 + qpdf/qtest/qpdf/eof-reading-token.pdf | Bin 0 -> 1632 bytes qpdf/qtest/qpdf/eof-terminates-literal.out | 6 + qpdf/qtest/qpdf/eof-terminates-literal.pdf | Bin 0 -> 1632 bytes qpdf/qtest/qpdf/extra-header-lin-newline.pdf | Bin 0 -> 1334 bytes qpdf/qtest/qpdf/extra-header-lin-no-newline.pdf | Bin 0 -> 1334 bytes qpdf/qtest/qpdf/extra-header-newline.pdf | Bin 0 -> 823 bytes qpdf/qtest/qpdf/extra-header-no-newline.pdf | Bin 0 -> 823 bytes qpdf/qtest/qpdf/fax-decode-parms.out | 6 + qpdf/qtest/qpdf/fax-decode-parms.pdf | Bin 0 -> 1565966 bytes qpdf/qtest/qpdf/filter-abbreviation.out | Bin 0 -> 734 bytes qpdf/qtest/qpdf/filter-abbreviation.pdf | Bin 0 -> 743 bytes qpdf/qtest/qpdf/fix1.qdf | 111 + qpdf/qtest/qpdf/fix1.qdf.out | 113 + qpdf/qtest/qpdf/fix2.qdf | Bin 0 -> 1227 bytes qpdf/qtest/qpdf/fix2.qdf.out | Bin 0 -> 1232 bytes qpdf/qtest/qpdf/forced-version.out | 6 + qpdf/qtest/qpdf/foreign-in-write.out | 2 + qpdf/qtest/qpdf/from-scratch-0.pdf | 36 + qpdf/qtest/qpdf/good1.out | 6 + qpdf/qtest/qpdf/good1.pdf | Bin 0 -> 813 bytes qpdf/qtest/qpdf/good1.qdf | 101 + qpdf/qtest/qpdf/good10.out | 8 + qpdf/qtest/qpdf/good10.pdf | 80 + qpdf/qtest/qpdf/good10.qdf | 106 + qpdf/qtest/qpdf/good11.out | 6 + qpdf/qtest/qpdf/good11.pdf | 81 + qpdf/qtest/qpdf/good11.qdf | 104 + qpdf/qtest/qpdf/good12.out | 13 + qpdf/qtest/qpdf/good12.pdf | 93 + qpdf/qtest/qpdf/good12.qdf | 120 + qpdf/qtest/qpdf/good13.out | 9 + qpdf/qtest/qpdf/good13.pdf | 101 + qpdf/qtest/qpdf/good13.qdf | 146 + qpdf/qtest/qpdf/good14.out | 39 + qpdf/qtest/qpdf/good14.pdf | 142 + qpdf/qtest/qpdf/good14.qdf | 199 + qpdf/qtest/qpdf/good15.out | 5 + qpdf/qtest/qpdf/good15.pdf | 79 + qpdf/qtest/qpdf/good15.qdf | 103 + qpdf/qtest/qpdf/good16.out | 6 + qpdf/qtest/qpdf/good16.pdf | Bin 0 -> 792 bytes qpdf/qtest/qpdf/good16.qdf | Bin 0 -> 1249 bytes qpdf/qtest/qpdf/good17-not-qdf.pdf | Bin 0 -> 9893 bytes qpdf/qtest/qpdf/good17-not-recompressed.pdf | Bin 0 -> 9147 bytes qpdf/qtest/qpdf/good17.out | 6 + qpdf/qtest/qpdf/good17.pdf | 1550 ++++ qpdf/qtest/qpdf/good17.qdf | 1588 ++++ qpdf/qtest/qpdf/good18.out | 6 + qpdf/qtest/qpdf/good18.pdf | 1538 ++++ qpdf/qtest/qpdf/good18.qdf | 1407 +++ qpdf/qtest/qpdf/good19.out | 6 + qpdf/qtest/qpdf/good19.pdf | Bin 0 -> 1032 bytes qpdf/qtest/qpdf/good19.qdf | Bin 0 -> 1248 bytes qpdf/qtest/qpdf/good2.out | 6 + qpdf/qtest/qpdf/good2.pdf | 80 + qpdf/qtest/qpdf/good2.qdf | 101 + qpdf/qtest/qpdf/good20.out | 6 + qpdf/qtest/qpdf/good20.pdf | 901 ++ qpdf/qtest/qpdf/good20.qdf | 1076 +++ qpdf/qtest/qpdf/good3.out | 6 + qpdf/qtest/qpdf/good3.pdf | 80 + qpdf/qtest/qpdf/good3.qdf | 101 + qpdf/qtest/qpdf/good4.out | 6 + qpdf/qtest/qpdf/good4.pdf | 83 + qpdf/qtest/qpdf/good4.qdf | 101 + qpdf/qtest/qpdf/good5.out | 5 + qpdf/qtest/qpdf/good5.pdf | 83 + qpdf/qtest/qpdf/good5.qdf | 102 + qpdf/qtest/qpdf/good6.out | 5 + qpdf/qtest/qpdf/good6.pdf | 79 + qpdf/qtest/qpdf/good6.qdf | 102 + qpdf/qtest/qpdf/good7-not-normalized.qdf | 101 + qpdf/qtest/qpdf/good7.out | 5 + qpdf/qtest/qpdf/good7.pdf | 79 + qpdf/qtest/qpdf/good7.qdf | 103 + qpdf/qtest/qpdf/good8.out | 5 + qpdf/qtest/qpdf/good8.pdf | 82 + qpdf/qtest/qpdf/good8.qdf | 102 + qpdf/qtest/qpdf/good9.out | 5 + qpdf/qtest/qpdf/good9.pdf | 81 + qpdf/qtest/qpdf/good9.qdf | 103 + qpdf/qtest/qpdf/heifer.out | 5 + qpdf/qtest/qpdf/heifer.pdf | Bin 0 -> 93593 bytes qpdf/qtest/qpdf/heifer.qdf | 1349 +++ qpdf/qtest/qpdf/hybrid-xref.1-ogen.c-check | 3 + qpdf/qtest/qpdf/hybrid-xref.1-ogen.check | 6 + qpdf/qtest/qpdf/hybrid-xref.1.c-check | 3 + qpdf/qtest/qpdf/hybrid-xref.1.check | 6 + qpdf/qtest/qpdf/hybrid-xref.10-ogen.c-check | 13 + qpdf/qtest/qpdf/hybrid-xref.10-ogen.check | 17 + qpdf/qtest/qpdf/hybrid-xref.10.c-check | 13 + qpdf/qtest/qpdf/hybrid-xref.10.check | 17 + qpdf/qtest/qpdf/hybrid-xref.11-ogen.c-check | 13 + qpdf/qtest/qpdf/hybrid-xref.11-ogen.check | 17 + qpdf/qtest/qpdf/hybrid-xref.11.c-check | 13 + qpdf/qtest/qpdf/hybrid-xref.11.check | 17 + qpdf/qtest/qpdf/hybrid-xref.12-ogen.c-check | 3 + qpdf/qtest/qpdf/hybrid-xref.12-ogen.check | 6 + qpdf/qtest/qpdf/hybrid-xref.12.c-check | 3 + qpdf/qtest/qpdf/hybrid-xref.12.check | 6 + qpdf/qtest/qpdf/hybrid-xref.2-ogen.c-check | 3 + qpdf/qtest/qpdf/hybrid-xref.2-ogen.check | 6 + qpdf/qtest/qpdf/hybrid-xref.2.c-check | 3 + qpdf/qtest/qpdf/hybrid-xref.2.check | 6 + qpdf/qtest/qpdf/hybrid-xref.3-ogen.c-check | 3 + qpdf/qtest/qpdf/hybrid-xref.3-ogen.check | 6 + qpdf/qtest/qpdf/hybrid-xref.3.c-check | 3 + qpdf/qtest/qpdf/hybrid-xref.3.check | 6 + qpdf/qtest/qpdf/hybrid-xref.4-ogen.c-check | 3 + qpdf/qtest/qpdf/hybrid-xref.4-ogen.check | 6 + qpdf/qtest/qpdf/hybrid-xref.4.c-check | 3 + qpdf/qtest/qpdf/hybrid-xref.4.check | 6 + qpdf/qtest/qpdf/hybrid-xref.5-ogen.c-check | 3 + qpdf/qtest/qpdf/hybrid-xref.5-ogen.check | 6 + qpdf/qtest/qpdf/hybrid-xref.5.c-check | 3 + qpdf/qtest/qpdf/hybrid-xref.5.check | 6 + qpdf/qtest/qpdf/hybrid-xref.6-ogen.c-check | 3 + qpdf/qtest/qpdf/hybrid-xref.6-ogen.check | 6 + qpdf/qtest/qpdf/hybrid-xref.6.c-check | 3 + qpdf/qtest/qpdf/hybrid-xref.6.check | 6 + qpdf/qtest/qpdf/hybrid-xref.7-ogen.c-check | 3 + qpdf/qtest/qpdf/hybrid-xref.7-ogen.check | 6 + qpdf/qtest/qpdf/hybrid-xref.7.c-check | 3 + qpdf/qtest/qpdf/hybrid-xref.7.check | 6 + qpdf/qtest/qpdf/hybrid-xref.8-ogen.c-check | 3 + qpdf/qtest/qpdf/hybrid-xref.8-ogen.check | 6 + qpdf/qtest/qpdf/hybrid-xref.8.c-check | 3 + qpdf/qtest/qpdf/hybrid-xref.8.check | 6 + qpdf/qtest/qpdf/hybrid-xref.9-ogen.c-check | 3 + qpdf/qtest/qpdf/hybrid-xref.9-ogen.check | 6 + qpdf/qtest/qpdf/hybrid-xref.9.c-check | 3 + qpdf/qtest/qpdf/hybrid-xref.9.check | 6 + qpdf/qtest/qpdf/hybrid-xref.pdf | 1538 ++++ qpdf/qtest/qpdf/inline-images-cr.pdf | Bin 0 -> 1519163 bytes qpdf/qtest/qpdf/inline-images.1-ogen.c-check | 3 + qpdf/qtest/qpdf/inline-images.1-ogen.check | 6 + qpdf/qtest/qpdf/inline-images.1.c-check | 3 + qpdf/qtest/qpdf/inline-images.1.check | 6 + qpdf/qtest/qpdf/inline-images.10-ogen.c-check | 13 + qpdf/qtest/qpdf/inline-images.10-ogen.check | 17 + qpdf/qtest/qpdf/inline-images.10.c-check | 13 + qpdf/qtest/qpdf/inline-images.10.check | 17 + qpdf/qtest/qpdf/inline-images.11-ogen.c-check | 13 + qpdf/qtest/qpdf/inline-images.11-ogen.check | 17 + qpdf/qtest/qpdf/inline-images.11.c-check | 13 + qpdf/qtest/qpdf/inline-images.11.check | 17 + qpdf/qtest/qpdf/inline-images.12-ogen.c-check | 3 + qpdf/qtest/qpdf/inline-images.12-ogen.check | 6 + qpdf/qtest/qpdf/inline-images.12.c-check | 3 + qpdf/qtest/qpdf/inline-images.12.check | 6 + qpdf/qtest/qpdf/inline-images.2-ogen.c-check | 3 + qpdf/qtest/qpdf/inline-images.2-ogen.check | 6 + qpdf/qtest/qpdf/inline-images.2.c-check | 3 + qpdf/qtest/qpdf/inline-images.2.check | 6 + qpdf/qtest/qpdf/inline-images.3-ogen.c-check | 3 + qpdf/qtest/qpdf/inline-images.3-ogen.check | 6 + qpdf/qtest/qpdf/inline-images.3.c-check | 3 + qpdf/qtest/qpdf/inline-images.3.check | 6 + qpdf/qtest/qpdf/inline-images.4-ogen.c-check | 3 + qpdf/qtest/qpdf/inline-images.4-ogen.check | 6 + qpdf/qtest/qpdf/inline-images.4.c-check | 3 + qpdf/qtest/qpdf/inline-images.4.check | 6 + qpdf/qtest/qpdf/inline-images.5-ogen.c-check | 3 + qpdf/qtest/qpdf/inline-images.5-ogen.check | 6 + qpdf/qtest/qpdf/inline-images.5.c-check | 3 + qpdf/qtest/qpdf/inline-images.5.check | 6 + qpdf/qtest/qpdf/inline-images.6-ogen.c-check | 3 + qpdf/qtest/qpdf/inline-images.6-ogen.check | 6 + qpdf/qtest/qpdf/inline-images.6.c-check | 3 + qpdf/qtest/qpdf/inline-images.6.check | 6 + qpdf/qtest/qpdf/inline-images.7-ogen.c-check | 3 + qpdf/qtest/qpdf/inline-images.7-ogen.check | 6 + qpdf/qtest/qpdf/inline-images.7.c-check | 3 + qpdf/qtest/qpdf/inline-images.7.check | 6 + qpdf/qtest/qpdf/inline-images.8-ogen.c-check | 3 + qpdf/qtest/qpdf/inline-images.8-ogen.check | 6 + qpdf/qtest/qpdf/inline-images.8.c-check | 3 + qpdf/qtest/qpdf/inline-images.8.check | 6 + qpdf/qtest/qpdf/inline-images.9-ogen.c-check | 3 + qpdf/qtest/qpdf/inline-images.9-ogen.check | 6 + qpdf/qtest/qpdf/inline-images.9.c-check | 3 + qpdf/qtest/qpdf/inline-images.9.check | 6 + qpdf/qtest/qpdf/inline-images.pdf | Bin 0 -> 300684 bytes qpdf/qtest/qpdf/large_file-check-linearized.out | 5 + qpdf/qtest/qpdf/large_file-check-normal.out | 5 + .../qpdf/large_file-check-ostream-linearized.out | 5 + qpdf/qtest/qpdf/large_file-check-ostream.out | 5 + qpdf/qtest/qpdf/large_file.out | 200 + qpdf/qtest/qpdf/large_file_xref_reconstruct.out | 203 + qpdf/qtest/qpdf/lin-delete-and-reuse-check.out | 6 + qpdf/qtest/qpdf/lin-delete-and-reuse.pdf | Bin 0 -> 13382 bytes qpdf/qtest/qpdf/lin-special.1-ogen.c-check | 3 + qpdf/qtest/qpdf/lin-special.1-ogen.check | 6 + qpdf/qtest/qpdf/lin-special.1.c-check | 3 + qpdf/qtest/qpdf/lin-special.1.check | 6 + qpdf/qtest/qpdf/lin-special.10-ogen.c-check | 13 + qpdf/qtest/qpdf/lin-special.10-ogen.check | 17 + qpdf/qtest/qpdf/lin-special.10.c-check | 13 + qpdf/qtest/qpdf/lin-special.10.check | 17 + qpdf/qtest/qpdf/lin-special.11-ogen.c-check | 13 + qpdf/qtest/qpdf/lin-special.11-ogen.check | 17 + qpdf/qtest/qpdf/lin-special.11.c-check | 13 + qpdf/qtest/qpdf/lin-special.11.check | 17 + qpdf/qtest/qpdf/lin-special.12-ogen.c-check | 3 + qpdf/qtest/qpdf/lin-special.12-ogen.check | 6 + qpdf/qtest/qpdf/lin-special.12.c-check | 3 + qpdf/qtest/qpdf/lin-special.12.check | 6 + qpdf/qtest/qpdf/lin-special.2-ogen.c-check | 3 + qpdf/qtest/qpdf/lin-special.2-ogen.check | 6 + qpdf/qtest/qpdf/lin-special.2.c-check | 3 + qpdf/qtest/qpdf/lin-special.2.check | 6 + qpdf/qtest/qpdf/lin-special.3-ogen.c-check | 3 + qpdf/qtest/qpdf/lin-special.3-ogen.check | 6 + qpdf/qtest/qpdf/lin-special.3.c-check | 3 + qpdf/qtest/qpdf/lin-special.3.check | 6 + qpdf/qtest/qpdf/lin-special.4-ogen.c-check | 3 + qpdf/qtest/qpdf/lin-special.4-ogen.check | 6 + qpdf/qtest/qpdf/lin-special.4.c-check | 3 + qpdf/qtest/qpdf/lin-special.4.check | 6 + qpdf/qtest/qpdf/lin-special.5-ogen.c-check | 3 + qpdf/qtest/qpdf/lin-special.5-ogen.check | 6 + qpdf/qtest/qpdf/lin-special.5.c-check | 3 + qpdf/qtest/qpdf/lin-special.5.check | 6 + qpdf/qtest/qpdf/lin-special.6-ogen.c-check | 3 + qpdf/qtest/qpdf/lin-special.6-ogen.check | 6 + qpdf/qtest/qpdf/lin-special.6.c-check | 3 + qpdf/qtest/qpdf/lin-special.6.check | 6 + qpdf/qtest/qpdf/lin-special.7-ogen.c-check | 3 + qpdf/qtest/qpdf/lin-special.7-ogen.check | 6 + qpdf/qtest/qpdf/lin-special.7.c-check | 3 + qpdf/qtest/qpdf/lin-special.7.check | 6 + qpdf/qtest/qpdf/lin-special.8-ogen.c-check | 3 + qpdf/qtest/qpdf/lin-special.8-ogen.check | 6 + qpdf/qtest/qpdf/lin-special.8.c-check | 3 + qpdf/qtest/qpdf/lin-special.8.check | 6 + qpdf/qtest/qpdf/lin-special.9-ogen.c-check | 3 + qpdf/qtest/qpdf/lin-special.9-ogen.check | 6 + qpdf/qtest/qpdf/lin-special.9.c-check | 3 + qpdf/qtest/qpdf/lin-special.9.check | 6 + qpdf/qtest/qpdf/lin-special.disable.exp | Bin 0 -> 3178 bytes qpdf/qtest/qpdf/lin-special.generate.exp | Bin 0 -> 2808 bytes qpdf/qtest/qpdf/lin-special.pdf | 361 + qpdf/qtest/qpdf/lin-special.preserve.exp | Bin 0 -> 3178 bytes qpdf/qtest/qpdf/lin0.out | 1 + qpdf/qtest/qpdf/lin0.pdf | 79 + qpdf/qtest/qpdf/lin1.out | 378 + qpdf/qtest/qpdf/lin1.pdf | Bin 0 -> 13103 bytes qpdf/qtest/qpdf/lin2.out | 378 + qpdf/qtest/qpdf/lin2.pdf | Bin 0 -> 13103 bytes qpdf/qtest/qpdf/lin3.out | 318 + qpdf/qtest/qpdf/lin3.pdf | Bin 0 -> 16937 bytes qpdf/qtest/qpdf/lin4.out | 353 + qpdf/qtest/qpdf/lin4.pdf | Bin 0 -> 13055 bytes qpdf/qtest/qpdf/lin5.out | 318 + qpdf/qtest/qpdf/lin5.pdf | Bin 0 -> 27464 bytes qpdf/qtest/qpdf/lin6.out | 592 ++ qpdf/qtest/qpdf/lin6.pdf | Bin 0 -> 24824 bytes qpdf/qtest/qpdf/lin7.out | 292 + qpdf/qtest/qpdf/lin7.pdf | Bin 0 -> 27408 bytes qpdf/qtest/qpdf/lin8.out | 568 ++ qpdf/qtest/qpdf/lin8.pdf | Bin 0 -> 24875 bytes qpdf/qtest/qpdf/lin9.out | 104 + qpdf/qtest/qpdf/lin9.pdf | Bin 0 -> 3316 bytes qpdf/qtest/qpdf/linearized-and-warnings-1.out | 52 + qpdf/qtest/qpdf/linearized-and-warnings-2.out | 54 + qpdf/qtest/qpdf/linearized-and-warnings.pdf | Bin 0 -> 1310 bytes qpdf/qtest/qpdf/long-id-check.out | 17 + qpdf/qtest/qpdf/long-id.pdf | 80 + qpdf/qtest/qpdf/merge-three-files-1.pdf | Bin 0 -> 8495 bytes qpdf/qtest/qpdf/merge-three-files-2.pdf | Bin 0 -> 6036 bytes qpdf/qtest/qpdf/metadata-crypt-filter.pdf | 411 + qpdf/qtest/qpdf/min-version.out | 6 + qpdf/qtest/qpdf/minimal.pdf | 79 + qpdf/qtest/qpdf/misc-1.out | 15 + qpdf/qtest/qpdf/misc-1.pdf | Bin 0 -> 18204 bytes qpdf/qtest/qpdf/misc-2.out | 26 + qpdf/qtest/qpdf/misc-2.pdf | Bin 0 -> 16022 bytes qpdf/qtest/qpdf/misc-3.out | 15 + qpdf/qtest/qpdf/misc-3.pdf | 128 + qpdf/qtest/qpdf/multiple-mods-check.out | 6 + qpdf/qtest/qpdf/multiple-mods.pdf | Bin 0 -> 60960 bytes qpdf/qtest/qpdf/new-streams.pdf | 54 + qpdf/qtest/qpdf/obj0-check.out | 7 + qpdf/qtest/qpdf/obj0.pdf | Bin 0 -> 859 bytes qpdf/qtest/qpdf/object-stream.1-ogen.c-check | 3 + qpdf/qtest/qpdf/object-stream.1-ogen.check | 6 + qpdf/qtest/qpdf/object-stream.1.c-check | 3 + qpdf/qtest/qpdf/object-stream.1.check | 6 + qpdf/qtest/qpdf/object-stream.10-ogen.c-check | 13 + qpdf/qtest/qpdf/object-stream.10-ogen.check | 17 + qpdf/qtest/qpdf/object-stream.10.c-check | 13 + qpdf/qtest/qpdf/object-stream.10.check | 17 + qpdf/qtest/qpdf/object-stream.11-ogen.c-check | 13 + qpdf/qtest/qpdf/object-stream.11-ogen.check | 17 + qpdf/qtest/qpdf/object-stream.11.c-check | 13 + qpdf/qtest/qpdf/object-stream.11.check | 17 + qpdf/qtest/qpdf/object-stream.12-ogen.c-check | 3 + qpdf/qtest/qpdf/object-stream.12-ogen.check | 6 + qpdf/qtest/qpdf/object-stream.12.c-check | 3 + qpdf/qtest/qpdf/object-stream.12.check | 6 + qpdf/qtest/qpdf/object-stream.2-ogen.c-check | 3 + qpdf/qtest/qpdf/object-stream.2-ogen.check | 6 + qpdf/qtest/qpdf/object-stream.2.c-check | 3 + qpdf/qtest/qpdf/object-stream.2.check | 6 + qpdf/qtest/qpdf/object-stream.3-ogen.c-check | 3 + qpdf/qtest/qpdf/object-stream.3-ogen.check | 6 + qpdf/qtest/qpdf/object-stream.3.c-check | 3 + qpdf/qtest/qpdf/object-stream.3.check | 6 + qpdf/qtest/qpdf/object-stream.4-ogen.c-check | 3 + qpdf/qtest/qpdf/object-stream.4-ogen.check | 6 + qpdf/qtest/qpdf/object-stream.4.c-check | 3 + qpdf/qtest/qpdf/object-stream.4.check | 6 + qpdf/qtest/qpdf/object-stream.5-ogen.c-check | 3 + qpdf/qtest/qpdf/object-stream.5-ogen.check | 6 + qpdf/qtest/qpdf/object-stream.5.c-check | 3 + qpdf/qtest/qpdf/object-stream.5.check | 6 + qpdf/qtest/qpdf/object-stream.6-ogen.c-check | 3 + qpdf/qtest/qpdf/object-stream.6-ogen.check | 6 + qpdf/qtest/qpdf/object-stream.6.c-check | 3 + qpdf/qtest/qpdf/object-stream.6.check | 6 + qpdf/qtest/qpdf/object-stream.7-ogen.c-check | 3 + qpdf/qtest/qpdf/object-stream.7-ogen.check | 6 + qpdf/qtest/qpdf/object-stream.7.c-check | 3 + qpdf/qtest/qpdf/object-stream.7.check | 6 + qpdf/qtest/qpdf/object-stream.8-ogen.c-check | 3 + qpdf/qtest/qpdf/object-stream.8-ogen.check | 6 + qpdf/qtest/qpdf/object-stream.8.c-check | 3 + qpdf/qtest/qpdf/object-stream.8.check | 6 + qpdf/qtest/qpdf/object-stream.9-ogen.c-check | 3 + qpdf/qtest/qpdf/object-stream.9-ogen.check | 6 + qpdf/qtest/qpdf/object-stream.9.c-check | 3 + qpdf/qtest/qpdf/object-stream.9.check | 6 + qpdf/qtest/qpdf/object-stream.disable.exp | Bin 0 -> 1310 bytes qpdf/qtest/qpdf/object-stream.generate.exp | Bin 0 -> 1536 bytes qpdf/qtest/qpdf/object-stream.pdf | Bin 0 -> 792 bytes qpdf/qtest/qpdf/object-stream.preserve.exp | Bin 0 -> 1536 bytes qpdf/qtest/qpdf/old-and-complex-c-check.out | 3 + qpdf/qtest/qpdf/old-and-complex-check.out | 6 + qpdf/qtest/qpdf/old-and-complex.pdf | Bin 0 -> 335662 bytes qpdf/qtest/qpdf/p1-a-p2-a.pdf | 138 + qpdf/qtest/qpdf/p1-a-p2-b.pdf | 138 + qpdf/qtest/qpdf/p1-a.pdf | 95 + qpdf/qtest/qpdf/p1-b.pdf | 95 + qpdf/qtest/qpdf/page-labels-and-outlines.pdf | 1503 +++ qpdf/qtest/qpdf/page_api_1-out.pdf | 168 + qpdf/qtest/qpdf/page_api_1-out2.pdf | 146 + qpdf/qtest/qpdf/page_api_1-out3.pdf | 135 + qpdf/qtest/qpdf/page_api_1.out | 1 + qpdf/qtest/qpdf/page_api_1.out2 | 1 + qpdf/qtest/qpdf/page_api_1.pdf | 472 + qpdf/qtest/qpdf/page_api_2.out | 1 + qpdf/qtest/qpdf/page_api_2.pdf | 137 + qpdf/qtest/qpdf/pages-copy-encryption.pdf | Bin 0 -> 1319 bytes qpdf/qtest/qpdf/pages-warning.out | 2 + qpdf/qtest/qpdf/parse-object.out | 4 + qpdf/qtest/qpdf/qstream.pdf | 90 + qpdf/qtest/qpdf/replaced-stream-data-flate.pdf | Bin 0 -> 1419 bytes qpdf/qtest/qpdf/replaced-stream-data.pdf | 47 + qpdf/qtest/qpdf/reserved-objects.out | 8 + qpdf/qtest/qpdf/reserved-objects.pdf | 48 + qpdf/qtest/qpdf/shallow_array-out.pdf | 40 + qpdf/qtest/qpdf/shallow_array.pdf | 80 + qpdf/qtest/qpdf/shallow_stream.out | 1 + qpdf/qtest/qpdf/short-id-check.out | 17 + qpdf/qtest/qpdf/short-id.pdf | 80 + qpdf/qtest/qpdf/show-page-1-content-filtered.out | 1 + qpdf/qtest/qpdf/show-page-1-content-normalized.out | 8 + qpdf/qtest/qpdf/show-page-1-content-raw.out | Bin 0 -> 61 bytes qpdf/qtest/qpdf/show-page-1-image.out | Bin 0 -> 39109 bytes qpdf/qtest/qpdf/show-page-1.out | 1 + qpdf/qtest/qpdf/show-pages-images.out | 11 + qpdf/qtest/qpdf/show-pages.out | 6 + qpdf/qtest/qpdf/show-unfilterable.out | 1 + qpdf/qtest/qpdf/show-xref-by-id-filtered.out | Bin 0 -> 52 bytes qpdf/qtest/qpdf/show-xref-by-id.out | 2 + qpdf/qtest/qpdf/show-xref.out | 12 + qpdf/qtest/qpdf/stream-data.pdf | 112 + qpdf/qtest/qpdf/stream-line-enders.out | 3 + qpdf/qtest/qpdf/stream-line-enders.pdf | 50 + qpdf/qtest/qpdf/stream-line-enders.qdf | 137 + qpdf/qtest/qpdf/test-32.out | 13 + qpdf/qtest/qpdf/test11.out | 3 + qpdf/qtest/qpdf/test14-in.pdf | 264 + qpdf/qtest/qpdf/test14-out.pdf | 105 + qpdf/qtest/qpdf/test14.out | 7 + qpdf/qtest/qpdf/test4-1.pdf | 126 + qpdf/qtest/qpdf/test4-1.qdf | 158 + qpdf/qtest/qpdf/test4-2.out | 1 + qpdf/qtest/qpdf/test4-2.pdf | 104 + qpdf/qtest/qpdf/test4-3.out | 1 + qpdf/qtest/qpdf/test4-3.pdf | 109 + qpdf/qtest/qpdf/test4-4.pdf | 123 + qpdf/qtest/qpdf/test4-4.qdf | 155 + qpdf/qtest/qpdf/test8.out | 2 + qpdf/qtest/qpdf/test9.out | 2 + qpdf/qtest/qpdf/unreferenced-indirect-scalar.out | Bin 0 -> 1402 bytes qpdf/qtest/qpdf/unreferenced-indirect-scalar.pdf | Bin 0 -> 1216 bytes qpdf/qtest/qpdf/xref-with-short-size-new.out | 13 + qpdf/qtest/qpdf/xref-with-short-size-recover.out | 2 + qpdf/qtest/qpdf/xref-with-short-size.out | 14 + qpdf/qtest/qpdf/xref-with-short-size.pdf | Bin 0 -> 16527 bytes qpdf/test_driver.cc | 1164 +++ qpdf/test_large_file.cc | 362 + qtest/QTC/perl/QTC.pm | 26 + qtest/README.txt | 3 + qtest/bin/qtest-driver | 815 ++ qtest/module/TestDriver.pm | 1783 ++++ zlib-flate/Makefile | 1 + zlib-flate/build.mk | 22 + zlib-flate/qtest/1.compressed | Bin 0 -> 193 bytes zlib-flate/qtest/1.uncompressed | 5 + zlib-flate/qtest/zf.test | 26 + zlib-flate/zlib-flate.cc | 94 + 920 files changed, 118510 insertions(+) create mode 100644 Artistic-2.0 create mode 100644 ChangeLog create mode 100644 INSTALL create mode 100644 Makefile create mode 100644 README create mode 100644 README-what-to-download.txt create mode 100644 README-windows-install.txt create mode 100644 README-windows.txt create mode 100644 README.maintainer create mode 100644 TODO create mode 100644 autoconf.mk.in create mode 100755 autogen.sh create mode 100755 config-mingw32 create mode 100644 config-mingw64 create mode 100755 config-msvc create mode 100755 config.guess create mode 100755 config.sub create mode 100644 configure.ac create mode 100755 copy_dlls create mode 100644 debian/changelog create mode 100644 doc/stylesheet.css create mode 100644 examples/Makefile create mode 100644 examples/build.mk create mode 100644 examples/examples.testcov create mode 100644 examples/pdf-bookmarks.cc create mode 100644 examples/pdf-create.cc create mode 100644 examples/pdf-double-page-size.cc create mode 100644 examples/pdf-invert-images.cc create mode 100644 examples/pdf-linearize.c create mode 100644 examples/pdf-mod-info.cc create mode 100644 examples/pdf-npages.cc create mode 100644 examples/qtest/bookmarks.test create mode 100644 examples/qtest/bookmarks/1.pdf create mode 100644 examples/qtest/bookmarks/2.pdf create mode 100644 examples/qtest/bookmarks/3.pdf create mode 100644 examples/qtest/bookmarks/4.pdf create mode 100644 examples/qtest/bookmarks/5.pdf create mode 100644 examples/qtest/bookmarks/encrypted.out create mode 100644 examples/qtest/bookmarks/test.-show-open.-lines.out create mode 100644 examples/qtest/bookmarks/test.-show-open.-numbers.out create mode 100644 examples/qtest/bookmarks/test.-show-open..out create mode 100644 examples/qtest/bookmarks/test..-lines.out create mode 100644 examples/qtest/bookmarks/test..-numbers.out create mode 100644 examples/qtest/bookmarks/test...out create mode 100644 examples/qtest/create.test create mode 100644 examples/qtest/create/orange-square.pdf create mode 100644 examples/qtest/double-page-size.test create mode 100644 examples/qtest/double-page-size/in.pdf create mode 100644 examples/qtest/double-page-size/out.pdf create mode 100644 examples/qtest/invert-images.test create mode 100644 examples/qtest/invert-images/in.pdf create mode 100644 examples/qtest/invert-images/out.pdf create mode 100644 examples/qtest/linearize.test create mode 100644 examples/qtest/linearize/check.out create mode 100644 examples/qtest/linearize/input.pdf create mode 100644 examples/qtest/mod-info.test create mode 100644 examples/qtest/mod-info/dump.out create mode 100644 examples/qtest/mod-info/files/1.qdf create mode 100644 examples/qtest/mod-info/files/2.qdf create mode 100644 examples/qtest/mod-info/files/3.qdf create mode 100644 examples/qtest/mod-info/files/4.qdf create mode 100644 examples/qtest/mod-info/files/empty-info.pdf create mode 100644 examples/qtest/mod-info/files/no-info.pdf create mode 100644 examples/qtest/mod-info/files/source1.pdf create mode 100644 examples/qtest/mod-info/files/source2.pdf create mode 100644 examples/qtest/mod-info/usage.out create mode 100644 examples/qtest/npages.test create mode 100644 examples/qtest/npages/bad create mode 100644 examples/qtest/npages/minimal.pdf create mode 100644 include/qpdf/Buffer.hh create mode 100644 include/qpdf/BufferInputSource.hh create mode 100644 include/qpdf/Constants.h create mode 100644 include/qpdf/DLL.h create mode 100644 include/qpdf/FileInputSource.hh create mode 100644 include/qpdf/InputSource.hh create mode 100644 include/qpdf/Pipeline.hh create mode 100644 include/qpdf/Pl_Buffer.hh create mode 100644 include/qpdf/Pl_Concatenate.hh create mode 100644 include/qpdf/Pl_Count.hh create mode 100644 include/qpdf/Pl_Discard.hh create mode 100644 include/qpdf/Pl_Flate.hh create mode 100644 include/qpdf/Pl_StdioFile.hh create mode 100644 include/qpdf/PointerHolder.hh create mode 100644 include/qpdf/QPDF.hh create mode 100644 include/qpdf/QPDFExc.hh create mode 100644 include/qpdf/QPDFObject.hh create mode 100644 include/qpdf/QPDFObjectHandle.hh create mode 100644 include/qpdf/QPDFTokenizer.hh create mode 100644 include/qpdf/QPDFWriter.hh create mode 100644 include/qpdf/QPDFXRefEntry.hh create mode 100644 include/qpdf/QTC.hh create mode 100644 include/qpdf/QUtil.hh create mode 100644 include/qpdf/Types.h create mode 100644 include/qpdf/qpdf-c.h create mode 100755 install-sh create mode 100644 ispell-words create mode 100644 libqpdf.map create mode 100644 libqpdf.pc.in create mode 100644 libqpdf/BitStream.cc create mode 100644 libqpdf/BitWriter.cc create mode 100644 libqpdf/Buffer.cc create mode 100644 libqpdf/BufferInputSource.cc create mode 100644 libqpdf/FileInputSource.cc create mode 100644 libqpdf/InputSource.cc create mode 100644 libqpdf/MD5.cc create mode 100644 libqpdf/Makefile create mode 100644 libqpdf/PCRE.cc create mode 100644 libqpdf/Pipeline.cc create mode 100644 libqpdf/Pl_AES_PDF.cc create mode 100644 libqpdf/Pl_ASCII85Decoder.cc create mode 100644 libqpdf/Pl_ASCIIHexDecoder.cc create mode 100644 libqpdf/Pl_Buffer.cc create mode 100644 libqpdf/Pl_Concatenate.cc create mode 100644 libqpdf/Pl_Count.cc create mode 100644 libqpdf/Pl_Discard.cc create mode 100644 libqpdf/Pl_Flate.cc create mode 100644 libqpdf/Pl_LZWDecoder.cc create mode 100644 libqpdf/Pl_MD5.cc create mode 100644 libqpdf/Pl_PNGFilter.cc create mode 100644 libqpdf/Pl_QPDFTokenizer.cc create mode 100644 libqpdf/Pl_RC4.cc create mode 100644 libqpdf/Pl_StdioFile.cc create mode 100644 libqpdf/QPDF.cc create mode 100644 libqpdf/QPDFExc.cc create mode 100644 libqpdf/QPDFObject.cc create mode 100644 libqpdf/QPDFObjectHandle.cc create mode 100644 libqpdf/QPDFTokenizer.cc create mode 100644 libqpdf/QPDFWriter.cc create mode 100644 libqpdf/QPDFXRefEntry.cc create mode 100644 libqpdf/QPDF_Array.cc create mode 100644 libqpdf/QPDF_Bool.cc create mode 100644 libqpdf/QPDF_Dictionary.cc create mode 100644 libqpdf/QPDF_Integer.cc create mode 100644 libqpdf/QPDF_Name.cc create mode 100644 libqpdf/QPDF_Null.cc create mode 100644 libqpdf/QPDF_Real.cc create mode 100644 libqpdf/QPDF_Reserved.cc create mode 100644 libqpdf/QPDF_Stream.cc create mode 100644 libqpdf/QPDF_String.cc create mode 100644 libqpdf/QPDF_encryption.cc create mode 100644 libqpdf/QPDF_linearization.cc create mode 100644 libqpdf/QPDF_optimization.cc create mode 100644 libqpdf/QPDF_pages.cc create mode 100644 libqpdf/QTC.cc create mode 100644 libqpdf/QUtil.cc create mode 100644 libqpdf/RC4.cc create mode 100644 libqpdf/bits.icc create mode 100644 libqpdf/build.mk create mode 100644 libqpdf/qpdf-c.cc create mode 100644 libqpdf/qpdf/BitStream.hh create mode 100644 libqpdf/qpdf/BitWriter.hh create mode 100644 libqpdf/qpdf/MD5.hh create mode 100644 libqpdf/qpdf/PCRE.hh create mode 100644 libqpdf/qpdf/Pl_AES_PDF.hh create mode 100644 libqpdf/qpdf/Pl_ASCII85Decoder.hh create mode 100644 libqpdf/qpdf/Pl_ASCIIHexDecoder.hh create mode 100644 libqpdf/qpdf/Pl_LZWDecoder.hh create mode 100644 libqpdf/qpdf/Pl_MD5.hh create mode 100644 libqpdf/qpdf/Pl_PNGFilter.hh create mode 100644 libqpdf/qpdf/Pl_QPDFTokenizer.hh create mode 100644 libqpdf/qpdf/Pl_RC4.hh create mode 100644 libqpdf/qpdf/QPDF_Array.hh create mode 100644 libqpdf/qpdf/QPDF_Bool.hh create mode 100644 libqpdf/qpdf/QPDF_Dictionary.hh create mode 100644 libqpdf/qpdf/QPDF_Integer.hh create mode 100644 libqpdf/qpdf/QPDF_Name.hh create mode 100644 libqpdf/qpdf/QPDF_Null.hh create mode 100644 libqpdf/qpdf/QPDF_Real.hh create mode 100644 libqpdf/qpdf/QPDF_Reserved.hh create mode 100644 libqpdf/qpdf/QPDF_Stream.hh create mode 100644 libqpdf/qpdf/QPDF_String.hh create mode 100644 libqpdf/qpdf/RC4.hh create mode 100644 libqpdf/qpdf/rijndael.h create mode 100644 libqpdf/rijndael.cc create mode 100644 libtests/Makefile create mode 100644 libtests/aes.cc create mode 100644 libtests/ascii85.cc create mode 100644 libtests/bits.cc create mode 100644 libtests/buffer.cc create mode 100644 libtests/build.mk create mode 100644 libtests/concatenate.cc create mode 100644 libtests/flate.cc create mode 100644 libtests/hex.cc create mode 100644 libtests/libtests.testcov create mode 100644 libtests/lzw.cc create mode 100644 libtests/md5.cc create mode 100644 libtests/pcre.cc create mode 100644 libtests/png_filter.cc create mode 100644 libtests/pointer_holder.cc create mode 100644 libtests/qtest/aes.test create mode 100644 libtests/qtest/aes/data1 create mode 100644 libtests/qtest/aes/data2 create mode 100644 libtests/qtest/aes/test-vector.cipher create mode 100644 libtests/qtest/aes/test-vector.clear create mode 100644 libtests/qtest/ascii85.test create mode 100644 libtests/qtest/ascii85/base85.in create mode 100644 libtests/qtest/ascii85/binary.out create mode 100644 libtests/qtest/bits.test create mode 100644 libtests/qtest/bits/bits.out create mode 100644 libtests/qtest/buffer.test create mode 100644 libtests/qtest/buffer/buffer.out create mode 100644 libtests/qtest/flate.test create mode 100644 libtests/qtest/flate/compressed create mode 100644 libtests/qtest/hex.test create mode 100644 libtests/qtest/hex/binary.out create mode 100644 libtests/qtest/hex/hex.in create mode 100644 libtests/qtest/lzw.test create mode 100644 libtests/qtest/lzw/lzw1.in create mode 100644 libtests/qtest/lzw/lzw1.out create mode 100644 libtests/qtest/lzw/lzw2.in create mode 100644 libtests/qtest/lzw/lzw2.out create mode 100644 libtests/qtest/md5.test create mode 100644 libtests/qtest/md5/md5.in create mode 100644 libtests/qtest/md5/md5.out create mode 100644 libtests/qtest/pcre.test create mode 100644 libtests/qtest/pcre/pcre-unicode-classes.out create mode 100644 libtests/qtest/pcre/pcre.out create mode 100644 libtests/qtest/ph.test create mode 100644 libtests/qtest/ph/ph.out create mode 100644 libtests/qtest/png_filter.test create mode 100644 libtests/qtest/png_filter/in1 create mode 100644 libtests/qtest/png_filter/in2 create mode 100644 libtests/qtest/png_filter/out1 create mode 100644 libtests/qtest/png_filter/out2 create mode 100644 libtests/qtest/qutil.test create mode 100644 libtests/qtest/qutil/qutil.out create mode 100644 libtests/qtest/rc4.test create mode 100644 libtests/qtest/rc4/test1.in create mode 100644 libtests/qtest/rc4/test1.out create mode 100644 libtests/qtest/rc4/test2.in create mode 100644 libtests/qtest/rc4/test2.out create mode 100644 libtests/qtest/rc4/test3.in create mode 100644 libtests/qtest/rc4/test3.out create mode 100644 libtests/qtest/rc4/test4.in create mode 100644 libtests/qtest/rc4/test4.out create mode 100644 libtests/qtest/rc4/test5.in create mode 100644 libtests/qtest/rc4/test5.out create mode 100644 libtests/qutil.cc create mode 100644 libtests/rc4.cc create mode 100644 ltmain.sh create mode 100644 m4/libtool.m4 create mode 100644 m4/ltoptions.m4 create mode 100644 m4/ltsugar.m4 create mode 100644 m4/ltversion.m4 create mode 100644 m4/lt~obsolete.m4 create mode 100644 make/gcc-linux.mk create mode 100644 make/installwin.mk create mode 100644 make/libtool.mk create mode 100644 make/mingw.mk create mode 100644 make/msvc.mk create mode 100644 make/proxy.mk create mode 100644 make/rules.mk create mode 100755 make_dist create mode 100755 make_windows_releases create mode 100755 make_windows_releases-finish create mode 100755 make_windows_releases-msvc create mode 100644 manual/Makefile create mode 100644 manual/README create mode 100644 manual/build.mk create mode 100644 manual/common.xsl create mode 100644 manual/fix-qdf.1.in create mode 100644 manual/html.xsl.in create mode 100644 manual/print.xsl.in create mode 100644 manual/qpdf-manual.xml create mode 100644 manual/qpdf.1.in create mode 100644 manual/zlib-flate.1.in create mode 100755 mkinstalldirs create mode 100644 packaging/qpdf.spec create mode 100644 qpdf.manifest create mode 100644 qpdf.spec create mode 100644 qpdf/Makefile create mode 100644 qpdf/build.mk create mode 100755 qpdf/fix-qdf create mode 100644 qpdf/pdf_from_scratch.cc create mode 100644 qpdf/qpdf-ctest.c create mode 100644 qpdf/qpdf.cc create mode 100644 qpdf/qpdf.testcov create mode 100644 qpdf/qtest/qpdf.test create mode 100644 qpdf/qtest/qpdf/20-pages.pdf create mode 100644 qpdf/qtest/qpdf/U25A0.1-ogen.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.1-ogen.check create mode 100644 qpdf/qtest/qpdf/U25A0.1.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.1.check create mode 100644 qpdf/qtest/qpdf/U25A0.10-ogen.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.10-ogen.check create mode 100644 qpdf/qtest/qpdf/U25A0.10.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.10.check create mode 100644 qpdf/qtest/qpdf/U25A0.11-ogen.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.11-ogen.check create mode 100644 qpdf/qtest/qpdf/U25A0.11.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.11.check create mode 100644 qpdf/qtest/qpdf/U25A0.12-ogen.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.12-ogen.check create mode 100644 qpdf/qtest/qpdf/U25A0.12.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.12.check create mode 100644 qpdf/qtest/qpdf/U25A0.2-ogen.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.2-ogen.check create mode 100644 qpdf/qtest/qpdf/U25A0.2.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.2.check create mode 100644 qpdf/qtest/qpdf/U25A0.3-ogen.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.3-ogen.check create mode 100644 qpdf/qtest/qpdf/U25A0.3.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.3.check create mode 100644 qpdf/qtest/qpdf/U25A0.4-ogen.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.4-ogen.check create mode 100644 qpdf/qtest/qpdf/U25A0.4.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.4.check create mode 100644 qpdf/qtest/qpdf/U25A0.5-ogen.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.5-ogen.check create mode 100644 qpdf/qtest/qpdf/U25A0.5.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.5.check create mode 100644 qpdf/qtest/qpdf/U25A0.6-ogen.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.6-ogen.check create mode 100644 qpdf/qtest/qpdf/U25A0.6.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.6.check create mode 100644 qpdf/qtest/qpdf/U25A0.7-ogen.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.7-ogen.check create mode 100644 qpdf/qtest/qpdf/U25A0.7.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.7.check create mode 100644 qpdf/qtest/qpdf/U25A0.8-ogen.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.8-ogen.check create mode 100644 qpdf/qtest/qpdf/U25A0.8.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.8.check create mode 100644 qpdf/qtest/qpdf/U25A0.9-ogen.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.9-ogen.check create mode 100644 qpdf/qtest/qpdf/U25A0.9.c-check create mode 100644 qpdf/qtest/qpdf/U25A0.9.check create mode 100644 qpdf/qtest/qpdf/U25A0.pdf create mode 100644 qpdf/qtest/qpdf/V4-aes-clearmeta-encryption.out create mode 100644 qpdf/qtest/qpdf/V4-aes-clearmeta.pdf create mode 100644 qpdf/qtest/qpdf/V4-aes-encryption.out create mode 100644 qpdf/qtest/qpdf/V4-aes.pdf create mode 100644 qpdf/qtest/qpdf/V4-clearmeta-encryption.out create mode 100644 qpdf/qtest/qpdf/V4-clearmeta.pdf create mode 100644 qpdf/qtest/qpdf/V4-encryption.out create mode 100644 qpdf/qtest/qpdf/V4.pdf create mode 100644 qpdf/qtest/qpdf/add-contents.pdf create mode 100644 qpdf/qtest/qpdf/aes-forced-check.out create mode 100644 qpdf/qtest/qpdf/append-page-content-damaged-c-check.out create mode 100644 qpdf/qtest/qpdf/append-page-content-damaged-check.out create mode 100644 qpdf/qtest/qpdf/append-page-content-damaged.out create mode 100644 qpdf/qtest/qpdf/append-page-content-damaged.pdf create mode 100644 qpdf/qtest/qpdf/append-page-content-damaged.qdf create mode 100644 qpdf/qtest/qpdf/append-page-content-good.qdf create mode 100644 qpdf/qtest/qpdf/append-page-content.pdf create mode 100644 qpdf/qtest/qpdf/bad1-recover.out create mode 100644 qpdf/qtest/qpdf/bad1.out create mode 100644 qpdf/qtest/qpdf/bad1.pdf create mode 100644 qpdf/qtest/qpdf/bad10-recover.out create mode 100644 qpdf/qtest/qpdf/bad10.out create mode 100644 qpdf/qtest/qpdf/bad10.pdf create mode 100644 qpdf/qtest/qpdf/bad11-recover.out create mode 100644 qpdf/qtest/qpdf/bad11.out create mode 100644 qpdf/qtest/qpdf/bad11.pdf create mode 100644 qpdf/qtest/qpdf/bad12-recover.out create mode 100644 qpdf/qtest/qpdf/bad12.out create mode 100644 qpdf/qtest/qpdf/bad12.pdf create mode 100644 qpdf/qtest/qpdf/bad13-recover.out create mode 100644 qpdf/qtest/qpdf/bad13.out create mode 100644 qpdf/qtest/qpdf/bad13.pdf create mode 100644 qpdf/qtest/qpdf/bad14-recover.out create mode 100644 qpdf/qtest/qpdf/bad14.out create mode 100644 qpdf/qtest/qpdf/bad14.pdf create mode 100644 qpdf/qtest/qpdf/bad15-recover.out create mode 100644 qpdf/qtest/qpdf/bad15.out create mode 100644 qpdf/qtest/qpdf/bad15.pdf create mode 100644 qpdf/qtest/qpdf/bad16-recover.out create mode 100644 qpdf/qtest/qpdf/bad16.out create mode 100644 qpdf/qtest/qpdf/bad16.pdf create mode 100644 qpdf/qtest/qpdf/bad17-recover.out create mode 100644 qpdf/qtest/qpdf/bad17.out create mode 100644 qpdf/qtest/qpdf/bad17.pdf create mode 100644 qpdf/qtest/qpdf/bad18-recover.out create mode 100644 qpdf/qtest/qpdf/bad18.out create mode 100644 qpdf/qtest/qpdf/bad18.pdf create mode 100644 qpdf/qtest/qpdf/bad19-recover.out create mode 100644 qpdf/qtest/qpdf/bad19.out create mode 100644 qpdf/qtest/qpdf/bad19.pdf create mode 100644 qpdf/qtest/qpdf/bad2-recover.out create mode 100644 qpdf/qtest/qpdf/bad2.out create mode 100644 qpdf/qtest/qpdf/bad2.pdf create mode 100644 qpdf/qtest/qpdf/bad20-recover.out create mode 100644 qpdf/qtest/qpdf/bad20.out create mode 100644 qpdf/qtest/qpdf/bad20.pdf create mode 100644 qpdf/qtest/qpdf/bad21-recover.out create mode 100644 qpdf/qtest/qpdf/bad21.out create mode 100644 qpdf/qtest/qpdf/bad21.pdf create mode 100644 qpdf/qtest/qpdf/bad22-recover.out create mode 100644 qpdf/qtest/qpdf/bad22.out create mode 100644 qpdf/qtest/qpdf/bad22.pdf create mode 100644 qpdf/qtest/qpdf/bad23-recover.out create mode 100644 qpdf/qtest/qpdf/bad23.out create mode 100644 qpdf/qtest/qpdf/bad23.pdf create mode 100644 qpdf/qtest/qpdf/bad24-recover.out create mode 100644 qpdf/qtest/qpdf/bad24.out create mode 100644 qpdf/qtest/qpdf/bad24.pdf create mode 100644 qpdf/qtest/qpdf/bad25-recover.out create mode 100644 qpdf/qtest/qpdf/bad25.out create mode 100644 qpdf/qtest/qpdf/bad25.pdf create mode 100644 qpdf/qtest/qpdf/bad26-recover.out create mode 100644 qpdf/qtest/qpdf/bad26.out create mode 100644 qpdf/qtest/qpdf/bad26.pdf create mode 100644 qpdf/qtest/qpdf/bad27-recover.out create mode 100644 qpdf/qtest/qpdf/bad27.out create mode 100644 qpdf/qtest/qpdf/bad27.pdf create mode 100644 qpdf/qtest/qpdf/bad28-recover.out create mode 100644 qpdf/qtest/qpdf/bad28.out create mode 100644 qpdf/qtest/qpdf/bad28.pdf create mode 100644 qpdf/qtest/qpdf/bad29-recover.out create mode 100644 qpdf/qtest/qpdf/bad29.out create mode 100644 qpdf/qtest/qpdf/bad29.pdf create mode 100644 qpdf/qtest/qpdf/bad3-recover.out create mode 100644 qpdf/qtest/qpdf/bad3.out create mode 100644 qpdf/qtest/qpdf/bad3.pdf create mode 100644 qpdf/qtest/qpdf/bad30-recover.out create mode 100644 qpdf/qtest/qpdf/bad30.out create mode 100644 qpdf/qtest/qpdf/bad30.pdf create mode 100644 qpdf/qtest/qpdf/bad31-recover.out create mode 100644 qpdf/qtest/qpdf/bad31.out create mode 100644 qpdf/qtest/qpdf/bad31.pdf create mode 100644 qpdf/qtest/qpdf/bad32-recover.out create mode 100644 qpdf/qtest/qpdf/bad32.out create mode 100644 qpdf/qtest/qpdf/bad32.pdf create mode 100644 qpdf/qtest/qpdf/bad33-recover.out create mode 100644 qpdf/qtest/qpdf/bad33.out create mode 100644 qpdf/qtest/qpdf/bad33.pdf create mode 100644 qpdf/qtest/qpdf/bad34-recover.out create mode 100644 qpdf/qtest/qpdf/bad34.out create mode 100644 qpdf/qtest/qpdf/bad34.pdf create mode 100644 qpdf/qtest/qpdf/bad35-recover.out create mode 100644 qpdf/qtest/qpdf/bad35.out create mode 100644 qpdf/qtest/qpdf/bad35.pdf create mode 100644 qpdf/qtest/qpdf/bad4-recover.out create mode 100644 qpdf/qtest/qpdf/bad4.out create mode 100644 qpdf/qtest/qpdf/bad4.pdf create mode 100644 qpdf/qtest/qpdf/bad5-recover.out create mode 100644 qpdf/qtest/qpdf/bad5.out create mode 100644 qpdf/qtest/qpdf/bad5.pdf create mode 100644 qpdf/qtest/qpdf/bad6-recover.out create mode 100644 qpdf/qtest/qpdf/bad6.out create mode 100644 qpdf/qtest/qpdf/bad6.pdf create mode 100644 qpdf/qtest/qpdf/bad7-recover.out create mode 100644 qpdf/qtest/qpdf/bad7.out create mode 100644 qpdf/qtest/qpdf/bad7.pdf create mode 100644 qpdf/qtest/qpdf/bad8-recover.out create mode 100644 qpdf/qtest/qpdf/bad8.out create mode 100644 qpdf/qtest/qpdf/bad8.pdf create mode 100644 qpdf/qtest/qpdf/bad9-recover.out create mode 100644 qpdf/qtest/qpdf/bad9.out create mode 100644 qpdf/qtest/qpdf/bad9.pdf create mode 100644 qpdf/qtest/qpdf/badlin1.out create mode 100644 qpdf/qtest/qpdf/badlin1.pdf create mode 100644 qpdf/qtest/qpdf/c-decrypt-with-owner.pdf create mode 100644 qpdf/qtest/qpdf/c-decrypt-with-user.pdf create mode 100644 qpdf/qtest/qpdf/c-ignore-xref-streams.pdf create mode 100644 qpdf/qtest/qpdf/c-info-out.pdf create mode 100644 qpdf/qtest/qpdf/c-info1.out create mode 100644 qpdf/qtest/qpdf/c-info2-in.pdf create mode 100644 qpdf/qtest/qpdf/c-info2.out create mode 100644 qpdf/qtest/qpdf/c-invalid-password.out create mode 100644 qpdf/qtest/qpdf/c-linearized.pdf create mode 100644 qpdf/qtest/qpdf/c-no-options.pdf create mode 100644 qpdf/qtest/qpdf/c-no-original-object-ids.pdf create mode 100644 qpdf/qtest/qpdf/c-no-recovery.out create mode 100644 qpdf/qtest/qpdf/c-normalized-content.pdf create mode 100644 qpdf/qtest/qpdf/c-object-streams.pdf create mode 100644 qpdf/qtest/qpdf/c-qdf.pdf create mode 100644 qpdf/qtest/qpdf/c-r2.pdf create mode 100644 qpdf/qtest/qpdf/c-r3.pdf create mode 100644 qpdf/qtest/qpdf/c-r4.pdf create mode 100644 qpdf/qtest/qpdf/c-read-errors.out create mode 100644 qpdf/qtest/qpdf/c-read-warnings-and-errors.out create mode 100644 qpdf/qtest/qpdf/c-uncompressed-streams.pdf create mode 100644 qpdf/qtest/qpdf/c-write-damaged.out create mode 100644 qpdf/qtest/qpdf/c-write-errors.out create mode 100644 qpdf/qtest/qpdf/c-write-warnings-and-errors.out create mode 100644 qpdf/qtest/qpdf/check-ID.pl create mode 100644 qpdf/qtest/qpdf/compressed-metadata.pdf create mode 100644 qpdf/qtest/qpdf/copied-encryption.out create mode 100644 qpdf/qtest/qpdf/copy-foreign-objects-errors.out create mode 100644 qpdf/qtest/qpdf/copy-foreign-objects-in.pdf create mode 100644 qpdf/qtest/qpdf/copy-foreign-objects-out1.pdf create mode 100644 qpdf/qtest/qpdf/copy-foreign-objects-out2.pdf create mode 100644 qpdf/qtest/qpdf/copy-foreign-objects-out3.pdf create mode 100644 qpdf/qtest/qpdf/damaged-stream-c-check.out create mode 100644 qpdf/qtest/qpdf/damaged-stream.out create mode 100644 qpdf/qtest/qpdf/damaged-stream.pdf create mode 100644 qpdf/qtest/qpdf/decrypted-crypt-filter.pdf create mode 100644 qpdf/qtest/qpdf/delete-and-reuse.pdf create mode 100644 qpdf/qtest/qpdf/delete-and-reuse.qdf create mode 100755 qpdf/qtest/qpdf/diff-encrypted create mode 100755 qpdf/qtest/qpdf/diff-ignore-ID-version create mode 100644 qpdf/qtest/qpdf/empty-object.out create mode 100644 qpdf/qtest/qpdf/empty-object.pdf create mode 100644 qpdf/qtest/qpdf/enc-R2,V1,O=master.pdf create mode 100644 qpdf/qtest/qpdf/enc-R2,V1,U=view,O=master.pdf create mode 100644 qpdf/qtest/qpdf/enc-R2,V1,U=view.pdf create mode 100644 qpdf/qtest/qpdf/enc-R2,V1.pdf create mode 100644 qpdf/qtest/qpdf/enc-R3,V2,O=master.pdf create mode 100644 qpdf/qtest/qpdf/enc-R3,V2,U=view,O=master.pdf create mode 100644 qpdf/qtest/qpdf/enc-R3,V2,U=view.pdf create mode 100644 qpdf/qtest/qpdf/enc-R3,V2.pdf create mode 100644 qpdf/qtest/qpdf/enc-base.pdf create mode 100644 qpdf/qtest/qpdf/enc-long-password.pdf create mode 100644 qpdf/qtest/qpdf/encrypted-with-images.pdf create mode 100644 qpdf/qtest/qpdf/encrypted1.out create mode 100644 qpdf/qtest/qpdf/eof-reading-token.out create mode 100644 qpdf/qtest/qpdf/eof-reading-token.pdf create mode 100644 qpdf/qtest/qpdf/eof-terminates-literal.out create mode 100644 qpdf/qtest/qpdf/eof-terminates-literal.pdf create mode 100644 qpdf/qtest/qpdf/extra-header-lin-newline.pdf create mode 100644 qpdf/qtest/qpdf/extra-header-lin-no-newline.pdf create mode 100644 qpdf/qtest/qpdf/extra-header-newline.pdf create mode 100644 qpdf/qtest/qpdf/extra-header-no-newline.pdf create mode 100644 qpdf/qtest/qpdf/fax-decode-parms.out create mode 100644 qpdf/qtest/qpdf/fax-decode-parms.pdf create mode 100644 qpdf/qtest/qpdf/filter-abbreviation.out create mode 100644 qpdf/qtest/qpdf/filter-abbreviation.pdf create mode 100644 qpdf/qtest/qpdf/fix1.qdf create mode 100644 qpdf/qtest/qpdf/fix1.qdf.out create mode 100644 qpdf/qtest/qpdf/fix2.qdf create mode 100644 qpdf/qtest/qpdf/fix2.qdf.out create mode 100644 qpdf/qtest/qpdf/forced-version.out create mode 100644 qpdf/qtest/qpdf/foreign-in-write.out create mode 100644 qpdf/qtest/qpdf/from-scratch-0.pdf create mode 100644 qpdf/qtest/qpdf/good1.out create mode 100644 qpdf/qtest/qpdf/good1.pdf create mode 100644 qpdf/qtest/qpdf/good1.qdf create mode 100644 qpdf/qtest/qpdf/good10.out create mode 100644 qpdf/qtest/qpdf/good10.pdf create mode 100644 qpdf/qtest/qpdf/good10.qdf create mode 100644 qpdf/qtest/qpdf/good11.out create mode 100644 qpdf/qtest/qpdf/good11.pdf create mode 100644 qpdf/qtest/qpdf/good11.qdf create mode 100644 qpdf/qtest/qpdf/good12.out create mode 100644 qpdf/qtest/qpdf/good12.pdf create mode 100644 qpdf/qtest/qpdf/good12.qdf create mode 100644 qpdf/qtest/qpdf/good13.out create mode 100644 qpdf/qtest/qpdf/good13.pdf create mode 100644 qpdf/qtest/qpdf/good13.qdf create mode 100644 qpdf/qtest/qpdf/good14.out create mode 100644 qpdf/qtest/qpdf/good14.pdf create mode 100644 qpdf/qtest/qpdf/good14.qdf create mode 100644 qpdf/qtest/qpdf/good15.out create mode 100644 qpdf/qtest/qpdf/good15.pdf create mode 100644 qpdf/qtest/qpdf/good15.qdf create mode 100644 qpdf/qtest/qpdf/good16.out create mode 100644 qpdf/qtest/qpdf/good16.pdf create mode 100644 qpdf/qtest/qpdf/good16.qdf create mode 100644 qpdf/qtest/qpdf/good17-not-qdf.pdf create mode 100644 qpdf/qtest/qpdf/good17-not-recompressed.pdf create mode 100644 qpdf/qtest/qpdf/good17.out create mode 100644 qpdf/qtest/qpdf/good17.pdf create mode 100644 qpdf/qtest/qpdf/good17.qdf create mode 100644 qpdf/qtest/qpdf/good18.out create mode 100644 qpdf/qtest/qpdf/good18.pdf create mode 100644 qpdf/qtest/qpdf/good18.qdf create mode 100644 qpdf/qtest/qpdf/good19.out create mode 100644 qpdf/qtest/qpdf/good19.pdf create mode 100644 qpdf/qtest/qpdf/good19.qdf create mode 100644 qpdf/qtest/qpdf/good2.out create mode 100644 qpdf/qtest/qpdf/good2.pdf create mode 100644 qpdf/qtest/qpdf/good2.qdf create mode 100644 qpdf/qtest/qpdf/good20.out create mode 100644 qpdf/qtest/qpdf/good20.pdf create mode 100644 qpdf/qtest/qpdf/good20.qdf create mode 100644 qpdf/qtest/qpdf/good3.out create mode 100644 qpdf/qtest/qpdf/good3.pdf create mode 100644 qpdf/qtest/qpdf/good3.qdf create mode 100644 qpdf/qtest/qpdf/good4.out create mode 100644 qpdf/qtest/qpdf/good4.pdf create mode 100644 qpdf/qtest/qpdf/good4.qdf create mode 100644 qpdf/qtest/qpdf/good5.out create mode 100644 qpdf/qtest/qpdf/good5.pdf create mode 100644 qpdf/qtest/qpdf/good5.qdf create mode 100644 qpdf/qtest/qpdf/good6.out create mode 100644 qpdf/qtest/qpdf/good6.pdf create mode 100644 qpdf/qtest/qpdf/good6.qdf create mode 100644 qpdf/qtest/qpdf/good7-not-normalized.qdf create mode 100644 qpdf/qtest/qpdf/good7.out create mode 100644 qpdf/qtest/qpdf/good7.pdf create mode 100644 qpdf/qtest/qpdf/good7.qdf create mode 100644 qpdf/qtest/qpdf/good8.out create mode 100644 qpdf/qtest/qpdf/good8.pdf create mode 100644 qpdf/qtest/qpdf/good8.qdf create mode 100644 qpdf/qtest/qpdf/good9.out create mode 100644 qpdf/qtest/qpdf/good9.pdf create mode 100644 qpdf/qtest/qpdf/good9.qdf create mode 100644 qpdf/qtest/qpdf/heifer.out create mode 100644 qpdf/qtest/qpdf/heifer.pdf create mode 100644 qpdf/qtest/qpdf/heifer.qdf create mode 100644 qpdf/qtest/qpdf/hybrid-xref.1-ogen.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.1-ogen.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.1.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.1.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.10-ogen.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.10-ogen.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.10.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.10.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.11-ogen.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.11-ogen.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.11.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.11.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.12-ogen.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.12-ogen.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.12.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.12.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.2-ogen.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.2-ogen.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.2.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.2.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.3-ogen.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.3-ogen.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.3.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.3.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.4-ogen.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.4-ogen.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.4.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.4.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.5-ogen.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.5-ogen.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.5.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.5.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.6-ogen.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.6-ogen.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.6.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.6.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.7-ogen.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.7-ogen.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.7.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.7.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.8-ogen.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.8-ogen.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.8.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.8.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.9-ogen.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.9-ogen.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.9.c-check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.9.check create mode 100644 qpdf/qtest/qpdf/hybrid-xref.pdf create mode 100644 qpdf/qtest/qpdf/inline-images-cr.pdf create mode 100644 qpdf/qtest/qpdf/inline-images.1-ogen.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.1-ogen.check create mode 100644 qpdf/qtest/qpdf/inline-images.1.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.1.check create mode 100644 qpdf/qtest/qpdf/inline-images.10-ogen.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.10-ogen.check create mode 100644 qpdf/qtest/qpdf/inline-images.10.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.10.check create mode 100644 qpdf/qtest/qpdf/inline-images.11-ogen.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.11-ogen.check create mode 100644 qpdf/qtest/qpdf/inline-images.11.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.11.check create mode 100644 qpdf/qtest/qpdf/inline-images.12-ogen.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.12-ogen.check create mode 100644 qpdf/qtest/qpdf/inline-images.12.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.12.check create mode 100644 qpdf/qtest/qpdf/inline-images.2-ogen.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.2-ogen.check create mode 100644 qpdf/qtest/qpdf/inline-images.2.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.2.check create mode 100644 qpdf/qtest/qpdf/inline-images.3-ogen.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.3-ogen.check create mode 100644 qpdf/qtest/qpdf/inline-images.3.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.3.check create mode 100644 qpdf/qtest/qpdf/inline-images.4-ogen.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.4-ogen.check create mode 100644 qpdf/qtest/qpdf/inline-images.4.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.4.check create mode 100644 qpdf/qtest/qpdf/inline-images.5-ogen.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.5-ogen.check create mode 100644 qpdf/qtest/qpdf/inline-images.5.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.5.check create mode 100644 qpdf/qtest/qpdf/inline-images.6-ogen.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.6-ogen.check create mode 100644 qpdf/qtest/qpdf/inline-images.6.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.6.check create mode 100644 qpdf/qtest/qpdf/inline-images.7-ogen.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.7-ogen.check create mode 100644 qpdf/qtest/qpdf/inline-images.7.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.7.check create mode 100644 qpdf/qtest/qpdf/inline-images.8-ogen.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.8-ogen.check create mode 100644 qpdf/qtest/qpdf/inline-images.8.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.8.check create mode 100644 qpdf/qtest/qpdf/inline-images.9-ogen.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.9-ogen.check create mode 100644 qpdf/qtest/qpdf/inline-images.9.c-check create mode 100644 qpdf/qtest/qpdf/inline-images.9.check create mode 100644 qpdf/qtest/qpdf/inline-images.pdf create mode 100644 qpdf/qtest/qpdf/large_file-check-linearized.out create mode 100644 qpdf/qtest/qpdf/large_file-check-normal.out create mode 100644 qpdf/qtest/qpdf/large_file-check-ostream-linearized.out create mode 100644 qpdf/qtest/qpdf/large_file-check-ostream.out create mode 100644 qpdf/qtest/qpdf/large_file.out create mode 100644 qpdf/qtest/qpdf/large_file_xref_reconstruct.out create mode 100644 qpdf/qtest/qpdf/lin-delete-and-reuse-check.out create mode 100644 qpdf/qtest/qpdf/lin-delete-and-reuse.pdf create mode 100644 qpdf/qtest/qpdf/lin-special.1-ogen.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.1-ogen.check create mode 100644 qpdf/qtest/qpdf/lin-special.1.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.1.check create mode 100644 qpdf/qtest/qpdf/lin-special.10-ogen.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.10-ogen.check create mode 100644 qpdf/qtest/qpdf/lin-special.10.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.10.check create mode 100644 qpdf/qtest/qpdf/lin-special.11-ogen.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.11-ogen.check create mode 100644 qpdf/qtest/qpdf/lin-special.11.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.11.check create mode 100644 qpdf/qtest/qpdf/lin-special.12-ogen.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.12-ogen.check create mode 100644 qpdf/qtest/qpdf/lin-special.12.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.12.check create mode 100644 qpdf/qtest/qpdf/lin-special.2-ogen.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.2-ogen.check create mode 100644 qpdf/qtest/qpdf/lin-special.2.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.2.check create mode 100644 qpdf/qtest/qpdf/lin-special.3-ogen.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.3-ogen.check create mode 100644 qpdf/qtest/qpdf/lin-special.3.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.3.check create mode 100644 qpdf/qtest/qpdf/lin-special.4-ogen.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.4-ogen.check create mode 100644 qpdf/qtest/qpdf/lin-special.4.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.4.check create mode 100644 qpdf/qtest/qpdf/lin-special.5-ogen.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.5-ogen.check create mode 100644 qpdf/qtest/qpdf/lin-special.5.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.5.check create mode 100644 qpdf/qtest/qpdf/lin-special.6-ogen.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.6-ogen.check create mode 100644 qpdf/qtest/qpdf/lin-special.6.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.6.check create mode 100644 qpdf/qtest/qpdf/lin-special.7-ogen.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.7-ogen.check create mode 100644 qpdf/qtest/qpdf/lin-special.7.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.7.check create mode 100644 qpdf/qtest/qpdf/lin-special.8-ogen.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.8-ogen.check create mode 100644 qpdf/qtest/qpdf/lin-special.8.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.8.check create mode 100644 qpdf/qtest/qpdf/lin-special.9-ogen.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.9-ogen.check create mode 100644 qpdf/qtest/qpdf/lin-special.9.c-check create mode 100644 qpdf/qtest/qpdf/lin-special.9.check create mode 100644 qpdf/qtest/qpdf/lin-special.disable.exp create mode 100644 qpdf/qtest/qpdf/lin-special.generate.exp create mode 100644 qpdf/qtest/qpdf/lin-special.pdf create mode 100644 qpdf/qtest/qpdf/lin-special.preserve.exp create mode 100644 qpdf/qtest/qpdf/lin0.out create mode 100644 qpdf/qtest/qpdf/lin0.pdf create mode 100644 qpdf/qtest/qpdf/lin1.out create mode 100644 qpdf/qtest/qpdf/lin1.pdf create mode 100644 qpdf/qtest/qpdf/lin2.out create mode 100644 qpdf/qtest/qpdf/lin2.pdf create mode 100644 qpdf/qtest/qpdf/lin3.out create mode 100644 qpdf/qtest/qpdf/lin3.pdf create mode 100644 qpdf/qtest/qpdf/lin4.out create mode 100644 qpdf/qtest/qpdf/lin4.pdf create mode 100644 qpdf/qtest/qpdf/lin5.out create mode 100644 qpdf/qtest/qpdf/lin5.pdf create mode 100644 qpdf/qtest/qpdf/lin6.out create mode 100644 qpdf/qtest/qpdf/lin6.pdf create mode 100644 qpdf/qtest/qpdf/lin7.out create mode 100644 qpdf/qtest/qpdf/lin7.pdf create mode 100644 qpdf/qtest/qpdf/lin8.out create mode 100644 qpdf/qtest/qpdf/lin8.pdf create mode 100644 qpdf/qtest/qpdf/lin9.out create mode 100644 qpdf/qtest/qpdf/lin9.pdf create mode 100644 qpdf/qtest/qpdf/linearized-and-warnings-1.out create mode 100644 qpdf/qtest/qpdf/linearized-and-warnings-2.out create mode 100644 qpdf/qtest/qpdf/linearized-and-warnings.pdf create mode 100644 qpdf/qtest/qpdf/long-id-check.out create mode 100644 qpdf/qtest/qpdf/long-id.pdf create mode 100644 qpdf/qtest/qpdf/merge-three-files-1.pdf create mode 100644 qpdf/qtest/qpdf/merge-three-files-2.pdf create mode 100644 qpdf/qtest/qpdf/metadata-crypt-filter.pdf create mode 100644 qpdf/qtest/qpdf/min-version.out create mode 100644 qpdf/qtest/qpdf/minimal.pdf create mode 100644 qpdf/qtest/qpdf/misc-1.out create mode 100644 qpdf/qtest/qpdf/misc-1.pdf create mode 100644 qpdf/qtest/qpdf/misc-2.out create mode 100644 qpdf/qtest/qpdf/misc-2.pdf create mode 100644 qpdf/qtest/qpdf/misc-3.out create mode 100644 qpdf/qtest/qpdf/misc-3.pdf create mode 100644 qpdf/qtest/qpdf/multiple-mods-check.out create mode 100644 qpdf/qtest/qpdf/multiple-mods.pdf create mode 100644 qpdf/qtest/qpdf/new-streams.pdf create mode 100644 qpdf/qtest/qpdf/obj0-check.out create mode 100644 qpdf/qtest/qpdf/obj0.pdf create mode 100644 qpdf/qtest/qpdf/object-stream.1-ogen.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.1-ogen.check create mode 100644 qpdf/qtest/qpdf/object-stream.1.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.1.check create mode 100644 qpdf/qtest/qpdf/object-stream.10-ogen.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.10-ogen.check create mode 100644 qpdf/qtest/qpdf/object-stream.10.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.10.check create mode 100644 qpdf/qtest/qpdf/object-stream.11-ogen.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.11-ogen.check create mode 100644 qpdf/qtest/qpdf/object-stream.11.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.11.check create mode 100644 qpdf/qtest/qpdf/object-stream.12-ogen.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.12-ogen.check create mode 100644 qpdf/qtest/qpdf/object-stream.12.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.12.check create mode 100644 qpdf/qtest/qpdf/object-stream.2-ogen.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.2-ogen.check create mode 100644 qpdf/qtest/qpdf/object-stream.2.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.2.check create mode 100644 qpdf/qtest/qpdf/object-stream.3-ogen.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.3-ogen.check create mode 100644 qpdf/qtest/qpdf/object-stream.3.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.3.check create mode 100644 qpdf/qtest/qpdf/object-stream.4-ogen.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.4-ogen.check create mode 100644 qpdf/qtest/qpdf/object-stream.4.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.4.check create mode 100644 qpdf/qtest/qpdf/object-stream.5-ogen.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.5-ogen.check create mode 100644 qpdf/qtest/qpdf/object-stream.5.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.5.check create mode 100644 qpdf/qtest/qpdf/object-stream.6-ogen.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.6-ogen.check create mode 100644 qpdf/qtest/qpdf/object-stream.6.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.6.check create mode 100644 qpdf/qtest/qpdf/object-stream.7-ogen.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.7-ogen.check create mode 100644 qpdf/qtest/qpdf/object-stream.7.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.7.check create mode 100644 qpdf/qtest/qpdf/object-stream.8-ogen.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.8-ogen.check create mode 100644 qpdf/qtest/qpdf/object-stream.8.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.8.check create mode 100644 qpdf/qtest/qpdf/object-stream.9-ogen.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.9-ogen.check create mode 100644 qpdf/qtest/qpdf/object-stream.9.c-check create mode 100644 qpdf/qtest/qpdf/object-stream.9.check create mode 100644 qpdf/qtest/qpdf/object-stream.disable.exp create mode 100644 qpdf/qtest/qpdf/object-stream.generate.exp create mode 100644 qpdf/qtest/qpdf/object-stream.pdf create mode 100644 qpdf/qtest/qpdf/object-stream.preserve.exp create mode 100644 qpdf/qtest/qpdf/old-and-complex-c-check.out create mode 100644 qpdf/qtest/qpdf/old-and-complex-check.out create mode 100644 qpdf/qtest/qpdf/old-and-complex.pdf create mode 100644 qpdf/qtest/qpdf/p1-a-p2-a.pdf create mode 100644 qpdf/qtest/qpdf/p1-a-p2-b.pdf create mode 100644 qpdf/qtest/qpdf/p1-a.pdf create mode 100644 qpdf/qtest/qpdf/p1-b.pdf create mode 100644 qpdf/qtest/qpdf/page-labels-and-outlines.pdf create mode 100644 qpdf/qtest/qpdf/page_api_1-out.pdf create mode 100644 qpdf/qtest/qpdf/page_api_1-out2.pdf create mode 100644 qpdf/qtest/qpdf/page_api_1-out3.pdf create mode 100644 qpdf/qtest/qpdf/page_api_1.out create mode 100644 qpdf/qtest/qpdf/page_api_1.out2 create mode 100644 qpdf/qtest/qpdf/page_api_1.pdf create mode 100644 qpdf/qtest/qpdf/page_api_2.out create mode 100644 qpdf/qtest/qpdf/page_api_2.pdf create mode 100644 qpdf/qtest/qpdf/pages-copy-encryption.pdf create mode 100644 qpdf/qtest/qpdf/pages-warning.out create mode 100644 qpdf/qtest/qpdf/parse-object.out create mode 100644 qpdf/qtest/qpdf/qstream.pdf create mode 100644 qpdf/qtest/qpdf/replaced-stream-data-flate.pdf create mode 100644 qpdf/qtest/qpdf/replaced-stream-data.pdf create mode 100644 qpdf/qtest/qpdf/reserved-objects.out create mode 100644 qpdf/qtest/qpdf/reserved-objects.pdf create mode 100644 qpdf/qtest/qpdf/shallow_array-out.pdf create mode 100644 qpdf/qtest/qpdf/shallow_array.pdf create mode 100644 qpdf/qtest/qpdf/shallow_stream.out create mode 100644 qpdf/qtest/qpdf/short-id-check.out create mode 100644 qpdf/qtest/qpdf/short-id.pdf create mode 100644 qpdf/qtest/qpdf/show-page-1-content-filtered.out create mode 100644 qpdf/qtest/qpdf/show-page-1-content-normalized.out create mode 100644 qpdf/qtest/qpdf/show-page-1-content-raw.out create mode 100644 qpdf/qtest/qpdf/show-page-1-image.out create mode 100644 qpdf/qtest/qpdf/show-page-1.out create mode 100644 qpdf/qtest/qpdf/show-pages-images.out create mode 100644 qpdf/qtest/qpdf/show-pages.out create mode 100644 qpdf/qtest/qpdf/show-unfilterable.out create mode 100644 qpdf/qtest/qpdf/show-xref-by-id-filtered.out create mode 100644 qpdf/qtest/qpdf/show-xref-by-id.out create mode 100644 qpdf/qtest/qpdf/show-xref.out create mode 100644 qpdf/qtest/qpdf/stream-data.pdf create mode 100644 qpdf/qtest/qpdf/stream-line-enders.out create mode 100644 qpdf/qtest/qpdf/stream-line-enders.pdf create mode 100644 qpdf/qtest/qpdf/stream-line-enders.qdf create mode 100644 qpdf/qtest/qpdf/test-32.out create mode 100644 qpdf/qtest/qpdf/test11.out create mode 100644 qpdf/qtest/qpdf/test14-in.pdf create mode 100644 qpdf/qtest/qpdf/test14-out.pdf create mode 100644 qpdf/qtest/qpdf/test14.out create mode 100644 qpdf/qtest/qpdf/test4-1.pdf create mode 100644 qpdf/qtest/qpdf/test4-1.qdf create mode 100644 qpdf/qtest/qpdf/test4-2.out create mode 100644 qpdf/qtest/qpdf/test4-2.pdf create mode 100644 qpdf/qtest/qpdf/test4-3.out create mode 100644 qpdf/qtest/qpdf/test4-3.pdf create mode 100644 qpdf/qtest/qpdf/test4-4.pdf create mode 100644 qpdf/qtest/qpdf/test4-4.qdf create mode 100644 qpdf/qtest/qpdf/test8.out create mode 100644 qpdf/qtest/qpdf/test9.out create mode 100644 qpdf/qtest/qpdf/unreferenced-indirect-scalar.out create mode 100644 qpdf/qtest/qpdf/unreferenced-indirect-scalar.pdf create mode 100644 qpdf/qtest/qpdf/xref-with-short-size-new.out create mode 100644 qpdf/qtest/qpdf/xref-with-short-size-recover.out create mode 100644 qpdf/qtest/qpdf/xref-with-short-size.out create mode 100644 qpdf/qtest/qpdf/xref-with-short-size.pdf create mode 100644 qpdf/test_driver.cc create mode 100644 qpdf/test_large_file.cc create mode 100644 qtest/QTC/perl/QTC.pm create mode 100644 qtest/README.txt create mode 100755 qtest/bin/qtest-driver create mode 100644 qtest/module/TestDriver.pm create mode 100644 zlib-flate/Makefile create mode 100644 zlib-flate/build.mk create mode 100644 zlib-flate/qtest/1.compressed create mode 100644 zlib-flate/qtest/1.uncompressed create mode 100644 zlib-flate/qtest/zf.test create mode 100644 zlib-flate/zlib-flate.cc diff --git a/Artistic-2.0 b/Artistic-2.0 new file mode 100644 index 0000000..bb2cfbd --- /dev/null +++ b/Artistic-2.0 @@ -0,0 +1,191 @@ +Artistic License 2.0 + +Copyright (c) 2000-2006, The Perl Foundation. + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +Preamble + +This license establishes the terms under which a given free software +Package may be copied, modified, distributed, and/or +redistributed. The intent is that the Copyright Holder maintains some +artistic control over the development of that Package while still +keeping the Package available as open source and free software. + +You are always permitted to make arrangements wholly outside of this +license directly with the Copyright Holder of a given Package. If the +terms of this license do not permit the full use that you propose to +make of the Package, you should contact the Copyright Holder and seek +a different licensing arrangement. + +Definitions + + "Copyright Holder" means the individual(s) or organization(s) named + in the copyright notice for the entire Package. + + "Contributor" means any party that has contributed code or other + material to the Package, in accordance with the Copyright Holder's + procedures. + + "You" and "your" means any person who would like to copy, + distribute, or modify the Package. + + "Package" means the collection of files distributed by the + Copyright Holder, and derivatives of that collection and/or of + those files. A given Package may consist of either the Standard + Version, or a Modified Version. + + "Distribute" means providing a copy of the Package or making it + accessible to anyone else, or in the case of a company or + organization, to others outside of your company or organization. + + "Distributor Fee" means any fee that you charge for Distributing + this Package or providing support for this Package to another + party. It does not mean licensing fees. + + "Standard Version" refers to the Package if it has not been + modified, or has been modified only in ways explicitly requested by + the Copyright Holder. + + "Modified Version" means the Package, if it has been changed, and + such changes were not explicitly requested by the Copyright Holder. + + "Original License" means this Artistic License as Distributed with + the Standard Version of the Package, in its current version or as + it may be modified by The Perl Foundation in the future. + + "Source" form means the source code, documentation source, and + configuration files for the Package. + + "Compiled" form means the compiled bytecode, object code, binary, + or any other form resulting from mechanical transformation or + translation of the Source form. + +Permission for Use and Modification Without Distribution + +(1) You are permitted to use the Standard Version and create and use +Modified Versions for any purpose without restriction, provided that +you do not Distribute the Modified Version. + +Permissions for Redistribution of the Standard Version + +(2) You may Distribute verbatim copies of the Source form of the +Standard Version of this Package in any medium without restriction, +either gratis or for a Distributor Fee, provided that you duplicate +all of the original copyright notices and associated disclaimers. At +your discretion, such verbatim copies may or may not include a +Compiled form of the Package. + +(3) You may apply any bug fixes, portability changes, and other +modifications made available from the Copyright Holder. The resulting +Package will still be considered the Standard Version, and as such +will be subject to the Original License. + +Distribution of Modified Versions of the Package as Source + +(4) You may Distribute your Modified Version as Source (either gratis +or for a Distributor Fee, and with or without a Compiled form of the +Modified Version) provided that you clearly document how it differs +from the Standard Version, including, but not limited to, documenting +any non-standard features, executables, or modules, and provided that +you do at least ONE of the following: + + (a) make the Modified Version available to the Copyright Holder of + the Standard Version, under the Original License, so that the + Copyright Holder may include your modifications in the Standard + Version. + + (b) ensure that installation of your Modified Version does not + prevent the user installing or running the Standard Version. In + addition, the Modified Version must bear a name that is different + from the name of the Standard Version. + + (c) allow anyone who receives a copy of the Modified Version to + make the Source form of the Modified Version available to others + under + + (i) the Original License or + + (ii) a license that permits the licensee to freely copy, modify + and redistribute the Modified Version using the same licensing + terms that apply to the copy that the licensee received, and + requires that the Source form of the Modified Version, and of + any works derived from it, be made freely available in that + license fees are prohibited but Distributor Fees are allowed. + Distribution of Compiled Forms of the Standard Version or + Modified Versions without the Source + +(5) You may Distribute Compiled forms of the Standard Version without +the Source, provided that you include complete instructions on how to +get the Source of the Standard Version. Such instructions must be +valid at the time of your distribution. If these instructions, at any +time while you are carrying out such distribution, become invalid, you +must provide new instructions on demand or cease further +distribution. If you provide valid instructions or cease distribution +within thirty days after you become aware that the instructions are +invalid, then you do not forfeit any of your rights under this +license. + +(6) You may Distribute a Modified Version in Compiled form without the +Source, provided that you comply with Section 4 with respect to the +Source of the Modified Version. + +Aggregating or Linking the Package + +(7) You may aggregate the Package (either the Standard Version or +Modified Version) with other packages and Distribute the resulting +aggregation provided that you do not charge a licensing fee for the +Package. Distributor Fees are permitted, and licensing fees for other +components in the aggregation are permitted. The terms of this license +apply to the use and Distribution of the Standard or Modified Versions +as included in the aggregation. + +(8) You are permitted to link Modified and Standard Versions with +other works, to embed the Package in a larger work of your own, or to +build stand-alone binary or bytecode versions of applications that +include the Package, and Distribute the result without restriction, +provided the result does not expose a direct interface to the Package. + +Items That are Not Considered Part of a Modified Version + +(9) Works (including, but not limited to, modules and scripts) that +merely extend or make use of the Package, do not, by themselves, cause +the Package to be a Modified Version. In addition, such works are not +considered parts of the Package itself, and are not subject to the +terms of this license. + +General Provisions + +(10) Any use, modification, and distribution of the Standard or +Modified Versions is governed by this Artistic License. By using, +modifying or distributing the Package, you accept this license. Do not +use, modify, or distribute the Package, if you do not accept this +license. + +(11) If your Modified Version has been derived from a Modified Version +made by someone other than you, you are nevertheless required to +ensure that your Modified Version complies with the requirements of +this license. + +(12) This license does not grant you the right to use any trademark, +service mark, tradename, or logo of the Copyright Holder. + +(13) This license includes the non-exclusive, worldwide, +free-of-charge patent license to make, have made, use, offer to sell, +sell, import and otherwise transfer the Package with respect to any +patent claims licensable by the Copyright Holder that are necessarily +infringed by the Package. If you institute patent litigation +(including a cross-claim or counterclaim) against any party alleging +that the Package constitutes direct or contributory patent +infringement, then this Artistic License to you shall terminate on the +date that such litigation is filed. + +(14) Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT +HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED +WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT +PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT +HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE +OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..fd15bda --- /dev/null +++ b/ChangeLog @@ -0,0 +1,682 @@ +2012-09-06 Jay Berkenbilt + + * 3.0.2: release + + * Add new method QPDFWriter::setExtraHeaderText to add extra text, + such as application-specific comments, to near the beginning of a + PDF file. For linearized files, this appears after the + linearization parameter dictionary. For non-linearized files, it + appears right after the PDF header and non-ASCII comment. + + * Make it possible to write the same QPDF object with two + different QPDFWriter objects that have both called + setLinearization(true) by making private method + QPDF::calculateLinearizationData() properly initialize its state. + + * Bug fix: Writing after calling QPDFWriter::setOutputMemory() + would cause a segmentation fault because of an internal field not + being initialized, rendering that method useless. This has been + corrected. + +2012-08-11 Jay Berkenbilt + + * 3.0.1: release + + * Bug fix: let EOF terminate a literal token as well as + whitespace or comments. + +2012-07-31 Jay Berkenbilt + + * 3.0.0: release + +2012-07-29 Jay Berkenbilt + + * 3.0.rc1: release + +2012-07-25 Jay Berkenbilt + + * From Tobias: add QPDFObjectHandle::replaceStreamData that takes + a std::string analogous to the QPDFObjectHandle::newStream that + takes a string that was added earlier. + +2012-07-21 Jay Berkenbilt + + * Change configure to have image comparison tests disabled by + default. Update README and README.maintainer with information + about running them. + + * Add --pages command-line option to qpdf to enable page-based + merging and splitting. + + * Add new method QPDFObjectHandle::replaceDict to replace a + stream's dictionary. Use with caution; see comments in + QPDFObjectHandle.hh. + + * Add new method QPDFObjectHandle::parse for creation of + QPDFObjectHandle objects from string representations of the + objects. Thanks to Tobias Hoffmann for the idea. + +2012-07-15 Jay Berkenbilt + + * add new QPDF::isEncrypted method that returns some additional + information beyond other versions. + + * libqpdf/QPDFWriter.cc: fix copyEncryptionParameters to fix the + minimum PDF version based on other file's encryption needs. This + is a fix to code added on 2012-07-14 and did not impact previously + released code. + + * libqpdf/QPDFWriter.cc (copyEncryptionParameters): Bug fix: qpdf + was not preserving whether or not AES encryption was being used + when copying encryption parameters. The file would still have + been properly encrypted, but a file that started off encrypted + with AES could have become encrypted with RC4. + +2012-07-14 Jay Berkenbilt + + * QPDFWriter: add public copyEncryptionParameters to allow copying + encryption parameters from another file. + + * QPDFWriter: detect if the user has inserted an indirect object + from another QPDF object and throw an exception directing the user + to copyForeignObject. + +2012-07-11 Jay Berkenbilt + + * Added new APIs to copy objects from one QPDF to another. This + includes letting QPDF::addPage() (and QPDF::addPageAt()) accept a + page object from another QPDF and adding + QPDF::copyForeignObject(). See QPDF.hh for details. + + * Add method QPDFObjectHandle::getOwningQPDF() to return the QPDF + object associated with an indirect QPDFObjectHandle. + + * Add convenience methods to QPDFObjectHandle: assertIndirect(), + isPageObject(), isPagesObject() + + * Cache when QPDF::pushInheritedAttributesToPage() has been called + to avoid traversing the pages trees multiple times. This state is + cleared by QPDF::updateAllPagesCache() and ignored by + QPDF::flattenPagesTree(). + +2012-07-08 Jay Berkenbilt + + * Add QPDFObjectHandle::newReserved to create a reserved object + and QPDF::replaceReserved to replace it with a real object. + QPDFObjectHandle::newReserved reserves an object ID in a QPDF + object and ensures that any references to it remain unresolved. + When QPDF::replaceReserved is later called, previous references to + the reserved object will properly resolve to the replaced object. + +2012-07-07 Jay Berkenbilt + + * NOTE: BREAKING API CHANGE. Remove previously required length + parameter from the version QPDFObjectHandle::replaceStreamData + that uses a stream data provider. Prior to qpdf 3.0.0, you had to + compute the stream length in advance so that qpdf could internally + verify that the stream data had the same length every time the + provider was invoked. Now this requirement is enforced a + different way, and the length parameter is no longer required. + Note that I take API-breaking changes very seriously and only did + it in this case since the lack of need to know length in advance + could significantly simplify people's code. If you were + previously going to a lot of trouble to compute the length of the + new stream data in advance, you now no longer have to do that. + You can just drop the length parameter and remove any code that + was previously computing the length. Thanks to Tobias Hoffmann + for pointing out how annoying the original interface was. + +2012-07-05 Jay Berkenbilt + + * Add QPDFWriter methods to write to an already open stdio FILE*. + Implementation and idea area based on contributions from Tobias + Hoffmann. + +2012-07-04 Jay Berkenbilt + + * Accept changes from Tobias Hoffmann: add public method + QPDF::pushInheritedAttributesToPage including warnings for + non-inherited keys that may be discarded from /Pages by + non-conformant PDF files when the /Pages tree is flattened. + +2012-06-27 Jay Berkenbilt + + * Add Pl_Concatenate pipeline for stream concatenation also + implemented by Tobias Hoffmann. Also added test code + (libtests/concatenate.cc). + + * Add new methods implemented by Tobias Hoffmann: + QPDFObjectHandle::newReal(double) and + QPDFObjectHandle::newStream(QPDF*, std::string const&). + +2012-06-26 Jay Berkenbilt + + * Minor changes so that support for PDF files larger than 4GB + works well with 32-bit and 64-bit Linux and also with 32-bit and + 64-bit Windows with both MSVC and mingw. + + * Rework internal methods for doing recovery of the cross + reference tables for much greater efficiency both in terms of time + and memory usage. + +2012-06-24 Jay Berkenbilt + + * Support PDF files larger than 4 GB. This involved many changes + to the ABI to increase the size of integer types used in various + places as well as increasing the amount of padding used when + creating linearized files. Automated tests for large files are + disabled by default. Run ./configure --help for information on + enabling them. Running the tests requires 11 GB of free disk + space and takes several minutes. + +2012-06-22 Jay Berkenbilt + + * examples/pdf-create.cc: Provide an example of creating a PDF + from scratch. This simple PDF has a single page with some text + and an image. + + * Add empty QPDFObjectHandle factories for array and dictionary. + With PDF-from-scratch capability, it is useful to be able to + create empty arrays and dictionaries and add keys to them. + Updated pdf_from_scratch.cc to use these interfaces. + +2012-06-21 Jay Berkenbilt + + * Add QPDF::emptyPDF() to create an empty QPDF object suitable for + adding pages and other objects to. pdf_from_scratch.cc is test + code that exercises it. + + * make/libtool.mk: Place user-specified CPPFLAGS and LDFLAGS later + in the compilation so that if a user installs things in a + non-standard place that they have to tell the build about, earlier + versions of qpdf installed there won't break the build. Thanks to + Macports for reporting this. (Fixes bug 3468860.) + + * Instead of using off_t in the public APIs, use qpdf_offset_t + instead. This is defined as long long in qpdf/Types.h. If your + system doesn't support long long, you can redefine it. + + * Add pkg-config files + + * QPDFObjectHandle: add shallowCopy() method + + * QPDF: add new APIs for adding and removing pages. This includes + addPage(), addPageAt(), and removePage(). Also a method + updateAllPagesCache() is now available to force update of the + internal pages cache if you should modify the pages structure + manually. + + * QPDF: new processFile method that takes an open FILE* + instead of a filename. + +2012-06-20 Jay Berkenbilt + + * Add new array mutation routines to QPDFObjectHandle. + Implemented by Tobias Hoffmann. + + * Rework APIs that use size_t, off_t, and primative integer types + so that size_t is used for sizes of memory and off_t is used for + file offsets. Also set _FILE_OFFSET_BITS so that large files can + be supported on 32-bit UNIX/Linux platforms. The code assumes in + places that sizeof(off_t) >= sizeof(size_t). This resulted in + non-compatible ABI changes and hopefully clears the way for QPDF + to work with files that are larger than 4 GiB in size. + + * Add support for versioned symbols on ELF platforms. + + * Various fixes for gcc 4.7 + +2011-04-06 Jay Berkenbilt + + * Fix PCRE to stop using deprecated (and now dropped) interfaces. + +2011-12-28 Jay Berkenbilt + + * 2.3.1: release + + * include if available to support MSVC 2010 + + * Since PCRE is not necessarily thread safe, don't declare any + PCRE objects to be static. + + * Disregard stderr output from ghostscript when using it to + compare images in the test suite; see comments in qpdf.test for + details. + + * Fixed a few documentation errors. + +2011-08-11 Jay Berkenbilt + + * 2.3.0: release + + * include/qpdf/qpdf-c.h ("C"): add new methods + qpdf_init_write_memory, qpdf_get_buffer_length, and + qpdf_get_buffer to support writing to memory from the C API. + + * include/qpdf/qpdf-c.h ("C"): add new methods qpdf_get_info_key + and qpdf_set_info_key for manipulating text fields of the /Info + dictionary. + +2011-08-10 Jay Berkenbilt + + * libqpdf/QPDFWriter.cc (copyEncryptionParameters): preserve + whether metadata is encryption. This fixes part of bug 3173659: + the password becomes invalid if qpdf copies an encrypted file with + cleartext-metadata. + + * include/qpdf/QPDFWriter.hh: add a new constructor that takes + only a QPDF reference and leaves specification of output for + later. Add methods setOutputFilename() to set the output to a + filename or stdout, and setOutputMemory() to indicate that output + should go to a memory buffer. Add method getBuffer() to retrieve + the buffer used if output was saved to a memory buffer. + + * include/qpdf/QPDF.hh: add methods replaceObject() and + swapObjects() to allow replacement of an object and swapping of + two objects by object ID. + + * include/qpdf/QPDFObjectHandle.hh: add new methods getDictAsMap() + and getArrayAsVector() for returning the elements of a dictionary + or an array as a map or vector. + +2011-06-25 Jay Berkenbilt + + * 2.2.4: release + +2011-06-23 Jay Berkenbilt + + * make/libtool.mk (install): Do not strip executables and shared + libraries during installation. Leave that up to the packager. + + * configure.ac: disable -Werror by default. + +2011-05-07 Jay Berkenbilt + + * libqpdf/QPDF_linearization.cc (isLinearized): remove unused + offset variable, found by a gcc 4.6 warning. + +2011-04-30 Jay Berkenbilt + + * 2.2.3: release + + * libqpdf/QPDF.cc (readObjectInternal): Accept the case of the + stream keyword being followed by carriage return by itself. While + this is not permitted by the specification, there are PDF files + that do this, and other readers can read them. + + * libqpdf/Pl_QPDFTokenizer.cc (processChar): When an inline image + is detected, suspend normalization only up to the end of the + inline image rather than for the remainder of the content stream. + (Fixes qpdf-Bugs 3152169.) + +2011-01-31 Jay Berkenbilt + + * libqpdf/QPDF.cc (readObjectAtOffset): use -1 rather than 0 when + reading an object at a given to indicate that no object number is + expected. This allows xref recovery to proceed even if a file + uses the invalid object number 0 as a regular object. + + * libqpdf/QPDF_linearization.cc (isLinearized): use -1 rather than + 0 as a sentintel for not having found the first object in the + file. Since -1 can never match the regular expression, this + prevents an infinite loop when checking a file that starts with + (erroneous) 0 0 obj. (Fixes qpdf-Bugs-3159950.) + +2010-10-04 Jay Berkenbilt + + * 2.2.2: release + + * include/qpdf/qpdf-c.h: Add qpdf_read_memory to C API to call + QPDF::processMemoryFile. + +2010-10-01 Jay Berkenbilt + + * 2.2.1: release + + * include/qpdf/QPDF.hh: Add setOutputStreams method to allow + redirection of library-generated output/error to alternative + streams. + + * include/qpdf/QPDF.hh: Add processMemoryFile method for + processing a PDF file from a memory buffer instead of a file. + +2010-09-24 Jay Berkenbilt + + * libqpdf/QPDF.cc: change private "file" method to be a + PointerHolder to prepare qpdf for being able to work + with PDF files loaded into memory in addition to working with + files on disk. + + * include/qpdf/PointerHolder.hh: add operator* and operator-> + methods so that PointerHolder objects can be used like pointers. + This is consistent with the smart pointer objects in the next + revision of C++. + +2010-09-05 Jay Berkenbilt + + * libqpdf/QPDF.cc (readObjectInternal): Recognize empty objects + and treat them as null. + + * libqpdf/QPDF_Stream.cc (filterable): Handle inline image filter + abbreviations as stream filter abbreviations. Although this is + not technically allowed by the PDF specification, table H.1 in the + pre-ISO spec indicates that Adobe's readers accept them. Thanks + to Jian Ma for bringing this to my + attention. + +2010-08-14 Jay Berkenbilt + + * 2.2.0: release + + * Rename README.windows to README-windows.txt and convert its line + endings to Windows-style line endings. Also mention Jian Ma's VC6 + port in the manual and README-windows.txt. + +2010-08-09 Jay Berkenbilt + + * Add QPDFObjectHandle::getRawStreamData to return raw + (unfiltered) stream data. + +2010-08-08 Jay Berkenbilt + + * 2.2.rc1: release + +2010-08-05 Jay Berkenbilt + + * Add QPDFObjectHandle::addPageContents, a convenience routine for + appending or prepending new streams to a page's content streams. + The "pdf-double-page-size" example illustrates its use. + + * Add new methods to QPDFObjectHandle: replaceStreamData and + newStream. These methods allow users of the qpdf library to add + new streams and to replace data of existing streams. The + "pdf-double-page-size" and "pdf-invert-images" examples illustrate + their use. + +2010-06-06 Jay Berkenbilt + + * Fix memory leak for QPDF objects whose underlying PDF objects + contain circular references. Thanks to Jian Ma + for calling my attention to the memory leak. + +2010-04-25 Jay Berkenbilt + + * 2.1.5: release + + * libqpdf/QPDF_encryption.cc (compute_encryption_key): remove + restrictions on length of file identifier string. (Fixes + qpdf-Bugs-2991412.) + +2010-04-18 Jay Berkenbilt + + * 2.1.4: release + + * libqpdf/QPDFWriter.cc (writeLinearized): the padding calculation + fix in 2.1.2 was applied in only one place but it was needed in + two places since there are actually two cross reference streams in + a linearized file. The new padding calculation is now used for + both streams. Hopefully this should put an end to linearization + padding problems. (Fixes qpdf-Bugs-2979219.) + +2010-04-10 Jay Berkenbilt + + * qpdf/qpdf.cc (main): Since qpdf --check only checks syntax and + stream encoding without doing any semantic checks, make the output + clearer when no errors around found. This is inspired by + qpdf-Bugs-2983225. + +2010-03-27 Jay Berkenbilt + + * 2.1.3: release + + * libqpdf/QPDF_optimization.cc (flattenScalarReferences): Flatten + scalar references for unreferenced objects as well as those seen + during traversal of the file. This matters when preserving object + streams that contain unreferenced objects with indirect scalars. + (Fixes qpdf-Bugs-2974522.) Updated TODO with a description of a + possibly better fix involving removal of flattenScalarReferences. + + * libqpdf/Pl_AES_PDF.cc (finish): Don't complain if an AES input + buffer is not a multiple of 16 bytes. Instead, just pad with + nulls and hope for the best. PDF files have been encountered "in + the wild" that contain AES buffers that aren't a multiple of 16 + bytes. + +2010-01-24 Jay Berkenbilt + + * 2.1.2: release + + * libqpdf/QPDFWriter.cc: fix logic error in padding calculation. + When writing linearized files with cross reference streams, the + padding calculation failed to take differences in sizes of + compressed data between pass 1 and pass 2 into consideration. + +2009-12-14 Jay Berkenbilt + + * 2.1.1: release + + * qpdf/qtest/qpdf.test: improve test for acroread to make sure it + actually works and is not just present in the path. + +2009-12-13 Jay Berkenbilt + + * libqpdf/qpdf/Pl_AES_PDF.hh: include , if available, so + we have valid definitions of uint32_t. + +2009-10-30 Jay Berkenbilt + + * 2.1: release + + * libqpdf/QPDF.cc: be more forgiving of extraneous whitespace in + the xref table and while recovering from error conditions. + +2009-10-26 Jay Berkenbilt + + * Work around failure of PCRE test case; this test case exercises + an aspect of PCRE that qpdf does not use, and the test fails with + the version of PCRE on Red Hat Enterprise Linux 5, so we ignore + failure on this particular test case. + + * Fix RPM .spec file to include "C" examples + +2009-10-24 Jay Berkenbilt + + * 2.1.rc1: release + + * Provide interfaces for getting qpdf's own version number + +2009-10-19 Jay Berkenbilt + + * include/qpdf/QPDF.hh (QPDF): getWarnings now returns a list of + QPDFExc rather than a list of strings. This way, warnings may be + inspected in more detail. + + * Include information about the last object read in most error + messages. Most of the time, this will provide a good hint as to + which object contains the error, but it's possible that the last + object read may not necessarily be the one that has the error if + the erroneous object was previously read and cached. + +2009-10-18 Jay Berkenbilt + + * If forcing version, disable object stream creation and/or + encryption if previous specifications are incompatible with new + version. It is still possible that PDF content, compression + schemes, etc., may be incompatible with the new version, but at + least this way, older viewers will at least have a chance. + + * libqpdf/QPDFWriter.cc (unparseObject): avoid compressing + Metadata streams if possible. + +2009-10-13 Jay Berkenbilt + + * Upgrade embedded qtest to version 1.4, which allows the test + suite to be run in Windows with MSYS and ActiveState Perl rather + than requiring Cygwin perl. + +2009-10-04 Jay Berkenbilt + + * Implement support AES encrypt and crypt filters. Implementation + is not fully tested due to lack of test data but has been tested + for several cases. + +2009-10-04 Jay Berkenbilt + + * Add methods to QPDFWriter and corresponding command line + arguments to qpdf to set the minimum output PDF version and also + to force the version to a particular value. + + * libqpdf/QPDF.cc (processXRefStream): warn and ignore extra xref + stream entries when stream is larger than reported size. This + used to be a fatal error. (Fixes qpdf-Bugs-2872265.) + +2009-09-27 Jay Berkenbilt + + * Add several methods to query permissions controlled by the + encryption dictionary. Note that qpdf does not enforce these + permissions even though it allows the user to query them. + + * The function QPDF::getUserPassword returned the user password + with the required padding as specified by the PDF specification. + This is seldom useful to users. This function has been replaced + by QPDF::getPaddedUserPassword. Call the new + QPDF::getTrimmedUserPassword to retreive the user password in a + human-readable format. + + * qpdf/qpdf.cc (main): qpdf --check now prints the PDF version + number in addition to its other output. + +2009-09-26 Jay Berkenbilt + + * Removed all references to QEXC; now using std::runtime_error and + std::logic_error and their subclasses for all exceptions. + +2009-05-03 Jay Berkenbilt + + * 2.0.6: release + + * libqpdf/QPDF_Stream.cc (filterable): ignore /DecodeParms if it's + not a type we recognize. (Fixes qpdf-Bugs-2779746.) + +2009-03-10 Jay Berkenbilt + + * 2.0.5: release + +2009-03-09 Jay Berkenbilt + + * libqpdf/Pl_LZWDecoder.cc: adjust LZWDecoder full table + detection, now having been able to adequately test boundary + conditions both and with and without early code change. Also + compared implementation with other LZW decoders. + +2009-03-08 Jay Berkenbilt + + * qpdf/fix-qdf (write_ostream): Adjust offsets while writing + object streams to account for changes in the length of the + dictionary and offset tables. + + * qpdf/qpdf.cc (main): In check mode, in addition to checking + structure of file, attempt to decode all stream data. + + * libqpdf/QPDFWriter.cc (QPDFWriter::writeObject): In QDF mode, + write a comment to the QDF file before each object that indicates + the object ID of the corresponding object from the original file. + Add --no-original-object-ids flag to qpdf and + setSuppressOriginalObjectIDs() method to QPDFWriter to turn this + behavior off. + + * libqpdf/QPDF.cc (QPDF::pipeStreamData): Issue a warning instead + of failing if there is a problem found while decoding stream. + + * qpdf/qpdf.cc: Exit with a status of 3 if warnings were found + regardless of what mode we're in. + +2009-02-21 Jay Berkenbilt + + * 2.0.4: release + +2009-02-20 Jay Berkenbilt + + * Fix many typos in comments and strings. + + * qpdf/qpdf.cc: in --check mode, if there are warnings but no + errors, exit with a status of 3. + + * libqpdf/QPDF.cc (QPDF::insertXrefEntry): when recovering the + cross-reference table, have objects we encounter later in the file + supersede those we found earlier. This improves the chances of + being able to recover appended files with damaged cross-reference + tables. + +2009-02-19 Jay Berkenbilt + + * libqpdf/Pl_LZWDecoder.cc: correct logic error for previously + untested case of running the LZW decoder without the "early code + change" flag. Thanks to a bug report from "Atom Smasher", I + finally was able to obtain an input stream compressed in this way. + +2009-02-15 Jay Berkenbilt + + * 2.0.3: release + +2008-12-11 Jay Berkenbilt + + * qpdf/qpdf.cc (main): Accept -help and -version as well as --help + and --version + +2008-11-23 Jay Berkenbilt + + * Include stdio.h in a few files for proper compilation with (yet + to be released) gcc 4.4 + + * updated embedded qtest to version 1.3 + + * libqpdf/QPDF_String.cc (QPDF_String::getUTF8Val): handle + UTF-16BE properly rather than just treating the string as a string + of 16-bit characters. + +2008-06-30 Jay Berkenbilt + + * 2.0.2: release + + * updated embedded qtest to version 1.2 (includes previous + changes) + +2008-06-07 Jay Berkenbilt + + * qpdf/qtest/qpdf/diff-encrypted: change == to = so that the test + suite passes when /bin/sh is not bash + +2008-05-07 Jay Berkenbilt + + * qtest/bin/qtest-driver (run_test): increase timeout for qtest to + be more tolerant of slow machines + +2008-05-06 Jay Berkenbilt + + * 2.0.1: release + + * make/rules.mk: fix logic with .dep generation for .lo files so + that dependencies work properly with libtool + +2008-05-05 Jay Berkenbilt + + * libqpdf/qpdf/MD5.hh: fix header to be 64-bit clean + + * configure.ac: add tests for sized integer types + +2008-05-04 Jay Berkenbilt + + * libqpdf/QPDF_encryption.cc: do not assume size_t is unsigned int + + * qpdf/qtest/qpdf.test: removed locale-specific tests. These were + really to check bugs in perl 5.8.0 and are obsolete now. They + also make the test suite fail in some environments that don't have + all the locales fully configured. + + * various: updated several files for gcc 4.3 by adding missing + includes (string.h, stdlib.h) + +2008-04-26 Jay Berkenbilt + + * 2.0: initial public release diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..afe32aa --- /dev/null +++ b/INSTALL @@ -0,0 +1,216 @@ +These instructions based on the generic INSTALL file from automake +1.10. However, qpdf does not use automake, so not all of that file +applies. + +Basic Installation +================== + +Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + +Some systems require unusual options for compilation or linking that the +`configure' script does not know about. Run `./configure --help' for +details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + +Installation Names +================== + +By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + + You can also define the variable DESTDIR when you run make install +to install the package in a separate subdirectory. This is useful for +packaging. + +Optional Features +================= + +Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + +There may be some features `configure' cannot figure out automatically, +but needs to determine by the type of machine the package will run on. +Usually, assuming the package is built to be run on the _same_ +architectures, `configure' can figure that out, but if it prints a +message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + +If you want to set default values for `configure' scripts to share, you +can create a site shell script called `config.site' that gives default +values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + +Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + +`configure' recognizes the following options to control how it operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5a76ddd --- /dev/null +++ b/Makefile @@ -0,0 +1,135 @@ +# This makefile is inspired by abuild (http://www.abuild.org), which +# was used during the development of qpdf. The goal here is to have a +# non-recursive build with all the proper dependencies so we can start +# the build from anywhere and get the right stuff. Each directory has +# a build.mk that is included from here and is written from this +# directory's perspective. Each directory also has a proxy Makefile +# that allows you to start the build from any directory and get +# reasonable semantics for the all, check, and clean targets. + +# Our "build items" are directories. They are listed here such that +# no item precedes any item it depends on. Therefore, each item can +# safely reference variables set in its predecessors. + +# For each build item B, you can run make build_B, make check_B, or +# make clean_B to build, test, or clean B. Full dependencies are +# represented across all the items, so it is possible to start +# anywhere. From the top level, the "all", "check", and "clean" +# targets build, test, or clean everything. + +# Although this is not a GNU package and does not use automake, you +# can still run make clean to remove everything that is compiled, make +# distclean to remove everything that is generated by the end user, +# and make maintainer-clean to remove everything that is generated +# including things distributed with the source distribution. You can +# pass CLEAN=1 to prevent this Makefile from complaining if +# ./configure has not been run. + +# The install target works as usual and obeys --prefix and so forth +# passed to ./configure. You can also pass DESTDIR=/dir to make +# install to install in a separate location. This is useful for +# packagers. + +BUILD_ITEMS := manual libqpdf zlib-flate libtests qpdf examples +OUTPUT_DIR = build +ALL_TARGETS = + +.PHONY: default +default: all + +CLEAN ?= +ifneq ($(CLEAN),1) +ifeq ($(words $(wildcard autoconf.mk)),0) +DUMMY := $(shell echo 1>&2) +DUMMY := $(shell echo 1>&2 Please run ./configure before running $(MAKE)) +DUMMY := $(shell echo 1>&2) +$(error unable to continue with build) +endif + +autoconf.mk: + +include autoconf.mk + +endif + +# Prevent gnu make from trying to rebuild .dep files +$(foreach B,$(BUILD_ITEMS),$(eval \ + $(B)/$(OUTPUT_DIR)/%.dep: ;)) + +# Prevent gnu make from trying to rebuild .mk files +$(foreach B,$(BUILD_ITEMS),$(eval \ + $(B)/%.mk: ;)) +%.mk: ; +make/%.mk: ; + +BUILDRULES ?= libtool +include make/rules.mk + +DUMMY := $(shell mkdir $(foreach B,$(BUILD_ITEMS),$(B)/$(OUTPUT_DIR)) 2>/dev/null) + +include $(foreach B,$(BUILD_ITEMS),$(B)/build.mk) + +ALL_TARGETS = $(foreach B,$(BUILD_ITEMS),$(TARGETS_$(B))) + +TEST_ITEMS = $(foreach D,\ + $(wildcard $(foreach B,$(BUILD_ITEMS),$(B)/qtest)),\ + $(subst /,,$(dir $(D)))) + +TEST_TARGETS = $(foreach B,$(TEST_ITEMS),check_$(B)) + +CLEAN_TARGETS = $(foreach B,$(BUILD_ITEMS),clean_$(B)) + +# For test suitse +export QPDF_BIN = $(abspath qpdf/$(OUTPUT_DIR)/qpdf) +export QPDF_SKIP_TEST_COMPARE_IMAGES +export QPDF_LARGE_FILE_TEST_PATH + +clean:: $(CLEAN_TARGETS) + +.PHONY: $(CLEAN_TARGETS) +$(foreach B,$(BUILD_ITEMS),$(eval \ + clean_$(B): ; \ + $(RM) -r $(B)/$(OUTPUT_DIR))) + +distclean: clean + $(RM) -r autoconf.mk autom4te.cache config.log config.status libtool + $(RM) libqpdf/qpdf/qpdf-config.h + $(RM) manual/html.xsl + $(RM) manual/print.xsl + $(RM) doc/*.1 + $(RM) libqpdf.pc + +maintainer-clean: distclean + $(RM) configure doc/qpdf-manual.* libqpdf/qpdf/qpdf-config.h.in + $(RM) aclocal.m4 + $(RM) -r install-mingw install-msvc external-libs + +.PHONY: $(TEST_TARGETS) +$(foreach B,$(TEST_ITEMS),$(eval \ + check_$(B): $(TARGETS_$(B)))) + +.PHONY: $(foreach B,$(BUILD_ITEMS),build_$(B)) +$(foreach B,$(BUILD_ITEMS),$(eval \ + build_$(B): $(TARGETS_$(B)))) + +.PHONY: all +all: $(ALL_TARGETS) ; + +check: $(TEST_TARGETS) + +# Install targets are in the make directory in the rules-specific make +# fragments. + +QTEST=$(abspath qtest/bin/qtest-driver) +$(TEST_TARGETS): + @echo running qtest-driver for $(subst check_,,$@) + @(cd $(subst check_,,$@)/$(OUTPUT_DIR); \ + if TC_SRCS="$(foreach T,$(TC_SRCS_$(subst check_,,$@)),../../$(T))" \ + $(QTEST) -bindirs .:.. -datadir ../qtest -covdir ..; then \ + true; \ + else \ + if test "$(SHOW_FAILED_TEST_OUTPUT)" = "1"; then \ + cat -v qtest.log; \ + fi; \ + false; \ + fi) diff --git a/README b/README new file mode 100644 index 0000000..2d82a22 --- /dev/null +++ b/README @@ -0,0 +1,142 @@ +This is the QPDF package. Information about it can be found at +http://qpdf.sourceforge.net. The source code repository is hosted +at github: https://github.com/qpdf/qpdf. + +QPDF is copyright (c) 2005-2012 Jay Berkenbilt + +This software may be distributed under the terms of version 2 of the +Artistic License which may be found in the source distribution as +"Artistic-2.0". It is provided "as is" without express or implied +warranty. + + +Prerequisites +============= + +QPDF depends on external libraries "zlib" and "pcre". These are part +of virtually all Linux distributions and are readily available; +download information appears in the documentation. For Windows, you +can download pre-built binary versions of those libraries for some +compilers; see README-windows.txt for additional details. + +QPDF requires a C++ compiler that works with STL. Your compiler must +also support "long long". Almost all modern compilers do. If you are +trying to port qpdf to a compiler that doesn't support long long, you +could change all occurrences of "long long" to "long" in the source +code, noting that this would break binary compatibility with other +builds of qpdf. Doing so would certainly prevent qpdf from working +with files larger than 2 GB, but remaining functionality would most +likely work fine. If you built qpdf this way and it passed its test +suite with large file support disabled, you could be confident that +you had an otherwise working qpdf. + + +Licensing terms of embedded software +==================================== + +QPDF makes use of zlib and pcre for its functionality. These packages +can be downloaded separately from their own download locations, or +they can be downloaded in the external-libs area of the qpdf download +site. + +The Rijndael encryption implementation used as the basis for AES +encryption and decryption support comes from Philip J. Erdelsky's +public domain implementation. The files libqpdf/rijndael.cc and +libqpdf/qpdf/rijndael.h remain in the public domain. They were +obtained from + + http://www.efgh.com/software/rijndael.htm + http://www.efgh.com/software/rijndael.txt + + +Building on UNIX/Linux +====================== + +For UNIX and UNIX-like systems, you can usually get by with just + +./configure +make +make install + +Packagers may set DESTDIR, in which case make install will install +inside of DESTDIR, as is customary with many packages. For more +detailed general information, see the "INSTALL" file in this +directory. If you are already accustomed to building and installing +software that uses autoconf, there's nothing new for you in the +INSTALL file. + + +Building on Windows +=================== + +QPDF is known to build and pass its test suite with mingw (latest +version tested: gcc 4.6.2), mingw64 (latest version tested: 4.7.0) and +Microsoft Visual C++ 2010, both 32-bit and 64-bit versions. MSYS plus +ActiveState Perl is required to build as well in order to get make +and other related tools. See README-windows.txt for details on how to +build under Windows, see README-windows.txt. + + +Additional Notes on Build +========================= + +QPDF's build system, inspired by abuild (http://www.abuild.org), can +optionally use its own built-in rules rather than using libtool and +obeying the compiler specified with configure. This can be enabled by +passing --with-buildrules=buildrules where buildrules corresponds to +one of the .mk files (other than rules.mk) in the make directory. +This should never be necessary on a UNIX system, but may be necessary +on a Windows system. See README-windows.txt for details. There is a +gcc-linux.mk file enable "gcc-linux" build rules, but it is intended +to help test the build system; Linux users should build with the +"libtools" rules, which are enabled by default. + +The QPDF package provides some executables and a software library. A +user's manual can be found in the "doc" directory. The docbook +sources to the user's manual can be found in the "manual" directory. + +The software library is just libqpdf, and all the header files are in +the qpdf subdirectory. If you link statically with -lqpdf, then you +will also need to link with -lpcre and -lz. The shared qpdf library +is linked with -lpcre and -lz, and none of qpdf's public header files +directly include files from pcre or libz, so in many cases, qpdf's +development files are self contained. + +To learn about using the library, please read comments in the header +files in include/qpdf, especially QPDF.hh, QPDFObjectHandle.hh, and +QPDFWriter.hh. You can also study the code of qpdf/qpdf.cc, which +exercises most of the public interface. There are additional example +programs in the examples directory. Reading all the source files in +the qpdf directory (including the qpdf command-line tool and some test +drivers) along with the code in the examples directory will give you a +complete picture of every aspect of the public interface. + + +Additional Notes on Test Suite +============================== + +By default, slow tests are disabled. Slow tests include image +comparison tests and large file tests. Image comparison tests can be +enabled by passing --enable-test-compare-images to ./configure. This +was on by default in qpdf versions prior to 3.0, but is now off by +default. Large file tests can be enabled by passing +--with-large-file-test-path=path to ./configure or by setting the +QPDF_LARGE_FILE_TEST_PATH environment variable. Run ./configure +--help for additional options. The test suite provides nearly full +coverage even without these tests. Unless you are making deep changes +to the library that would impact the contents of the generated PDF +files or testing this on a new platform for the first time, there is +no real reason to run these tests. If you're just running the test +suite to make sure that qpdf works for your build, the default tests +are adequate. The configure rules for these tests do nothing other +than setting variables in autoconf.mk, so you can feel free to turn +these on and off directly in autoconf.mk rather than rerunning +configure. + +If you are packaging qpdf for a distribution and preparing a build +that is run by an autobuilder, you may want to add the +--enable-show-failed-test-output to configure options. This way, if +the test suite fails, test failure detail will be included in the +build output. Otherwise, you will have to have access to the +qtest.log file from the build to view test failures. The debian +packages for qpdf enable this option, for example. diff --git a/README-what-to-download.txt b/README-what-to-download.txt new file mode 100644 index 0000000..de04557 --- /dev/null +++ b/README-what-to-download.txt @@ -0,0 +1,52 @@ +To build from source for Linux or other UNIX/UNIX-like systems, it is +generally sufficient to download just the source qpdf-.tar.gz +file. + +For Windows, there are several additional files that you might want to +download. + + * qpdf--bin-mingw32.zip + + If you just want to use the qpdf command line program or use the + qpdf DLL's C-language interface, you can download this file. You + can also download this version if you are using MINGW's gcc 4.6 (or + a binary compatible version) and want to program using the C++ + interface. + + * qpdf--bin-mingw64.zip + + A 64-bit version built with mingw. Use this for 64-bit Windows + systems. The 32-bit version will also work on Windows 64-bit. + Both the 32-bit and the 64-bit version support files over 2 GB in + size, but you may find it easier to integrate this with your own + software if you use the 64-bit version. + + * qpdf--bin-msvc32.zip + + If you want to program using qpdf's C++ interface and you are using + Microsoft Visual C++ 2010 in 32-bit mode, you can download this + file. + + * qpdf--bin-msvc64.zip + + If you want to program using qpdf's C++ interface and you are using + Microsoft Visual C++ 2010 in 64-bit mode, you can download this + file. + + * qpdf-external-libs-bin.zip + + If you want to build qpdf for Windows yourself with either MINGW or + MSVC 2010, you can download this file and extract it inside the + qpdf source distribution. Please refer to README-windows.txt in + the qpdf source distribution for additional details. Note that you + need the 2012-06-20 version or later to be able to build qpdf 3.0 + or newer. The 2009-10-24 version is required for qpdf 2.3.1 or + older. + + * qpdf-external-libs-src.zip + + If you want to build the external libraries on your own (for + Windows or anything else), you can download this archive. In + addition to including unmodified distributions of pcre and zlib, it + includes a README file and some scripts to help you build them for + Windows. diff --git a/README-windows-install.txt b/README-windows-install.txt new file mode 100644 index 0000000..8e3fd65 --- /dev/null +++ b/README-windows-install.txt @@ -0,0 +1,10 @@ +This file is README-windows-install.txt in the source distribution and +README.txt in the Windows binary distribution. + +QPDF is completely relocatable. To use qpdf.exe or the qpdf DLL, just +have the bin directory in your path. To compile with qpdf, just add +the lib directory to your library path and the include directory to +your include path. Detailed documentation may be found in the doc +directory. + +Enjoy! diff --git a/README-windows.txt b/README-windows.txt new file mode 100644 index 0000000..682920c --- /dev/null +++ b/README-windows.txt @@ -0,0 +1,220 @@ +Common Setup +============ + +You may need to disable antivirus software to run qpdf's test suite. + +To be able to build qpdf and run its test suite, you must have MSYS +from MinGW installed, and you must have ActiveState Perl. Here's what +I did on my system: + +Install ActiveState perl. + +Grab the latest mingw-get-inst. From the installation wizard, choose +to install developer kit, C, and C++ support. Once installed, you +will have an icon to start an msys shell. From the msys shell, run + +mingw-get install msys-unzip msys-zip mingw32-make + +Then replace perl and make with the appropriate versions: + +mv /bin/perl.exe /bin/msys-perl.exe +mv /bin/make.exe /bin/msys-make.exe +mv /mingw/bin/mingw32-make.exe /mingw/bin/make.exe + +Make sure perl --version shows ActiveState perl. + +To install MinGW-w64, first install msys and mingw32 as above. + +From MinGW-w64 download page, go to "Toolchains targeting +Win64/Automated Builds" and find the latest mingw-w64 that runs under +i686-mingw. It will be called something like +mingw-w64-bin_i686-mingw_yyyymmdd.zip. The compiler binaries are +32-bit, which (of course) runs on 64-bit Windows. Extract this under +C:\MinGW-w64, and add C:\MinGW-w64\bin and C:\MinGW-w64\lib\mingw to +the path. + +As of this writing, the image comparison tests confuse ghostscript in +cygwin, but there's a chance they might work at some point. If you +want to run them, you need ghostscript and tiff utils as well, and you +will need to add --enable-test-compare-images from the configure +statements given below. + +Jian Ma has generously provided a port of QPDF +that works with Microsoft VC6. Several changes are required, but they +are well documented in his port. You can find the VC6 port in the +contrib area of the qpdf download area. It may not always be +up-to-date with the latest official qpdf release. + + +External Libraries +================== + +In order to build qpdf, you must have copies of zlib and pcre. The +easy way to get them is to download them from the qpdf download area. +There are packages called external-libs-bin.zip and +external-libs-src.zip. If you are building with MSVC 2010 or MINGW, +you can just extract the qpdf-external-libs-bin.zip zip file into the +top-level qpdf source tree. Note that you need the 2012-06-20 version +(at least) to build qpdf 3.0 or greater since this includes 64-bit +libraries. It will create a directory called external-libs which +contains header files and precompiled libraries. Passing +--enable-external-libs to ./configure (which is done automatically if +you follow the instructions below) is sufficient to find them. + +You can also obtain pcre and zlib directly on your own and install +them. If you are using mingw, you can just set CPPFLAGS, LDFLAGS, and +LIBS when you run ./configure so that it can find the header files and +libraries. If you are building with msvc and you want to do this, it +probably won't work because ./configure doesn't know how to interpret +LDFLAGS and LIBS properly for MSVC (though qpdf's own build system +does). In this case, you can probably get away with cheating by +passing --enable-external-libs to ./configure and then just editing +CPPFLAGS, LDFLAGS, LIBS in the generated autoconf.mk file. Note that +you should use UNIX-like syntax (-I, -L, -l) even though this is not +what cl takes on the command line. qpdf's build rules will fix it. + +You can also download qpdf-external-libs-src.zip and follow the +instructions in the README.txt there for how to build external libs. + + +Building with MinGW +=================== + +QPDF is known to build and pass its test suite with mingw (latest +version tested: gcc 4.6.2), mingw64 (latest version tested: 4.7.0) and +Microsoft Visual C++ 2010, both 32-bit and 64-bit versions. MSYS plus +ActiveState Perl is required to build as well in order to get make +and other related tools. While it is possible that Cygwin could be +used to build native Windows versions of qpdf, this configuration has +not been tested recently. + +From your MSYS prompt, run + + ./config-mingw32 + +or + + ./config-mingw64 + +and then + + make + +Note that ./config-mingw32 and ./configure-mingw64 just run +./configure with specific arguments, so you can look at it, make +adjustments, and manually run configure instead. Note also that +config-mingw32 appends definition of _FILE_OFFSET_BITS=64 to +qpdf-config.h since, as of the qpdf 3.0 release, the current versions +of the autoconf tools did not correctly detect that mingw requires +this to get large file support. This workaround is only required for +mingw32. The 64-bit version of mingw works "out of the box" with +large file support, as do both the 32-bit and 64-bit versions of MSVC. + +Add the absolute path to the libqpdf/build directory to your PATH. +Make sure you can run the qpdf command by typing qpdf/build/qpdf and +making sure you get a help message rather than an error loading the +DLL or no output at all. Run the test suite by typing + + make check + +If all goes well, you should get a passing test suite. + +To create an installation directory, run make install. This will +create install-mingw/qpdf-VERSION and populate it. The binary +download of qpdf for Windows with mingw is created from this +directory. + +You can also take a look at make_windows_releases for reference. This +is how the distributed Windows executables are created. + + +Building with MSVC 2010 +======================= + +These instructions would likely work with newer version of MSVC or +with full version of MSVC. They may also work with .NET 2005. They +have only been tested with Visual C++ 2010. Earlier version of qpdf +were built with MSVC 2008 Express. + +You should first set up your environment to be able to run MSVC from +the command line. There is usually a batch file included with MSVC +that does this. Make sure that you start a command line environment +configured for whichever of 32-bit or 64-bit output that you intend to +build for. + +From that cmd prompt, you can start your msys shell by just running +manually whatever command is associated with your msys shell icon. + +Configure as follows: + + ./config-msvc 32 + +or + + ./config-msvc 64 + +Note that you must pass the 32/64 option that matches your command +line setup. The scripts do not presently figure this out. If you +used the wrong argument, it would probably just build the size you +have in your environment and then install the results in the wrong +place. + +Once configured, run + + make + +Note that ./config-msvc just runs ./configure with specific arguments, +so you can look at it, make adjustments, and manually run configure +instead. + +NOTE: automated dependencies are not generated with the msvc build. +If you're planning on making modifications, you should probably work +with mingw. If there is a need, I can add dependency information to +the msvc build, but since I only use it for generating release +versions, I haven't bothered. + +Once built, add the full path to the libqpdf/build directory to your +path and run + + make check + +to run the test suite. + +If you are building with MSVC and want to debug a crash in MSVC's +debugger, first start an instance of Visual C++. Then run qpdf. When +the abort/retry/ignore dialog pops up, first attach the process from +within visual C++, and then click Retry in qpdf. + +A release version of qpdf is built by default. If you want to link +against debugging libraries, you will have to change /MD to /MDd in +make/msvc.mk. Note that you must redistribute the Microsoft runtime +DLLs. Linking with static runtime (/MT) won't work; see "Static +Runtime" below for details. + + +Runtime DLLs +============ + +Both build methods create executables and DLLs that are dependent on +the compiler's runtime DLLs. When you run make install, the +installation process will automatically detect the DLLs and copy them +into the installation bin directory. Look at the copy_dlls script for +details on how this is accomplished. + +Redistribution of the runtime DLL is unavoidable as of this writing; +see "Static Runtime" below for details. + + +Static Runtime +============== + +Building the DLL and executables with static runtime does not work +with either Visual C++ .NET 2008 (a.k.a. vc9) using /MT or with mingw +(at least as of 4.4.0) using -static-libgcc. The reason is that, in +both cases, there is static data involved with exception handling, and +when the runtime is linked in statically, exceptions cannot be thrown +across the DLL to EXE boundary. Since qpdf uses exception handling +extensively for error handling, we have no choice but to redistribute +the C++ runtime DLLs. Maybe this will be addressed in a future +version of the compilers. This has not been retested with the +toolchain versions used to create qpdf 3.0 distributions. diff --git a/README.maintainer b/README.maintainer new file mode 100644 index 0000000..b150eeb --- /dev/null +++ b/README.maintainer @@ -0,0 +1,143 @@ +Release Reminders +================= + + * When making a release, always remember to run large file tests and + image comparison tests (--enable-test-compare-images + --with-large-file-test-path=/path). For a major release, consider + running a spelling checker over the source code to catch errors in + variable names, strings, and comments. Use ispell -p ispell-words. + + * Consider running tests with latest gcc and/or valgrind. To do + this, replace, build with debugging and without shared libraries. + In build, create z and move each executable into z. Then create a + script called exec-z that contains: + + #!/bin/sh + exec valgrind --suppressions=/tmp/a.supp -q \ + `dirname $0`/z/`basename $0` ${1+"$@"} + + Symlink exec-z to each executable. /tmp/a.supp can be populated + with suppressions for libraries, for example: + + { + zlib1 + Memcheck:Cond + fun:inflateReset2 + fun:inflateInit2_ + } + + You can generate these by running valgrind with --gen-suppressions=yes. + + * Check all open issues in the sourceforge trackers. + + * If any interfaces were added or changed, check C API to see whether + changes are appropriate there as well. + + * Increment shared library version information as needed + (libqpdf/build.mk) + + * Update release notes in manual -- look at diffs and ChangeLog + + * Add a release entry to ChangeLog + + * Make sure version numbers are consistent in the following + locations: + + configure.ac + qpdf.spec + libqpdf/QPDF.cc + manual/qpdf-manual.xml + + make_dist verifies this consistency. + + * Update release date in manual/qpdf-manual.xml. Remember to ensure + that the entities at the top of the document are consistent with + the release notes for both version and release date. + + * Check TODO file to make sure all planned items for the release are + done or retargeted. + + * Each year, update copyright notices. Just search for Copyright. + Last updated: 2012. + + * To construct a source distribution from a pristine checkout, + make_dist does the following: + + ./autogen.sh + ./configure --enable-doc-maintenance --enable-werror + make build_manual + make distclean + + * To create a source release, do an export from the version control + system to a directory called qpdf-version. For example, from this + directory: + + rm -rf /tmp/qpdf-x.y.z + git archive --prefix=qpdf-x.y.z/ HEAD . | (cd /tmp; tar xf -) + + From the parent of that directory, run make_dist with the directory + as an argument. Remember to have fop in your path. For internally + testing releases, you can run make_dist with the --no-tests option. + + * To create a source release of external libs, do an export from the + version control system into a directory called qpdf-external-libs + and just make a zip file of the result called + qpdf-external-libs-src.zip. See the README.txt file there for + information on creating binary external libs releases. + + * To create Windows binary releases, extract the qpdf source + distribution in Windows (MSYS + MINGW, MSVC). From the extracted + directory, extract the binary distribution of the external + libraries. Run ./make_windows_releases from there. You will need + to have zip in your path. + + * Remember to copy README-what-to-download.txt separately onto the + download area and make it the default for Windows platforms. + + * Remember to update the web page including putting new documentation + in the "files" subdirectory of the website on sourceforge.net. + Linearize the PDF version of the manual when copying it there. + + * Create a tag in the version control system, and make backups of the + actual releases. With git, use git tag -s to create a signed tag: + + git tag -s release-qpdf-$version HEAD -m'qpdf $version' + + * When releasing on sourceforge, external-libs distributions go in + external-libs/yyyymmdd, and qpdf distributions go in qpdf/vvv + + +General Build Stuff +=================== + +QPDF uses autoconf and libtool but does not use automake. The only +files distributed with the qpdf source distribution that are not +controlled are "configure", "libqpdf/qpdf/qpdf-config.h.in", +"aclocal.m4", and some documentation. See above for the steps +required to prepare a source distribution. + +A small handful of additional files have been taken from autotools +programs. These should probably be updated from time to time. + + * config.guess, config.sub, ltmain.sh, and the m4 directory: these + were created by running libtoolize -c. To update, run libtoolize + -f -c or remove the files and rerun libtoolize. + + * Other files copied as indicated: + + cp /usr/share/automake-1.11/install-sh . + cp /usr/share/automake-1.11/mkinstalldirs . + +The entire contents of the m4 directory came from libtool.m4. If we +had some additional local parts, we could also add those to the m4 +directory. In order for this to work, it is necessary to run "aclocal +-I m4" before running autoheader and autoconf. + +If building or editing documentation, configure with +--enable-doc-maintenance. This will ensure that all tools or files +required to validate and build documentation are available. + +If you want to run make maintainer-clean or make distclean and you +haven't run ./configure, you can pass CLEAN=1 to make on the command +line to prevent it from complaining about configure not having been +run. diff --git a/TODO b/TODO new file mode 100644 index 0000000..ff3ecc8 --- /dev/null +++ b/TODO @@ -0,0 +1,178 @@ +General +======= + + * See if I can support the encryption format used with /R 5 /V 5, + even though a qpdf-announce subscriber with an adobe.com email + address mentioned that this is deprecated. There is also a new + encryption format coming in a future release, which may be better + to support. As of the qpdf 3.0 release, the specification was not + publicly available yet. + + * Consider the possibility of doing something locale-aware to support + non-ASCII passwords. Update documentation if this is done. + + * Look for %PDF header somewhere within the first 1024 bytes of the + file. Also accept headers of the form "%!PS−Adobe−N.n PDF−M.m". + See Implementation notes 13 and 14 in appendix H of the PDF 1.7 + specification. This is bug 3267974. + + * Consider impact of article threads on page splitting/merging. + Subramanyam provided a test file; see ../misc/article-threads.pdf. + Email Q-Count: 431864 from 2009-11-03. Other things to consider: + outlines, page labels, thumbnails, zones. There are probably + others. + + * See whether it's possible to remove the call to + flattenScalarReferences. I can't easily figure out why I do it, + but removing it causes strange test failures in linearization. I + would have to study the optimization and linearization code to + figure out why I added this to begin with and what in the code + assumes it's the case. For enqueueObject and unparseChild in + QPDFWriter, simply removing the checks for indirect scalars seems + sufficient. Looking back at the branch in the apex epub + repository, before flattening scalar references, there was special + case code in QPDFWriter to avoid writing out indirect nulls. It's + still not obvious to me why I did it though. + + To pursue this, remove the call to flattenScalarReferences in + QPDFWriter.cc and disable the logic_error exceptions for indirect + scalars. Just search for flattenScalarReferences in QPDFWriter.cc + since the logic errors have comments that mention + flattenScalarReferences. Then run the test suite. Several files + that explicitly test flattening of scalar references fail, but the + indirect scalars are properly preserved and written. But then + there are some linearized files that have a bunch of unreferenced + objects that contain scalars. Need to figure out what these are + and why they're there. Maybe they're objects that used to be + stream lengths. Probably we just need to make sure don't traverse + through a stream's /Length stream when enqueueing stream + dictionaries. This could potentially happen with any object that + QPDFWriter replaces when writing out files. Such objects would be + orphaned in the newly written file. This could be fixed, but it + may not be worth fixing. + + If flattenScalarReferences is removed, a new method will be needed + for checking PDF files. + + * See if we can avoid preserving unreferenced objects in object + streams even when preserving the object streams. + + * For debugging linearization bugs, consider adding an option to save + pass 1 of linearization. This code is sufficient. Change the + interface to allow specification of a pass1 file, which would + change the behavior as in this patch. + +------------------------------ +Index: QPDFWriter.cc +=================================================================== +--- QPDFWriter.cc (revision 932) ++++ QPDFWriter.cc (working copy) +@@ -1965,11 +1965,15 @@ + + // Write file in two passes. Part numbers refer to PDF spec 1.4. + ++ FILE* XXX = 0; + for (int pass = 1; pass <= 2; ++pass) + { + if (pass == 1) + { +- pushDiscardFilter(); ++// pushDiscardFilter(); ++ XXX = fopen("/tmp/pass1.pdf", "w"); ++ pushPipeline(new Pl_StdioFile("pass1", XXX)); ++ activatePipelineStack(); + } + + // Part 1: header +@@ -2204,6 +2208,8 @@ + + // Restore hint offset + this->xref[hint_id] = QPDFXRefEntry(1, hint_offset, 0); ++ fclose(XXX); ++ XXX = 0; + } + } + } +------------------------------ + + * Handle embedded files. PDF Reference 1.7 section 3.10, "File + Specifications", discusses this. Once we can definitely recognize + all embedded files in a document, we can update the encryption + code to handle it properly. In QPDF_encryption.cc, search for + cf_file. Remove exception thrown if cf_file is different from + cf_stream, and write code in the stream decryption section to use + cf_file instead of cf_stream. In general, add interfaces to get + the list of embedded files and to extract them. To handle general + embedded files associated with the whole document, follow root -> + /Names -> /EmbeddedFiles -> /Names to get to the file specification + dictionaries. Then, in each file specification dictionary, follow + /EF -> /F to the actual stream. There may be other places file + specification dictionaries may appear, and there are also /RF keys + with related files, so reread section 3.10 carefully. + + * The description of Crypt filters is unclear with respect to how to + use them to override /StmF for specific streams. I'm not sure + whether qpdf will do the right thing for any specific individual + streams that might have crypt filters. The specification seems to + imply that only embedded file streams and metadata streams can have + crypt filters, and there are already special cases in the code to + handle those. Most likely, it won't be a problem, but someday + someone may find a file that qpdf doesn't work on because of crypt + filters. There is an example in the spec of using a crypt filter + on a metadata stream. + + For now, we notice /Crypt filters and decode parameters consistent + with the example in the PDF specification, and the right thing + happens for metadata filters that happen to be uncompressed or + otherwise compressed in a way we can filter. This should handle + all normal cases, but it's more or less just a guess since I don't + have any test files that actually use stream-specific crypt filters + in them. + + * The second xref stream for linearized files has to be padded only + because we need file_size as computed in pass 1 to be accurate. If + we were not allowing writing to a pipe, we could seek back to the + beginning and fill in the value of /L in the linearization + dictionary as an optimization to alleviate the need for this + padding. Doing so would require us to pad the /L value + individually and also to save the file descriptor and determine + whether it's seekable. This is probably not worth bothering with. + + * The whole xref handling code in the QPDF object allows the same + object with more than one generation to coexist, but a lot of logic + assumes this isn't the case. Anything that creates mappings only + with the object number and not the generation is this way, + including most of the interaction between QPDFWriter and QPDF. If + we wanted to allow the same object with more than one generation to + coexist, which I'm not sure is allowed, we could fix this by + changing xref_table. Alternatively, we could detect and disallow + that case. In fact, it appears that Adobe reader and other PDF + viewing software silently ignores objects of this type, so this is + probably not a big deal. + + * Pl_PNGFilter is only partially implemented. If we ever decoded + images, we'd have to finish implementing it along with the other + filter decode parameters and types. For just handling xref + streams, there's really no need as it wouldn't make sense to use + any kind of predictor other than 12 (PNG UP filter). + + * If we ever want to have check mode check the integrity of the free + list, this can be done by looking at the code from prior to the + object stream support of 4/5/2008. It's in an if (0) block and + there's a comment about it. There's also something about it in + qpdf.test -- search for "free table". On the other hand, the value + of doing this seems very low since no viewer seems to care, so it's + probably not worth it. + + * QPDFObjectHandle::getPageImages() doesn't notice images in + inherited resource dictionaries. See comments in that function. + + * Based on an idea suggested by user "Atom Smasher", consider + providing some mechanism to recover earlier versions of a file + embedded prior to appended sections. + + * From a suggestion in bug 3152169, consider having an option to + re-encode inline images with an ASCII encoding. + + * From github issue 2, provide more in-depth output for examining + hint stream contents. diff --git a/autoconf.mk.in b/autoconf.mk.in new file mode 100644 index 0000000..630ba91 --- /dev/null +++ b/autoconf.mk.in @@ -0,0 +1,41 @@ +PACKAGE_TARNAME=@PACKAGE_TARNAME@ +PACKAGE_VERSION=@PACKAGE_VERSION@ +top_builddir=@top_builddir@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +bindir=@bindir@ +libdir=@libdir@ +includedir=@includedir@ +datarootdir=@datarootdir@ +mandir=@mandir@ +docdir=@docdir@ +htmldir=@htmldir@ +pdfdir=@pdfdir +CC=@CC@ +CFLAGS=@CFLAGS@ +LDFLAGS=@LDFLAGS@ +LIBS=@LIBS@ +CPPFLAGS=@CPPFLAGS@ +CXX=@CXX@ +CXXFLAGS=@CXXFLAGS@ +AR=@AR@ +RANLIB=@RANLIB@ +DLLTOOL=@DLLTOOL@ +STRIP=@STRIP@ +OBJDUMP=@OBJDUMP@ +GENDEPS=@GENDEPS@ +LIBTOOL=@LIBTOOL@ +DOCBOOKX_DTD=@DOCBOOKX_DTD@ +FOP=@FOP@ +XSLTPROC=@XSLTPROC@ +XMLLINT=@XMLLINT@ +BUILD_HTML=@BUILD_HTML@ +BUILD_PDF=@BUILD_PDF@ +VALIDATE_DOC=@VALIDATE_DOC@ +QPDF_SKIP_TEST_COMPARE_IMAGES=@QPDF_SKIP_TEST_COMPARE_IMAGES@ +BUILDRULES=@BUILDRULES@ +HAVE_LD_VERSION_SCRIPT=@HAVE_LD_VERSION_SCRIPT@ +WINDOWS_WORDSIZE=@WINDOWS_WORDSIZE@ +SHOW_FAILED_TEST_OUTPUT=@SHOW_FAILED_TEST_OUTPUT@ +# Allow environment variable to override +QPDF_LARGE_FILE_TEST_PATH?=@QPDF_LARGE_FILE_TEST_PATH@ diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..f6a3afb --- /dev/null +++ b/autogen.sh @@ -0,0 +1,4 @@ +#!/bin/sh +aclocal -I m4 +autoheader +autoconf diff --git a/config-mingw32 b/config-mingw32 new file mode 100755 index 0000000..d128e3f --- /dev/null +++ b/config-mingw32 @@ -0,0 +1,13 @@ +#!/bin/sh +./configure --disable-test-compare-images --enable-external-libs --with-windows-wordsize=32 --with-buildrules=mingw +# As of autoconf 2.69 and gcc 4.6, autoconf's configure fails to +# recognize that defining _FILE_OFFSET_BITS works with mingw32. +# Append to qpdf-config.h rather than passing CPPFLAGS on the +# commandline. This way we don't defeat the fact that test_large_file +# and other things that only use the public interface can be built +# without any special flags. +cat >> libqpdf/qpdf/qpdf-config.h <. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.sub b/config.sub new file mode 100755 index 0000000..c894da4 --- /dev/null +++ b/config.sub @@ -0,0 +1,1773 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. + +timestamp='2012-02-10' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted GNU ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | epiphany \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 \ + | ns16k | ns32k \ + | open8 \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze) + basic_machine=microblaze-xilinx + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i386-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..20a27a9 --- /dev/null +++ b/configure.ac @@ -0,0 +1,421 @@ +dnl Process this file with autoconf to produce a configure script. +dnl This config.in requires autoconf 2.5 or greater. + +AC_PREREQ([2.68]) +AC_INIT([qpdf],[3.0.2]) + +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_FILES([autoconf.mk]) +AC_CONFIG_FILES([manual/html.xsl manual/print.xsl]) +AC_CONFIG_FILES([libqpdf.pc]) +AC_CONFIG_HEADERS([libqpdf/qpdf/qpdf-config.h]) + +AC_PROG_CC +AC_PROG_CC_C99 +AC_PROG_CXX +AC_HEADER_STDC +LT_INIT([win32-dll]) + +USE_EXTERNAL_LIBS=0 +AC_MSG_CHECKING(for whether to use external libraries distribution) +AC_ARG_ENABLE(external-libs, + AS_HELP_STRING([--enable-external-libs], + [whether to use external libraries distribution]), + [if test "$enableval" = "yes"; then + USE_EXTERNAL_LIBS=1; + else + USE_EXTERNAL_LIBS=0; + fi], [BUILD_INTERNAL_LIBS=0]) +if test "$BUILD_INTERNAL_LIBS" = "0"; then + AC_MSG_RESULT(no) +else + AC_MSG_RESULT(yes) +fi + +WINDOWS_WORDSIZE= +AC_SUBST(WINDOWS_WORDSIZE) +AC_ARG_WITH(windows-wordsize, + AS_HELP_STRING([--with-windows-wordsize={32,64}], + [Windows only: whether this is a 32-bit or 64-bit build; required if external-libs are enabled]), + [WINDOWS_WORDSIZE=$withval], + [WINDOWS_WORDSIZE=none]) +if test "$USE_EXTERNAL_LIBS" = "1"; then + AC_MSG_CHECKING(for windows wordsize) + AC_MSG_RESULT($WINDOWS_WORDSIZE) + if ! test "$WINDOWS_WORDSIZE" = "32" -o "$WINDOWS_WORDSIZE" = "64"; then + AC_MSG_ERROR(Windows wordsize of 32 or 64 must be specified if external libs are being used.) + fi +fi + +if test "$BUILD_INTERNAL_LIBS" = "0"; then + AC_CHECK_HEADER(zlib.h,,[MISSING_ZLIB_H=1; MISSING_ANY=1]) + AC_SEARCH_LIBS(deflate,z zlib,,[MISSING_ZLIB=1; MISSING_ANY=1]) + AC_CHECK_HEADER(pcre.h,,[MISSING_PCRE_H=1; MISSING_ANY=1]) + AC_SEARCH_LIBS(pcre_compile,pcre,,[MISSING_PCRE=1; MISSING_ANY=1]) +fi + +QPDF_LARGE_FILE_TEST_PATH= +AC_SUBST(QPDF_LARGE_FILE_TEST_PATH) +AC_ARG_WITH(large-file-test-path, + AS_HELP_STRING([--with-large-file-test-path=path], + [To enable testing of files > 4GB, give the path to a directory with at least 11 GB free. The test suite will write temporary files to this directory. Alternatively, just set the QPDF_LARGE_FILE_TEST_PATH environment variable to the path before running the test suite.]), + [QPDF_LARGE_FILE_TEST_PATH=$withval], + [QPDF_LARGE_FILE_TEST_PATH=]) + +AC_SYS_LARGEFILE +AC_FUNC_FSEEKO +AC_CHECK_FUNCS([fseeko64]) +AC_TYPE_UINT16_T +AC_TYPE_UINT32_T + +AC_MSG_CHECKING(for whether printf supports %ll) +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +#include +#include +#include +int +main() +{ + long long a = 160591605916059ll; + char t[50]; + sprintf(t, "%lld", a); +} +]])],[qpdf_PRINTF_LL=yes],[qpdf_PRINTF_LL=no]) +AC_MSG_RESULT($qpdf_PRINTF_LL) +if test "$qpdf_PRINTF_LL" = "yes"; then + AC_DEFINE([HAVE_PRINTF_LL], [1], [Whether printf supports %ll]) +fi + +AC_CHECK_FUNCS(random) + +# Check if LD supports linker scripts, and define conditional +# HAVE_LD_VERSION_SCRIPT if so. This functionality is currently +# constrained to compilers using GNU ld on ELF systems or systems +# which provide an adequate emulation thereof. +AC_ARG_ENABLE([ld-version-script], + AS_HELP_STRING([--enable-ld-version-script], + [enable linker version script (default is enabled)]), + [have_ld_version_script=$enableval], [have_ld_version_script=yes]) +if test "$have_ld_version_script" != no; then + AC_MSG_CHECKING([if LD -Wl,--version-script works]) + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" + cat > conftest.map <= 3.81) +make_okay=0 +if make --version >/dev/null 2>&1; then + v=`make --version | grep 'GNU Make' | sed -e 's/.*Make //'` + maj=`echo $v | cut -d. -f 1` + min=`echo $v | cut -d. -f 2` + if test $maj -gt 3 -o '(' $maj -eq 3 -a $min -ge 81 ')'; then + make_okay=1 + fi +fi +if test "$make_okay" = "1"; then + AC_MSG_RESULT(yes) +else + dnl Don't set MISSING_ANY=1 -- maybe user calls make something else + MISSING_MAKE_381=1 + ISSUE_WARNINGS=1 + AC_MSG_RESULT(no) +fi + +AC_SUBST(GENDEPS) +GENDEPS=0 +AC_MSG_CHECKING(for whether $CC supports -MD -MF x.dep -MP) +oCFLAGS=$CFLAGS +rm -f x.dep +CFLAGS="$CFLAGS -MD -MF x.dep -MP" +AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[#include ]], [[FILE* a = stdout]] + )], + [qpdf_DEPFLAGS=yes], + [qpdf_DEPFLAGS=no]) +CFLAGS=$oCFLAGS +if test "$qpdf_DEPFLAGS" = "yes"; then + if ! grep stdio.h x.dep >/dev/null 2>&1; then + qpdf_DEPFLAGS=no + fi +fi +rm -f x.dep +if test "$qpdf_DEPFLAGS" = "yes"; then + AC_MSG_RESULT(yes) + GENDEPS=1 +else + AC_MSG_RESULT(no) +fi + +AC_MSG_CHECKING(which build rules to use) +AC_SUBST(BUILDRULES) +AC_ARG_WITH(buildrules, + AS_HELP_STRING([--with-buildrules=rules], + [which build rules to use; see README]), + [BUILDRULES=$withval], + [BUILDRULES=libtool]) +AC_MSG_RESULT($BUILDRULES) + +if test "$BUILDRULES" != "msvc"; then + qpdf_USE_WALL=0 + AC_MSG_CHECKING(for whether $CC supports -Wall) + oCFLAGS=$CFLAGS + CFLAGS="$CFLAGS -Wall" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int a = 1; int b = a; a = b;]])], + [qpdf_USE_WALL=1],[qpdf_USE_WALL=0]) + if test "$qpdf_USE_WALL" = "1"; then + AC_MSG_RESULT(yes) + CXXFLAGS="$CXXFLAGS -Wall" + else + AC_MSG_RESULT(no) + CFLAGS=$oCFLAGS + fi +fi + +if test "$BUILDRULES" != "msvc"; then + AC_MSG_CHECKING(for whether to use -Werror) + AC_ARG_ENABLE(werror, + AS_HELP_STRING([--enable-werror], + [whether to use werror (default is no)]), + [if test "$enableval" = "yes"; then + qpdf_USE_WERROR=1; + else + qpdf_USE_WERROR=0; + fi], [qpdf_USE_WERROR=0]) + if test "$qpdf_USE_WERROR" = "1"; then + AC_MSG_RESULT(yes) + CFLAGS="$CFLAGS -Werror" + CXXFLAGS="$CXXFLAGS -Werror" + else + AC_MSG_RESULT(no) + fi +fi + +AC_SUBST(QPDF_SKIP_TEST_COMPARE_IMAGES) +AC_ARG_ENABLE(test-compare-images, + AS_HELP_STRING([--enable-test-compare-images], + [whether to compare images in test suite; disabled by default, enabling requires ghostscript and tiffcmp to be available]), + [if test "$enableval" = "no"; then + QPDF_SKIP_TEST_COMPARE_IMAGES=1 + else + QPDF_SKIP_TEST_COMPARE_IMAGES=0 + fi], + [QPDF_SKIP_TEST_COMPARE_IMAGES=1]) + +AC_SUBST(SHOW_FAILED_TEST_OUTPUT) +AC_ARG_ENABLE(show-failed-test-output, + AS_HELP_STRING([--enable-show-failed-test-output], + [if specified, write failed test output to the console; useful for building on build servers where you can't easily open the test output files]), + [if test "$enableval" = "no"; then + SHOW_FAILED_TEST_OUTPUT=0 + else + SHOW_FAILED_TEST_OUTPUT=1 + fi], + [SHOW_FAILED_TEST_OUTPUT=0]) + +AC_ARG_WITH(docbook-xsl, + AS_HELP_STRING([--with-docbook-xsl=DIR], + [location of docbook 4.x xml stylesheets]), + [DOCBOOK_XSL=$withval], + [DOCBOOK_XSL=/usr/share/xml/docbook/stylesheet/nwalsh]) + +DOCBOOK_XHTML= +AC_SUBST(DOCBOOK_XHTML) +AC_MSG_CHECKING(for xml to xhtml docbook stylesheets) +if test -f "$DOCBOOK_XSL/xhtml/docbook.xsl"; then + DOCBOOK_XHTML="$DOCBOOK_XSL/xhtml/docbook.xsl" + AC_MSG_RESULT($DOCBOOK_XHTML) +else + AC_MSG_RESULT(no) +fi +DOCBOOK_FO= +AC_SUBST(DOCBOOK_FO) +AC_MSG_CHECKING(for xml to fo docbook stylesheets) +if test -f "$DOCBOOK_XSL/fo/docbook.xsl"; then + DOCBOOK_FO="$DOCBOOK_XSL/fo/docbook.xsl" + AC_MSG_RESULT($DOCBOOK_FO) +else + AC_MSG_RESULT(no) +fi + +DOCBOOKX_DTD= +AC_SUBST(DOCBOOKX_DTD) +AC_ARG_WITH(docbookx-dtd, + AS_HELP_STRING([--with-docbookx-dtd=FILE], + [location of docbook 4.x xml DTD]), + [DOCBOOKX_DTD=$withval], + [DOCBOOKX_DTD=/usr/share/xml/docbook/schema/dtd/4/docbookx.dtd]) +AC_MSG_CHECKING(for docbook 4.x xml DTD) +if test -f "$DOCBOOKX_DTD"; then + AC_MSG_RESULT($DOCBOOKX_DTD) +else + AC_MSG_RESULT(no) +fi + +AC_CHECK_PROG(FOP,fop,fop,[]) +AC_CHECK_PROG(XSLTPROC,xsltproc,xsltproc,[]) +AC_CHECK_PROG(XMLLINT,xmllint,xmllint,[]) + +AC_ARG_ENABLE(doc-maintenance, + AS_HELP_STRING([--enable-doc-maintenance], + [if set, enables all documentation options]), + [if test "$enableval" = "yes"; then + doc_default=1; + else + doc_default=0; + fi], + [doc_default=0]) + +BUILD_HTML=0 +AC_SUBST(BUILD_HTML) +AC_ARG_ENABLE(html-doc, + AS_HELP_STRING([--enable-html-doc], + [whether to build HTML documents]), + [if test "$enableval" = "yes"; then + BUILD_HTML=1; + else + BUILD_HTML=0; + fi], + [BUILD_HTML=$doc_default]) +BUILD_PDF=0 +AC_SUBST(BUILD_PDF) +AC_ARG_ENABLE(pdf-doc, + AS_HELP_STRING([--enable-pdf-doc], + [whether to build PDF documents]), + [if test "$enableval" = "yes"; then + BUILD_PDF=1; + else + BUILD_PDF=0; + fi], + [BUILD_PDF=$doc_default]) +VALIDATE_DOC=0 +AC_SUBST(VALIDATE_DOC) +AC_ARG_ENABLE(validate-doc, + AS_HELP_STRING([--enable-validate-doc], + [whether to validate xml document source]), + [if test "$enableval" = "yes"; then + VALIDATE_DOC=1; + else + VALIDATE_DOC=0; + fi], + [VALIDATE_DOC=$doc_default]) + +if test "$VALIDATE_DOC" = "1"; then + if test "$XMLLINT" = ""; then + MISSING_XMLLINT=1 + MISSING_ANY=1 + fi +fi +if test "$BUILD_HTML" = "1"; then + if test "$XSLTPROC" = ""; then + MISSING_XSLTPROC=1 + MISSING_ANY=1 + fi + if test "$DOCBOOK_XHTML" = ""; then + MISSING_DOCBOOK_XHTML=1 + MISSING_ANY=1 + fi +fi +if test "$BUILD_PDF" = "1"; then + if test "$XSLTPROC" = ""; then + MISSING_XSLTPROC=1 + MISSING_ANY=1 + fi + if test "$DOCBOOK_FO" = ""; then + MISSING_DOCBOOK_FO=1 + MISSING_ANY=1 + fi + if test "$FOP" = ""; then + MISSING_FOP=1 + MISSING_ANY=1 + fi +fi + + +if test "$MISSING_ANY" = "1"; then + ISSUE_WARNINGS=1 +fi +if test "$ISSUE_WARNINGS" = "1"; then + echo "" + echo "" +fi + +if test "$MISSING_MAKE_381" = "1"; then + AC_MSG_WARN(gnu make >= 3.81 is required) +fi + +if test "$MISSING_ZLIB_H" = "1"; then + AC_MSG_WARN(unable to find required header zlib.h) +fi + +if test "$MISSING_ZLIB" = "1"; then + AC_MSG_WARN(unable to find required library z (or zlib)) +fi + +if test "$MISSING_PCRE_H" = "1"; then + AC_MSG_WARN(unable to find required header pcre.h) +fi + +if test "$MISSING_PCRE" = "1"; then + AC_MSG_WARN(unable to find required library pcre) +fi + +if test "$MISSING_DOCBOOK_FO" = "1"; then + AC_MSG_WARN(docbook fo stylesheets are required to build PDF documentation) +fi + +if test "$MISSING_DOCBOOK_XHTML" = "1"; then + AC_MSG_WARN(docbook xhmtl stylesheets are required to build HTML documentation) +fi + +if test "$MISSING_FOP" = "1"; then + AC_MSG_WARN(apache fop is required to build PDF documentation) +fi + +if test "$MISSING_XMLLINT" = "1"; then + AC_MSG_WARN(xmllint is required to validate documentation) +fi + +if test "$MISSING_XSLTPROC" = "1"; then + AC_MSG_WARN(xsltproc is required to build documentation) +fi + +if test "$ISSUE_WARNINGS" = "1"; then + echo "" + echo "" +fi + +if test "$MISSING_ANY" = "1"; then + AC_MSG_ERROR(some required prerequisites were not found) +fi + +# Do this last so it doesn't interfere with other tests. +if test "$USE_EXTERNAL_LIBS" = "1"; then + # Don't actually check for the presence of this -- we document that + # the user can run this and then edit autoconf.mk if they have too + # much trouble getting it to work with a different compiler. + CPPFLAGS="$CPPFLAGS -Iexternal-libs/include" + LDFLAGS="$LDFLAGS -Lexternal-libs/lib-$BUILDRULES$WINDOWS_WORDSIZE" + LIBS="$LIBS -lz -lpcre" +fi + +AC_OUTPUT diff --git a/copy_dlls b/copy_dlls new file mode 100755 index 0000000..e93f161 --- /dev/null +++ b/copy_dlls @@ -0,0 +1,126 @@ +#!/usr/bin/env perl + +require 5.008; +BEGIN { $^W = 1; } +use strict; +use File::Basename; + +my $whoami = basename($0); + +usage() unless @ARGV == 3; +my ($file, $destdir, $objdump) = @ARGV; +my $filedir = dirname($file); + +my %dlls = (); +open(O, "$objdump -p $file|") or die "$whoami: can't run objdump\n"; +while () +{ + if (m/^\s+DLL Name:\s+(.+\.dll)/i) + { + my $dll = $1; + $dll =~ tr/A-Z/a-z/; + next if $dll =~ m/^(kernel32|user32|msvcrt)\.dll$/; + $dlls{$dll} = 1; + } +} +close(O); + +# Search the file's directory, the current directory, and the path for +# dlls since that's what Windows does. +my $sep = ($^O eq 'MSWin32' ? ';' : ':'); +my @path = ($filedir, '.', split($sep, $ENV{'PATH'})); +if (-f "$file.manifest") +{ + unshift(@path, get_manifest_dirs("$file.manifest")); +} +my @final = (); +my @notfound = (); +dll_loop: +foreach my $dll (sort keys %dlls) +{ + my $found = 0; + foreach my $dir (@path) + { + if (-f "$dir/$dll") + { + push(@final, "$dir/$dll"); + $found = 1; + last; + } + } + if (! $found) + { + push(@notfound, $dll); + } +} + +if (@notfound) +{ + die "$whoami: can't find the following dlls: " . + join(', ', @notfound), "\n"; +} + +foreach my $f (@final) +{ + $f =~ s,\\,/,g; + print "Copying $f to $destdir\n"; + system("cp -p $f $destdir") == 0 or + die "$whoami: copy $f to $destdir failed\n"; +} + +sub get_manifest_dirs +{ + # Find all system directories in which to search for DLLs based on + # the contents of a Visual Studio manifest file. + + my $manifest_file = shift; + + require XML::Parser; + my $sysroot = $ENV{'SYSTEMROOT'} or die "$whoami: can't get \$SYSTEMROOT\n"; + $sysroot =~ s,\\,/,g; + if ($^O eq 'cygwin') + { + chop($sysroot = `cygpath $sysroot`); + die "$whoami: can't get system root" unless $? == 0; + } + my $winsxs = "$sysroot/WinSxS"; + opendir(D, $winsxs) or die "$whoami: can't opendir $winsxs: $!\n"; + my @entries = readdir(D); + closedir(D); + + my @candidates = (); + + my $readAssemblyIdentity = sub + { + my ($parser, $element, %attrs) = @_; + return unless $element eq 'assemblyIdentity'; + my $type = $attrs{'type'}; + my $name = $attrs{'name'}; + my $version = $attrs{'version'}; + my $processorArchitecture = $attrs{'processorArchitecture'}; + my $publicKeyToken = $attrs{'publicKeyToken'}; + + my $dir_start = join('_', + $processorArchitecture, + $name, + $publicKeyToken, + $version); + push(@candidates, $dir_start); + }; + + my $p = new XML::Parser(Handlers => {'Start' => $readAssemblyIdentity}); + $p->parsefile($manifest_file); + + my @dirs = (); + foreach my $c (@candidates) + { + push(@dirs, map { "$winsxs/$_" } (grep { m/^\Q$c\E/i } @entries)); + } + + @dirs; +} + +sub usage +{ + die "Usage: $whoami {exe|dll} destdir\n"; +} diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..d59b119 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,15 @@ +qpdf (3.0.2-2slp2) unstable; urgency=low + + * Added spec file and smack manifest file + * Git: external/qpdf + * Tag: qpdf_3.0.2-2slp2 + + -- GangHeok Kim Fri, 14 Dec 2012 14:00:01 +0900 + +qpdf (3.0.2-1slp2) unstable; urgency=low + + * Ported qpdf initially + * Git: external/qpdf + * Tag: qpdf_3.0.2-1slp2 + + -- GangHeok Kim Fri, 14 Dec 2012 13:57:51 +0900 diff --git a/doc/stylesheet.css b/doc/stylesheet.css new file mode 100644 index 0000000..abaf226 --- /dev/null +++ b/doc/stylesheet.css @@ -0,0 +1,284 @@ +/**************************************************************/ +/* Custom style-sheet for the QPDF manual in HTML form. */ +/**************************************************************/ + +/* + * This file is the CSS for the QPDF manual. It is based heavily on + * the CSS for the Subversion book. That file contains the following + * copyright and attribution: + * + * Copyright (c) 2003-2007 + * Ben Collins-Sussman, Brian W. Fitzpatrick, C. Michael Pilato. + * + * This work is licensed under the Creative Commons Attribution License. + * To view a copy of this license, visit + * http://creativecommons.org/licenses/by/2.0/ or send a letter to + * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, + * USA. + */ + +body +{ + background: white; + margin: 0.5in; +} + +p, li, ul, ol, dd, dt +{ + font-style: normal; + font-weight: normal; + color: black; +} + +tt, pre +{ + font-family: courier new,courier,fixed; +} + +a +{ + color: blue; + text-decoration: underline; +} + +a:hover +{ + background: rgb(75%,75%,100%); + color: blue; + text-decoration: underline; +} + +a:visited +{ + color: purple; + text-decoration: underline; +} + +img +{ + border: none; +} + +h1.title +{ + font-size: 250%; + font-style: normal; + font-weight: bold; + color: black; +} + +h2.subtitle +{ + font-size: 150%; + font-style: italic; + color: black; +} + +h2.title +{ + font-size: 150%; + font-style: normal; + font-weight: bold; + color: black; +} + +h3.title +{ + font-size: 125%; + font-style: normal; + font-weight: bold; + color: black; +} + +h4.title +{ + font-size: 100%; + font-style: normal; + font-weight: bold; + color: black; +} + +.toc b +{ + font-size: 125%; + font-style: normal; + font-weight: bold; + color: black; +} + +.screen, .programlisting, .literal +{ + font-family: courier new,courier,fixed; + font-style: normal; + font-weight: normal; +} + +.command, .option, .type +{ + font-family: courier new,courier,fixed; + font-style: normal; + font-weight: normal; +} + +.filename +{ + font-family: arial,helvetica,sans-serif; + font-style: italic; +} + +.property +{ + font-family: arial,helvetica,sans-serif; + font-weight: bold; +} + +.classname +{ + font-family: arial,helvetica,sans-serif; + font-weight: bold; + font-style: italic; +} + +.varname, .function, .envar +{ + font-family: arial,helvetica,sans-serif; + font-style: italic; +} + +.replaceable +{ + font-style: italic; + font-size: 100%; +} + +.figure, .example, .table +{ + margin: 0.125in 0.25in; +} + +.table table +{ + border-width: 1px; + border-style: solid; + border-color: black; + border-spacing: 0; + background: rgb(240,240,240); +} + +.table td +{ + border: none; + border-right: 1px black solid; + border-bottom: 1px black solid; + padding: 2px; +} + +.table th +{ + background: rgb(180,180,180); + border: none; + border-right: 1px black solid; + border-bottom: 1px black solid; + padding: 2px; +} + +.table p.title, .figure p.title, .example p.title +{ + text-align: left !important; + font-size: 100% !important; +} + +.author, .pubdate +{ + margin: 0; + font-size: 100%; + font-style: italic; + font-weight: normal; + color: black; +} + +.preface div.author, .preface .pubdate +{ + font-size: 80%; +} + +.sidebar +{ + border-top: dotted 1px black; + border-left: dotted 1px black; + border-right: solid 2px black; + border-bottom: solid 2px black; + background: rgb(240,220,170); + padding: 0 0.12in; + margin: 0.25in; +} + +.note .programlisting, .note .screen, +.tip .programlisting, .tip .screen, +.warning .programlisting, .warning .screen, +.sidebar .programlisting, .sidebar .screen +{ + border: none; + background: none; +} + +.sidebar p.title +{ + text-align: center; + font-size: 125%; +} + +.note +{ + border: black solid 1px; + background: url(./images/note.png) no-repeat rgb(252,246,220); + margin: 0.125in 0; + padding: 0 55px; +} + +.tip +{ + border: black solid 1px; + background: url(./images/tip.png) no-repeat rgb(224,244,255); + margin: 0.125in 0; + padding: 0 55px; +} + +.warning +{ + border: black solid 1px; + background: url(./images/warning.png) no-repeat rgb(255,210,210); + margin: 0.125in 0; + padding: 0 55px; +} + +/* +.note .title, .tip .title, .warning .title +{ + display: none; +} +*/ + +.programlisting, .screen +{ + font-size: 90%; + color: black; + margin: 1em 0.25in; + padding: 0.5em; + background: rgb(240,240,240); + border-top: black dotted 1px; + border-left: black dotted 1px; + border-right: black solid 2px; + border-bottom: black solid 2px; +} + +.navheader, .navfooter +{ + border: black solid 1px; + background: rgb(180,180,200); +} + +.navheader hr, .navfooter hr +{ + display: none; +} diff --git a/examples/Makefile b/examples/Makefile new file mode 100644 index 0000000..9089905 --- /dev/null +++ b/examples/Makefile @@ -0,0 +1 @@ +include ../make/proxy.mk diff --git a/examples/build.mk b/examples/build.mk new file mode 100644 index 0000000..12734b1 --- /dev/null +++ b/examples/build.mk @@ -0,0 +1,40 @@ +BINS_examples = \ + pdf-bookmarks \ + pdf-mod-info \ + pdf-npages \ + pdf-double-page-size \ + pdf-invert-images \ + pdf-create +CBINS_examples = pdf-linearize + +TARGETS_examples = $(foreach B,$(BINS_examples) $(CBINS_examples),examples/$(OUTPUT_DIR)/$(call binname,$(B))) + +$(TARGETS_examples): $(TARGETS_qpdf) + +INCLUDES_examples = include + +TC_SRCS_examples = $(wildcard examples/*.cc) + +# ----- + +$(foreach B,$(BINS_examples),$(eval \ + OBJS_$(B) = $(call src_to_obj,examples/$(B).cc))) + +$(foreach B,$(CBINS_examples),$(eval \ + OBJS_$(B) = $(call c_src_to_obj,examples/$(B).c))) + +ifeq ($(GENDEPS),1) +-include $(foreach B,$(BINS_examples) $(CBINS_examples),$(call obj_to_dep,$(OBJS_$(B)))) +endif + +$(foreach B,$(BINS_examples),$(eval \ + $(OBJS_$(B)): examples/$(OUTPUT_DIR)/%.$(OBJ): examples/$(B).cc ; \ + $(call compile,examples/$(B).cc,$(INCLUDES_examples)))) + +$(foreach B,$(CBINS_examples),$(eval \ + $(OBJS_$(B)): examples/$(OUTPUT_DIR)/%.$(OBJ): examples/$(B).c ; \ + $(call c_compile,examples/$(B).c,$(INCLUDES_examples)))) + +$(foreach B,$(BINS_examples) $(CBINS_examples),$(eval \ + examples/$(OUTPUT_DIR)/$(call binname,$(B)): $(OBJS_$(B)) ; \ + $(call makebin,$(OBJS_$(B)),$$@,$(LDFLAGS) $(LDFLAGS_libqpdf),$(LIBS_libqpdf) $(LIBS)))) diff --git a/examples/examples.testcov b/examples/examples.testcov new file mode 100644 index 0000000..5a19b7c --- /dev/null +++ b/examples/examples.testcov @@ -0,0 +1,19 @@ +pdf-bookmarks lines 0 +pdf-bookmarks numbers 0 +pdf-bookmarks none 0 +pdf-bookmarks has count 0 +pdf-bookmarks no count 0 +pdf-bookmarks open 0 +pdf-bookmarks closed 0 +pdf-bookmarks dest 0 +pdf-bookmarks targets 0 +pdf-mod-info --dump 0 +pdf-mod-info no in file 0 +pdf-mod-info in-place 0 +pdf-mod-info -key 0 +pdf-mod-info usage wrong val 0 +pdf-mod-info -val 0 +pdf-mod-info usage junk 0 +pdf-mod-info no keys 0 +pdf-mod-info has info 0 +pdf-mod-info file no info 0 diff --git a/examples/pdf-bookmarks.cc b/examples/pdf-bookmarks.cc new file mode 100644 index 0000000..802cdba --- /dev/null +++ b/examples/pdf-bookmarks.cc @@ -0,0 +1,257 @@ +#include +#include +#include +#include +#include +#include + +static char const* whoami = 0; +static enum { st_none, st_numbers, st_lines } style = st_none; +static bool show_open = false; +static bool show_targets = false; +static std::map page_map; + +void usage() +{ + std::cerr << "Usage: " << whoami << " [options] file.pdf [password]" + << std::endl + << "Options:" << std::endl + << " -numbers give bookmarks outline-style numbers" + << std::endl + << " -lines draw lines to show bookmark hierarchy" + << std::endl + << " -show-open indicate whether a bookmark is initially open" + << std::endl + << " -show-targets show target if possible" + << std::endl; + exit(2); +} + +void print_lines(std::vector& numbers) +{ + for (unsigned int i = 0; i < numbers.size() - 1; ++i) + { + if (numbers[i]) + { + std::cout << "| "; + } + else + { + std::cout << " "; + } + } +} + +void generate_page_map(QPDF& qpdf) +{ + std::vector pages = qpdf.getAllPages(); + int n = 0; + for (std::vector::iterator iter = pages.begin(); + iter != pages.end(); ++iter) + { + QPDFObjectHandle& oh = *iter; + page_map[oh.getObjectID()] = ++n; + } +} + +void extract_bookmarks(QPDFObjectHandle outlines, std::vector& numbers) +{ + if (outlines.hasKey("/Title")) + { + // No default so gcc will warn on missing tag + switch (style) + { + case st_none: + QTC::TC("examples", "pdf-bookmarks none"); + break; + + case st_numbers: + QTC::TC("examples", "pdf-bookmarks numbers"); + for (std::vector::iterator iter = numbers.begin(); + iter != numbers.end(); ++iter) + { + std::cout << *iter << "."; + } + std::cout << " "; + break; + + case st_lines: + QTC::TC("examples", "pdf-bookmarks lines"); + print_lines(numbers); + std::cout << "|" << std::endl; + print_lines(numbers); + std::cout << "+-+ "; + break; + } + + if (show_open) + { + if (outlines.hasKey("/Count")) + { + QTC::TC("examples", "pdf-bookmarks has count"); + int count = outlines.getKey("/Count").getIntValue(); + if (count > 0) + { + // hierarchy is open at this point + QTC::TC("examples", "pdf-bookmarks open"); + std::cout << "(v) "; + } + else + { + QTC::TC("examples", "pdf-bookmarks closed"); + std::cout << "(>) "; + } + } + else + { + QTC::TC("examples", "pdf-bookmarks no count"); + std::cout << "( ) "; + } + } + + if (show_targets) + { + QTC::TC("examples", "pdf-bookmarks targets"); + std::string target = "unknown"; + // Only explicit destinations supported for now + if (outlines.hasKey("/Dest")) + { + QTC::TC("examples", "pdf-bookmarks dest"); + QPDFObjectHandle dest = outlines.getKey("/Dest"); + if ((dest.isArray()) && (dest.getArrayNItems() > 0)) + { + QPDFObjectHandle first = dest.getArrayItem(0); + int object_id = first.getObjectID(); + if (page_map.count(object_id)) + { + target = QUtil::int_to_string(page_map[object_id]); + } + } + + std::cout << "[ -> " << target << " ] "; + } + } + + std::cout << outlines.getKey("/Title").getUTF8Value() << std::endl; + } + + if (outlines.hasKey("/First")) + { + numbers.push_back(0); + QPDFObjectHandle child = outlines.getKey("/First"); + while (1) + { + ++(numbers.back()); + bool has_next = child.hasKey("/Next"); + if ((style == st_lines) && (! has_next)) + { + numbers.back() = 0; + } + extract_bookmarks(child, numbers); + if (has_next) + { + child = child.getKey("/Next"); + } + else + { + break; + } + } + numbers.pop_back(); + } +} + +int main(int argc, char* argv[]) +{ + whoami = QUtil::getWhoami(argv[0]); + + // For libtool's sake.... + if (strncmp(whoami, "lt-", 3) == 0) + { + whoami += 3; + } + + if ((argc == 2) && (strcmp(argv[1], "--version") == 0)) + { + std::cout << whoami << " version 1.5" << std::endl; + exit(0); + } + + int arg; + for (arg = 1; arg < argc; ++arg) + { + if (argv[arg][0] == '-') + { + if (strcmp(argv[arg], "-numbers") == 0) + { + style = st_numbers; + } + else if (strcmp(argv[arg], "-lines") == 0) + { + style = st_lines; + } + else if (strcmp(argv[arg], "-show-open") == 0) + { + show_open = true; + } + else if (strcmp(argv[arg], "-show-targets") == 0) + { + show_targets = true; + } + else + { + usage(); + } + } + else + { + break; + } + } + + if (arg >= argc) + { + usage(); + } + + char const* filename = argv[arg++]; + char const* password = ""; + + if (arg < argc) + { + password = argv[arg++]; + } + if (arg != argc) + { + usage(); + } + + try + { + QPDF qpdf; + qpdf.processFile(filename, password); + + QPDFObjectHandle root = qpdf.getRoot(); + if (root.hasKey("/Outlines")) + { + std::vector numbers; + if (show_targets) + { + generate_page_map(qpdf); + } + extract_bookmarks(root.getKey("/Outlines"), numbers); + } + else + { + std::cout << filename << " has no bookmarks" << std::endl; + } + } + catch (std::exception &e) + { + std::cerr << whoami << " processing file " << filename << ": " + << e.what() << std::endl; + exit(2); + } + + return 0; +} diff --git a/examples/pdf-create.cc b/examples/pdf-create.cc new file mode 100644 index 0000000..902c680 --- /dev/null +++ b/examples/pdf-create.cc @@ -0,0 +1,183 @@ +#include +#include +#include +#include +#include +#include +#include + +static char const* whoami = 0; + +// This is a simple StreamDataProvider that writes image data for an +// orange square of the given width and height. +class ImageProvider: public QPDFObjectHandle::StreamDataProvider +{ + public: + ImageProvider(int width, int height); + virtual ~ImageProvider(); + virtual void provideStreamData(int objid, int generation, + Pipeline* pipeline); + + private: + int width; + int height; +}; + +ImageProvider::ImageProvider(int width, int height) : + width(width), + height(height) +{ +} + +ImageProvider::~ImageProvider() +{ +} + +void +ImageProvider::provideStreamData(int objid, int generation, + Pipeline* pipeline) +{ + for (int i = 0; i < width * height; ++i) + { + pipeline->write((unsigned char*)"\xff\x7f\x00", 3); + } + pipeline->finish(); +} + +void usage() +{ + std::cerr << "Usage: " << whoami << " filename" << std::endl + << "Creates a simple PDF and writes it to filename" << std::endl; + exit(2); +} + +static QPDFObjectHandle createPageContents(QPDF& pdf, std::string const& text) +{ + // Create a stream that displays our image and the given text in + // our font. + std::string contents = + "BT /F1 24 Tf 72 720 Td (" + text + ") Tj ET\n" + "q 144 0 0 144 234 324 cm /Im1 Do Q\n"; + return QPDFObjectHandle::newStream(&pdf, contents); +} + +QPDFObjectHandle newName(std::string const& name) +{ + return QPDFObjectHandle::newName(name); +} + +QPDFObjectHandle newInteger(int val) +{ + return QPDFObjectHandle::newInteger(val); +} + +static void create_pdf(char const* filename) +{ + QPDF pdf; + + // Start with an empty PDF that has no pages or non-required objects. + pdf.emptyPDF(); + + // Add an indirect object to contain a font descriptor for the + // built-in Helvetica font. + QPDFObjectHandle font = pdf.makeIndirectObject( + QPDFObjectHandle::parse( + "<<" + " /Type /Font" + " /Subtype /Type1" + " /Name /F1" + " /BaseFont /Helvetica" + " /Encoding /WinAnsiEncoding" + ">>")); + + // Create a stream to encode our image. We don't have to set the + // length or filters. QPDFWriter will fill in the length and + // compress the stream data using FlateDecode by default. + QPDFObjectHandle image = QPDFObjectHandle::newStream(&pdf); + image.replaceDict(QPDFObjectHandle::parse( + "<<" + " /Type /XObject" + " /Subtype /Image" + " /ColorSpace /DeviceRGB" + " /BitsPerComponent 8" + " /Width 100" + " /Height 100" + ">>")); + // Provide the stream data. + ImageProvider* p = new ImageProvider(100, 100); + PointerHolder provider(p); + image.replaceStreamData(provider, + QPDFObjectHandle::newNull(), + QPDFObjectHandle::newNull()); + + // Create direct objects as needed by the page dictionary. + QPDFObjectHandle procset = QPDFObjectHandle::parse( + "[/PDF /Text /ImageC]"); + + QPDFObjectHandle rfont = QPDFObjectHandle::newDictionary(); + rfont.replaceKey("/F1", font); + + QPDFObjectHandle xobject = QPDFObjectHandle::newDictionary(); + xobject.replaceKey("/Im1", image); + + QPDFObjectHandle resources = QPDFObjectHandle::newDictionary(); + resources.replaceKey("/ProcSet", procset); + resources.replaceKey("/Font", rfont); + resources.replaceKey("/XObject", xobject); + + QPDFObjectHandle mediabox = QPDFObjectHandle::newArray(); + mediabox.appendItem(newInteger(0)); + mediabox.appendItem(newInteger(0)); + mediabox.appendItem(newInteger(612)); + mediabox.appendItem(newInteger(792)); + + // Create the page content stream + QPDFObjectHandle contents = createPageContents( + pdf, "Look at the pretty, orange square!"); + + // Create the page dictionary + QPDFObjectHandle page = pdf.makeIndirectObject( + QPDFObjectHandle::newDictionary()); + page.replaceKey("/Type", newName("/Page")); + page.replaceKey("/MediaBox", mediabox); + page.replaceKey("/Contents", contents); + page.replaceKey("/Resources", resources); + + // Add the page to the PDF file + pdf.addPage(page, true); + + // Write the results. A real application would not call + // setStaticID here, but this example does it for the sake of its + // test suite. + QPDFWriter w(pdf, filename); + w.setStaticID(true); // for testing only + w.write(); +} + +int main(int argc, char* argv[]) +{ + whoami = QUtil::getWhoami(argv[0]); + + // For libtool's sake.... + if (strncmp(whoami, "lt-", 3) == 0) + { + whoami += 3; + } + if (argc != 2) + { + usage(); + } + char const* filename = argv[1]; + + try + { + create_pdf(filename); + } + catch (std::exception& e) + { + std::cerr << e.what() << std::endl; + exit(2); + } + + return 0; +} diff --git a/examples/pdf-double-page-size.cc b/examples/pdf-double-page-size.cc new file mode 100644 index 0000000..8a1867a --- /dev/null +++ b/examples/pdf-double-page-size.cc @@ -0,0 +1,110 @@ +#include +#include +#include +#include +#include +#include +#include + +static char const* whoami = 0; + +void usage() +{ + std::cerr << "Usage: " << whoami << " infile.pdf outfile.pdf [in-password]" + << std::endl + << "Double size of all pages in infile.pdf;" + << " write output to outfile.pdf" << std::endl; + exit(2); +} + +static void doubleBoxSize(QPDFObjectHandle& page, char const* box_name) +{ + // If there is a box of this name, replace it with a new box whose + // elements are double the values of the original box. + QPDFObjectHandle box = page.getKey(box_name); + if (box.isNull()) + { + return; + } + if (! (box.isArray() && (box.getArrayNItems() == 4))) + { + throw std::runtime_error(std::string("box ") + box_name + + " is not an array of four elements"); + } + std::vector doubled; + for (unsigned int i = 0; i < 4; ++i) + { + doubled.push_back( + QPDFObjectHandle::newReal( + box.getArrayItem(i).getNumericValue() * 2.0, 2)); + } + page.replaceKey(box_name, QPDFObjectHandle::newArray(doubled)); +} + +int main(int argc, char* argv[]) +{ + whoami = QUtil::getWhoami(argv[0]); + + // For libtool's sake.... + if (strncmp(whoami, "lt-", 3) == 0) + { + whoami += 3; + } + + if (! ((argc == 3) || (argc == 4))) + { + usage(); + } + + char const* infilename = argv[1]; + char const* outfilename = argv[2]; + char const* password = (argc == 4) ? argv[3] : ""; + + // Text to prepend to each page's contents + std::string content = "2 0 0 2 0 0 cm\n"; + + try + { + QPDF qpdf; + qpdf.processFile(infilename, password); + + std::vector pages = qpdf.getAllPages(); + for (std::vector::iterator iter = pages.begin(); + iter != pages.end(); ++iter) + { + QPDFObjectHandle& page = *iter; + + // Prepend the buffer to the page's contents + page.addPageContents( + QPDFObjectHandle::newStream(&qpdf, content), true); + + // Double the size of each of the content boxes + doubleBoxSize(page, "/MediaBox"); + doubleBoxSize(page, "/CropBox"); + doubleBoxSize(page, "/BleedBox"); + doubleBoxSize(page, "/TrimBox"); + doubleBoxSize(page, "/ArtBox"); + } + + // Write out a new file + QPDFWriter w(qpdf, outfilename); + if (QUtil::get_env("IN_TESTSUITE")) + { + // For the test suite, uncompress streams and use static + // IDs. + w.setStaticID(true); + w.setStreamDataMode(qpdf_s_uncompress); + } + w.write(); + std::cout << whoami << ": new file written to " << outfilename + << std::endl; + } + catch (std::exception &e) + { + std::cerr << whoami << " processing file " << infilename << ": " + << e.what() << std::endl; + exit(2); + } + + return 0; +} diff --git a/examples/pdf-invert-images.cc b/examples/pdf-invert-images.cc new file mode 100644 index 0000000..997fc37 --- /dev/null +++ b/examples/pdf-invert-images.cc @@ -0,0 +1,170 @@ +#include +#include +#include +#include +#include +#include +#include + +static char const* whoami = 0; + +void usage() +{ + std::cerr << "Usage: " << whoami << " infile.pdf outfile.pdf [in-password]" + << std::endl + << "Invert some images in infile.pdf;" + << " write output to outfile.pdf" << std::endl; + exit(2); +} + +// Derive a class from StreamDataProvider to provide updated stream +// data. The main purpose of using this object is to avoid having to +// allocate memory up front for the objects. A real application might +// use temporary files in order to avoid having to allocate all the +// memory. Here, we're not going to worry about that since the goal +// is really to show how to use this facility rather than to show the +// best possible way to write an image inverter. This class still +// illustrates dynamic creation of the new stream data. +class ImageInverter: public QPDFObjectHandle::StreamDataProvider +{ + public: + virtual ~ImageInverter() + { + } + virtual void provideStreamData(int objid, int generation, + Pipeline* pipeline); + + // Map [obj][gen] = image object + std::map > image_objects; + // Map [obj][gen] = image data + std::map > > image_data; +}; + +void +ImageInverter::provideStreamData(int objid, int generation, + Pipeline* pipeline) +{ + // Use the object and generation number supplied to look up the + // image data. Then invert the image data and write the inverted + // data to the pipeline. + PointerHolder data = this->image_data[objid][generation]; + size_t size = data->getSize(); + unsigned char* buf = data->getBuffer(); + unsigned char ch; + for (size_t i = 0; i < size; ++i) + { + ch = (unsigned char)0xff - buf[i]; + pipeline->write(&ch, 1); + } + pipeline->finish(); +} + +int main(int argc, char* argv[]) +{ + whoami = QUtil::getWhoami(argv[0]); + + // For libtool's sake.... + if (strncmp(whoami, "lt-", 3) == 0) + { + whoami += 3; + } + + if (! ((argc == 3) || (argc == 4))) + { + usage(); + } + + char const* infilename = argv[1]; + char const* outfilename = argv[2]; + char const* password = (argc == 4) ? argv[3] : ""; + + try + { + QPDF qpdf; + qpdf.processFile(infilename, password); + + ImageInverter* inv = new ImageInverter; + PointerHolder p = inv; + + // For each page... + std::vector pages = qpdf.getAllPages(); + for (std::vector::iterator iter = pages.begin(); + iter != pages.end(); ++iter) + { + QPDFObjectHandle& page = *iter; + // Get all images on the page. + std::map images = + page.getPageImages(); + for (std::map::iterator iter = + images.begin(); + iter != images.end(); ++iter) + { + QPDFObjectHandle& image = (*iter).second; + QPDFObjectHandle image_dict = image.getDict(); + QPDFObjectHandle color_space = + image_dict.getKey("/ColorSpace"); + QPDFObjectHandle bits_per_component = + image_dict.getKey("/BitsPerComponent"); + + // For our example, we can only work with images 8-bit + // grayscale images that we can fully decode. Use + // pipeStreamData with a null pipeline to determine + // whether the image is filterable. Directly inspect + // keys to determine the image type. + if (image.pipeStreamData(0, true, false, false) && + color_space.isName() && + bits_per_component.isInteger() && + (color_space.getName() == "/DeviceGray") && + (bits_per_component.getIntValue() == 8)) + { + // Store information about the images based on the + // object and generation number. Recall that a single + // image object may be used more than once. + int objid = image.getObjectID(); + int gen = image.getGeneration(); + if (inv->image_objects[objid].count(gen) == 0) + { + inv->image_objects[objid][gen] = image; + inv->image_data[objid][gen] = image.getStreamData(); + + // Register our stream data provider for this + // stream. Future calls to getStreamData or + // pipeStreamData will use the new + // information. Provide null for both filter + // and decode parameters. Note that this does + // not mean the image data will be + // uncompressed when we write the file. By + // default, QPDFWriter will use /FlateDecode + // for anything that is uncompressed or + // filterable in the input QPDF object, so we + // don't have to deal with it explicitly here. + image.replaceStreamData( + p, + QPDFObjectHandle::newNull(), + QPDFObjectHandle::newNull()); + } + } + } + } + + // Write out a new file + QPDFWriter w(qpdf, outfilename); + if (QUtil::get_env("IN_TESTSUITE")) + { + // For the test suite, uncompress streams and use static + // IDs. + w.setStaticID(true); + } + w.write(); + std::cout << whoami << ": new file written to " << outfilename + << std::endl; + } + catch (std::exception &e) + { + std::cerr << whoami << " processing file " << infilename << ": " + << e.what() << std::endl; + exit(2); + } + + return 0; +} diff --git a/examples/pdf-linearize.c b/examples/pdf-linearize.c new file mode 100644 index 0000000..72703c8 --- /dev/null +++ b/examples/pdf-linearize.c @@ -0,0 +1,80 @@ +/* + * This is an example program to linearize a PDF file using the C API. + */ + +#include +#include +#include +#include + +static char const* whoami = 0; + +static void usage() +{ + fprintf(stderr, "Usage: %s infile infile-password outfile\n", whoami); + exit(2); +} + +int main(int argc, char* argv[]) +{ + char* infile = NULL; + char* password = NULL; + char* outfile = NULL; + qpdf_data qpdf = qpdf_init(); + int warnings = 0; + int errors = 0; + char* p = 0; + + if ((p = strrchr(argv[0], '/')) != NULL) + { + whoami = p + 1; + } + else if ((p = strrchr(argv[0], '\\')) != NULL) + { + whoami = p + 1; + } + else + { + whoami = argv[0]; + } + + if (argc != 4) + { + usage(); + } + + infile = argv[1]; + password = argv[2]; + outfile = argv[3]; + + if (((qpdf_read(qpdf, infile, password) & QPDF_ERRORS) == 0) && + ((qpdf_init_write(qpdf, outfile) & QPDF_ERRORS) == 0)) + { + qpdf_set_static_ID(qpdf, QPDF_TRUE); + qpdf_set_linearization(qpdf, QPDF_TRUE); + qpdf_write(qpdf); + } + while (qpdf_more_warnings(qpdf)) + { + warnings = 1; + printf("warning: %s\n", + qpdf_get_error_full_text(qpdf, qpdf_next_warning(qpdf))); + } + if (qpdf_has_error(qpdf)) + { + errors = 1; + printf("error: %s\n", + qpdf_get_error_full_text(qpdf, qpdf_get_error(qpdf))); + } + qpdf_cleanup(&qpdf); + if (errors) + { + return 2; + } + else if (warnings) + { + return 3; + } + + return 0; +} diff --git a/examples/pdf-mod-info.cc b/examples/pdf-mod-info.cc new file mode 100644 index 0000000..e8defa3 --- /dev/null +++ b/examples/pdf-mod-info.cc @@ -0,0 +1,233 @@ +// Author: Vitaliy Pavlyuk + +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef _WIN32 +#include +#include +#include +#else +#include +#endif + +static char const* version = "1.1"; +static char const* whoami = 0; + +void usage() +{ + std::cerr + << "Usage: " << whoami + << " -in in_file [-out out_file] [-key key [-val val]?]+\n" + << "Modifies/Adds/Removes PDF /Info entries in the in_file\n" + << "and stores the result in out_file\n" + << "Special mode: " << whoami << " --dump file\n" + << "dumps all /Info entries to stdout\n"; + exit(2); +} + +void dumpInfoDict(QPDF& pdf, + std::ostream& os = std::cout, + std::string const& sep = ":\t") +{ + QPDFObjectHandle trailer = pdf.getTrailer(); + if (trailer.hasKey("/Info")) + { + QPDFObjectHandle info = trailer.getKey("/Info"); + std::set keys = info.getKeys(); + for (std::set::const_iterator it = keys.begin(); + keys.end() != it; ++it) + { + QPDFObjectHandle elt = info.getKey(*it); + std::string val; + if (false) {} + else if (elt.isString()) + { + val = elt.getStringValue(); + } + else if (elt.isName()) + { + val = elt.getName(); + } + else // according to PDF Spec 1.5, shouldn't happen + { + val = elt.unparseResolved(); + } + os << it->substr(1) << sep << val << std::endl; // skip '/' + } + } +} + +void pdfDumpInfoDict(char const* fname) +{ + try + { + QPDF pdf; + pdf.processFile(fname); + dumpInfoDict(pdf); + } + catch (std::exception& e) + { + std::cerr << e.what() << std::endl; + exit(2); + } +} + +int main(int argc, char* argv[]) +{ + + bool static_id = false; + std::map Keys; + + whoami = QUtil::getWhoami(argv[0]); + + // For libtool's sake.... + if (strncmp(whoami, "lt-", 3) == 0) + { + whoami += 3; + } + + if ((argc == 2) && (! strcmp(argv[1], "--version")) ) + { + std::cout << whoami << " version " << version << std::endl; + exit(0); + } + if ((argc == 4) && (! strcmp(argv[1], "--dump")) && + (strcmp(argv[2], "-in") == 0) ) + { + QTC::TC("examples", "pdf-mod-info --dump"); + pdfDumpInfoDict(argv[3]); + exit(0); + } + + char* fl_in = 0; + char* fl_out = 0; + std::string cur_key; + + for (int i = 1; i < argc; ++i) + { + if ((! strcmp(argv[i], "-in")) && (++i < argc)) + { + fl_in = argv[i]; + } + else if ((! strcmp(argv[i], "-out")) && (++i < argc)) + { + fl_out = argv[i]; + } + else if (! strcmp(argv[i], "--static-id")) // don't document + { + static_id = true; // this should be used in test suites only + } + else if ((! strcmp(argv[i], "-key")) && (++i < argc)) + { + QTC::TC("examples", "pdf-mod-info -key"); + cur_key = argv[i]; + if (! ((cur_key.length() > 0) && (cur_key[0] == '/'))) + { + cur_key = "/" + cur_key; + } + Keys[cur_key] = ""; + } + else if ((! strcmp(argv[i], "-val")) && (++i < argc)) + { + if (cur_key.empty()) + { + QTC::TC("examples", "pdf-mod-info usage wrong val"); + usage(); + } + QTC::TC("examples", "pdf-mod-info -val"); + Keys[cur_key] = argv[i]; + cur_key.clear(); + } + else + { + QTC::TC("examples", "pdf-mod-info usage junk"); + usage(); + } + } + if (! fl_in) + { + QTC::TC("examples", "pdf-mod-info no in file"); + usage(); + } + if (! fl_out) + { + QTC::TC("examples", "pdf-mod-info in-place"); + fl_out = fl_in; + } + if (Keys.size() == 0) + { + QTC::TC("examples", "pdf-mod-info no keys"); + usage(); + } + + std::string fl_tmp = fl_out; + fl_tmp += ".tmp"; + + try + { + QPDF file; + file.processFile(fl_in); + + QPDFObjectHandle filetrailer = file.getTrailer(); + QPDFObjectHandle fileinfo; + + for (std::map::const_iterator it = + Keys.begin(); Keys.end() != it; ++it) + { + if (! fileinfo.isInitialized()) + { + if (filetrailer.hasKey("/Info")) + { + QTC::TC("examples", "pdf-mod-info has info"); + fileinfo = filetrailer.getKey("/Info"); + } + else + { + QTC::TC("examples", "pdf-mod-info file no info"); + fileinfo = QPDFObjectHandle::newDictionary(); + filetrailer.replaceKey("/Info", fileinfo); + } + } + if (it->second == "") + { + fileinfo.removeKey(it->first); + } + else + { + QPDFObjectHandle elt = fileinfo.newString(it->second); + elt.makeDirect(); + fileinfo.replaceKey(it->first, elt); + } + } + QPDFWriter w(file, fl_tmp.c_str()); + w.setStreamDataMode(qpdf_s_preserve); + w.setLinearization(true); + w.setStaticID(static_id); + w.write(); + } + catch (std::exception& e) + { + std::cerr << e.what() << std::endl; + exit(2); + } + + try + { + (void) unlink(fl_out); + QUtil::os_wrapper("rename " + fl_tmp + " " + std::string(fl_out), + rename(fl_tmp.c_str(), fl_out)); + } + catch (std::exception& e) + { + std::cerr << e.what() << std::endl; + exit(2); + } + + return 0; +} diff --git a/examples/pdf-npages.cc b/examples/pdf-npages.cc new file mode 100644 index 0000000..c62d33d --- /dev/null +++ b/examples/pdf-npages.cc @@ -0,0 +1,55 @@ +#include +#include +#include + +#include +#include + +static char const* whoami = 0; + +void usage() +{ + std::cerr << "Usage: " << whoami << " filename" << std::endl + << "Prints the number of pages in filename" << std::endl; + exit(2); +} + +int main(int argc, char* argv[]) +{ + whoami = QUtil::getWhoami(argv[0]); + + // For libtool's sake.... + if (strncmp(whoami, "lt-", 3) == 0) + { + whoami += 3; + } + + if ((argc == 2) && (strcmp(argv[1], "--version") == 0)) + { + std::cout << whoami << " version 1.3" << std::endl; + exit(0); + } + + if (argc != 2) + { + usage(); + } + char const* filename = argv[1]; + + try + { + QPDF pdf; + pdf.processFile(filename); + QPDFObjectHandle root = pdf.getRoot(); + QPDFObjectHandle pages = root.getKey("/Pages"); + QPDFObjectHandle count = pages.getKey("/Count"); + std::cout << count.getIntValue() << std::endl; + } + catch (std::exception& e) + { + std::cerr << whoami << ": " << e.what() << std::endl; + exit(2); + } + + return 0; +} diff --git a/examples/qtest/bookmarks.test b/examples/qtest/bookmarks.test new file mode 100644 index 0000000..ba8be25 --- /dev/null +++ b/examples/qtest/bookmarks.test @@ -0,0 +1,49 @@ +#!/usr/bin/env perl +require 5.008; +BEGIN { $^W = 1; } +use strict; + +chdir("bookmarks"); + +require TestDriver; + +my $td = new TestDriver('pdf-bookmarks'); + +foreach my $show ("", " -show-open") +{ + foreach my $style ("", " -lines", " -numbers") + { + my $out = "test.$show.$style.out"; + $out =~ s/ //g; + $td->runtest("show:$show, style:$style", + {$td->COMMAND => "pdf-bookmarks $show $style 1.pdf"}, + {$td->FILE => $out, $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + } +} +$td->runtest("no bookmarks", + {$td->COMMAND => "pdf-bookmarks 2.pdf"}, + {$td->STRING => "2.pdf has no bookmarks\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("bad", + {$td->COMMAND => "pdf-bookmarks 3.pdf"}, + {$td->STRING => "pdf-bookmarks processing file 3.pdf: " . + "3.pdf: not a PDF file\n", + $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("encrypted, targets", + {$td->COMMAND => "pdf-bookmarks -show-targets 4.pdf user"}, + {$td->FILE => "encrypted.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("bookmarks deleted", + {$td->COMMAND => "pdf-bookmarks 5.pdf user"}, + {$td->STRING => "5.pdf has no bookmarks\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->report(10); diff --git a/examples/qtest/bookmarks/1.pdf b/examples/qtest/bookmarks/1.pdf new file mode 100644 index 0000000..2003cf9 --- /dev/null +++ b/examples/qtest/bookmarks/1.pdf @@ -0,0 +1,1502 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /PageLabels << /Nums [ + 0 << /P () >> + 2 << /S /r /St 1 >> + 7 << /P () >> + 9 << /S /r /St 6 >> + 11 << /P () >> + 12 << /S /D /St 2 >> + 15 << /S /D /St 6 >> + 19 << /P () >> + 20 << /S /D /St 12 >> + 22 << /S /D /St 16059 >> + 23 << /S /r /St 50 >> + 29 << /S /r /St 54 >> + ] >> + /Pages 2 0 R + /Type /Catalog + /PageMode /UseOutlines + /Outlines 95 0 R +>> +endobj + +2 0 obj +<< + /Count 30 + /Kids [ + 3 0 R + 4 0 R + 5 0 R + 6 0 R + 7 0 R + 8 0 R + 9 0 R + 10 0 R + 11 0 R + 12 0 R + 13 0 R + 14 0 R + 15 0 R + 16 0 R + 17 0 R + 18 0 R + 19 0 R + 20 0 R + 21 0 R + 22 0 R + 23 0 R + 24 0 R + 25 0 R + 26 0 R + 27 0 R + 28 0 R + 29 0 R + 30 0 R + 31 0 R + 32 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +3 0 obj +<< + /Contents 33 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 2 +4 0 obj +<< + /Contents 37 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 3 +5 0 obj +<< + /Contents 39 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 4 +6 0 obj +<< + /Contents 41 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 5 +7 0 obj +<< + /Contents 43 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 6 +8 0 obj +<< + /Contents 45 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 7 +9 0 obj +<< + /Contents 47 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 8 +10 0 obj +<< + /Contents 49 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 9 +11 0 obj +<< + /Contents 51 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 10 +12 0 obj +<< + /Contents 53 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 11 +13 0 obj +<< + /Contents 55 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 12 +14 0 obj +<< + /Contents 57 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 13 +15 0 obj +<< + /Contents 59 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 14 +16 0 obj +<< + /Contents 61 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 15 +17 0 obj +<< + /Contents 63 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 16 +18 0 obj +<< + /Contents 65 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 17 +19 0 obj +<< + /Contents 67 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 18 +20 0 obj +<< + /Contents 69 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 19 +21 0 obj +<< + /Contents 71 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 20 +22 0 obj +<< + /Contents 73 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 21 +23 0 obj +<< + /Contents 75 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 22 +24 0 obj +<< + /Contents 77 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 23 +25 0 obj +<< + /Contents 79 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 24 +26 0 obj +<< + /Contents 81 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 25 +27 0 obj +<< + /Contents 83 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 26 +28 0 obj +<< + /Contents 85 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 27 +29 0 obj +<< + /Contents 87 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 28 +30 0 obj +<< + /Contents 89 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 29 +31 0 obj +<< + /Contents 91 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 30 +32 0 obj +<< + /Contents 93 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +33 0 obj +<< + /Length 34 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 0) Tj +ET +endstream +endobj + +34 0 obj +46 +endobj + +35 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +36 0 obj +[ + /PDF + /Text +] +endobj + +%% Contents for page 2 +37 0 obj +<< + /Length 38 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 1) Tj +ET +endstream +endobj + +38 0 obj +46 +endobj + +%% Contents for page 3 +39 0 obj +<< + /Length 40 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 2) Tj +ET +endstream +endobj + +40 0 obj +46 +endobj + +%% Contents for page 4 +41 0 obj +<< + /Length 42 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 3) Tj +ET +endstream +endobj + +42 0 obj +46 +endobj + +%% Contents for page 5 +43 0 obj +<< + /Length 44 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 4) Tj +ET +endstream +endobj + +44 0 obj +46 +endobj + +%% Contents for page 6 +45 0 obj +<< + /Length 46 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 5) Tj +ET +endstream +endobj + +46 0 obj +46 +endobj + +%% Contents for page 7 +47 0 obj +<< + /Length 48 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 6) Tj +ET +endstream +endobj + +48 0 obj +46 +endobj + +%% Contents for page 8 +49 0 obj +<< + /Length 50 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 7) Tj +ET +endstream +endobj + +50 0 obj +46 +endobj + +%% Contents for page 9 +51 0 obj +<< + /Length 52 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 8) Tj +ET +endstream +endobj + +52 0 obj +46 +endobj + +%% Contents for page 10 +53 0 obj +<< + /Length 54 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 9) Tj +ET +endstream +endobj + +54 0 obj +46 +endobj + +%% Contents for page 11 +55 0 obj +<< + /Length 56 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 10) Tj +ET +endstream +endobj + +56 0 obj +47 +endobj + +%% Contents for page 12 +57 0 obj +<< + /Length 58 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 11) Tj +ET +endstream +endobj + +58 0 obj +47 +endobj + +%% Contents for page 13 +59 0 obj +<< + /Length 60 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 12) Tj +ET +endstream +endobj + +60 0 obj +47 +endobj + +%% Contents for page 14 +61 0 obj +<< + /Length 62 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 13) Tj +ET +endstream +endobj + +62 0 obj +47 +endobj + +%% Contents for page 15 +63 0 obj +<< + /Length 64 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 14) Tj +ET +endstream +endobj + +64 0 obj +47 +endobj + +%% Contents for page 16 +65 0 obj +<< + /Length 66 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 15) Tj +ET +endstream +endobj + +66 0 obj +47 +endobj + +%% Contents for page 17 +67 0 obj +<< + /Length 68 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 16) Tj +ET +endstream +endobj + +68 0 obj +47 +endobj + +%% Contents for page 18 +69 0 obj +<< + /Length 70 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 17) Tj +ET +endstream +endobj + +70 0 obj +47 +endobj + +%% Contents for page 19 +71 0 obj +<< + /Length 72 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 18) Tj +ET +endstream +endobj + +72 0 obj +47 +endobj + +%% Contents for page 20 +73 0 obj +<< + /Length 74 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 19) Tj +ET +endstream +endobj + +74 0 obj +47 +endobj + +%% Contents for page 21 +75 0 obj +<< + /Length 76 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 20) Tj +ET +endstream +endobj + +76 0 obj +47 +endobj + +%% Contents for page 22 +77 0 obj +<< + /Length 78 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 21) Tj +ET +endstream +endobj + +78 0 obj +47 +endobj + +%% Contents for page 23 +79 0 obj +<< + /Length 80 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 22) Tj +ET +endstream +endobj + +80 0 obj +47 +endobj + +%% Contents for page 24 +81 0 obj +<< + /Length 82 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 23) Tj +ET +endstream +endobj + +82 0 obj +47 +endobj + +%% Contents for page 25 +83 0 obj +<< + /Length 84 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 24) Tj +ET +endstream +endobj + +84 0 obj +47 +endobj + +%% Contents for page 26 +85 0 obj +<< + /Length 86 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 25) Tj +ET +endstream +endobj + +86 0 obj +47 +endobj + +%% Contents for page 27 +87 0 obj +<< + /Length 88 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 26) Tj +ET +endstream +endobj + +88 0 obj +47 +endobj + +%% Contents for page 28 +89 0 obj +<< + /Length 90 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 27) Tj +ET +endstream +endobj + +90 0 obj +47 +endobj + +%% Contents for page 29 +91 0 obj +<< + /Length 92 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 28) Tj +ET +endstream +endobj + +92 0 obj +47 +endobj + +%% Contents for page 30 +93 0 obj +<< + /Length 94 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 29) Tj +ET +endstream +endobj + +94 0 obj +47 +endobj + +95 0 obj +<< + /Type /Outlines + /First 97 0 R + /Last 96 0 R + /Count 6 +>> +endobj + +96 0 obj +<< + /Type /Outline + /Title (Isis 1 -> 5: /XYZ null null null) + /Parent 95 0 R + /Count 4 + /Prev 97 0 R + /First 98 0 R + /Last 99 0 R + /Dest [ 8 0 R /XYZ null null null ] +>> +endobj + +97 0 obj +<< + /Type /Outline + /Title (Trepak 2 -> 15: /XYZ 66 756 3) + /Parent 95 0 R + /Next 96 0 R + /Dest [ 18 0 R /XYZ 66 756 3 ] +>> +endobj + +98 0 obj +<< + /Type /Outline + /Title (Amanda 1.1 -> 11: /Fit) + /Parent 96 0 R + /Next 99 0 R + /First 100 0 R + /Last 101 0 R + /Count -3 + /Dest [ 14 0 R /Fit ] +>> +endobj + +99 0 obj +<< + /Type /Outline + /Title (Sandy 1.2 -> 13: /FitH 792) + /Parent 96 0 R + /Prev 98 0 R + /First 105 0 R + /Last 106 0 R + /Count 2 + /Dest [ 16 0 R /FitH 792 ] +>> +endobj + +100 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.1 -> 12: /FitV 100) + /Parent 98 0 R + /Next 101 0 R + /First 102 0 R + /Last 103 0 R + /Count -2 + /Dest [ 15 0 R /FitV 100 ] +>> +endobj + +101 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.2 -> 12: /XYZ null null null) + /Parent 98 0 R + /Prev 100 0 R + /First 104 0 R + /Last 104 0 R + /Count 1 + /Dest [ 15 0 R /XYZ null null null ] +>> +endobj + +102 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.1.1 -> 18: /XYZ null null null) + /Parent 100 0 R + /Next 103 0 R + /Dest [ 21 0 R /XYZ null null null ] +>> +endobj + +103 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.1.2 -> 19: /XYZ null null null) + /Parent 100 0 R + /Prev 102 0 R + /Dest [ 22 0 R /XYZ null null null ] +>> +endobj + +104 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.2.1 -> 22: /XYZ null null null) + /Parent 101 0 R + /Dest [ 25 0 R /XYZ null null null ] +>> +endobj + +105 0 obj +<< + /Type /Outline + /Title (Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770) + /Parent 99 0 R + /Next 106 0 R + /Dest [ 4 0 R /FitR 66 714 180 770 ] +>> +endobj + +106 0 obj +<< + /Type /Outline + /Title (Trepsicle 1.2.2 -> 0: /XYZ null null null) + /Parent 99 0 R + /Prev 105 0 R + /Dest [ 3 0 R /XYZ null null null ] +>> +endobj + +xref +0 107 +0000000000 65535 f +0000000025 00000 n +0000000434 00000 n +0000000830 00000 n +0000001035 00000 n +0000001240 00000 n +0000001445 00000 n +0000001650 00000 n +0000001855 00000 n +0000002060 00000 n +0000002265 00000 n +0000002471 00000 n +0000002678 00000 n +0000002885 00000 n +0000003092 00000 n +0000003299 00000 n +0000003506 00000 n +0000003713 00000 n +0000003920 00000 n +0000004127 00000 n +0000004334 00000 n +0000004541 00000 n +0000004748 00000 n +0000004955 00000 n +0000005162 00000 n +0000005369 00000 n +0000005576 00000 n +0000005783 00000 n +0000005990 00000 n +0000006197 00000 n +0000006404 00000 n +0000006611 00000 n +0000006818 00000 n +0000007037 00000 n +0000007140 00000 n +0000007160 00000 n +0000007279 00000 n +0000007338 00000 n +0000007441 00000 n +0000007484 00000 n +0000007587 00000 n +0000007630 00000 n +0000007733 00000 n +0000007776 00000 n +0000007879 00000 n +0000007922 00000 n +0000008025 00000 n +0000008068 00000 n +0000008171 00000 n +0000008214 00000 n +0000008317 00000 n +0000008360 00000 n +0000008463 00000 n +0000008507 00000 n +0000008610 00000 n +0000008654 00000 n +0000008758 00000 n +0000008802 00000 n +0000008906 00000 n +0000008950 00000 n +0000009054 00000 n +0000009098 00000 n +0000009202 00000 n +0000009246 00000 n +0000009350 00000 n +0000009394 00000 n +0000009498 00000 n +0000009542 00000 n +0000009646 00000 n +0000009690 00000 n +0000009794 00000 n +0000009838 00000 n +0000009942 00000 n +0000009986 00000 n +0000010090 00000 n +0000010134 00000 n +0000010238 00000 n +0000010282 00000 n +0000010386 00000 n +0000010430 00000 n +0000010534 00000 n +0000010578 00000 n +0000010682 00000 n +0000010726 00000 n +0000010830 00000 n +0000010874 00000 n +0000010978 00000 n +0000011022 00000 n +0000011126 00000 n +0000011170 00000 n +0000011274 00000 n +0000011318 00000 n +0000011422 00000 n +0000011466 00000 n +0000011570 00000 n +0000011590 00000 n +0000011677 00000 n +0000011873 00000 n +0000012019 00000 n +0000012194 00000 n +0000012377 00000 n +0000012568 00000 n +0000012778 00000 n +0000012947 00000 n +0000013116 00000 n +0000013269 00000 n +0000013438 00000 n +trailer << + /Root 1 0 R + /Size 107 +>> +startxref +13603 +%%EOF diff --git a/examples/qtest/bookmarks/2.pdf b/examples/qtest/bookmarks/2.pdf new file mode 100644 index 0000000..a7e01f9 --- /dev/null +++ b/examples/qtest/bookmarks/2.pdf @@ -0,0 +1,79 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R +>> +startxref +556 +%%EOF diff --git a/examples/qtest/bookmarks/3.pdf b/examples/qtest/bookmarks/3.pdf new file mode 100644 index 0000000..a1c0d95 --- /dev/null +++ b/examples/qtest/bookmarks/3.pdf @@ -0,0 +1 @@ +potato salad diff --git a/examples/qtest/bookmarks/4.pdf b/examples/qtest/bookmarks/4.pdf new file mode 100644 index 0000000..9d25f2f Binary files /dev/null and b/examples/qtest/bookmarks/4.pdf differ diff --git a/examples/qtest/bookmarks/5.pdf b/examples/qtest/bookmarks/5.pdf new file mode 100644 index 0000000..53a89ae --- /dev/null +++ b/examples/qtest/bookmarks/5.pdf @@ -0,0 +1,1573 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /PageLabels 107 0 R + /Pages 2 0 R + /Type /Catalog + /PageMode /UseOutlines + /Outlines 95 0 R +>> +endobj + +2 0 obj +<< + /Count 30 + /Kids [ + 3 0 R + 4 0 R + 5 0 R + 6 0 R + 7 0 R + 8 0 R + 9 0 R + 10 0 R + 11 0 R + 12 0 R + 13 0 R + 14 0 R + 15 0 R + 16 0 R + 17 0 R + 18 0 R + 19 0 R + 20 0 R + 21 0 R + 22 0 R + 23 0 R + 24 0 R + 25 0 R + 26 0 R + 27 0 R + 28 0 R + 29 0 R + 30 0 R + 31 0 R + 32 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +3 0 obj +<< + /Contents 33 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 2 +4 0 obj +<< + /Contents 37 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 3 +5 0 obj +<< + /Contents 39 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 4 +6 0 obj +<< + /Contents 41 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 5 +7 0 obj +<< + /Contents 43 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 6 +8 0 obj +<< + /Contents 45 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 7 +9 0 obj +<< + /Contents 47 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 8 +10 0 obj +<< + /Contents 49 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 9 +11 0 obj +<< + /Contents 51 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 10 +12 0 obj +<< + /Contents 53 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 11 +13 0 obj +<< + /Contents 55 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 12 +14 0 obj +<< + /Contents 57 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 13 +15 0 obj +<< + /Contents 59 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 14 +16 0 obj +<< + /Contents 61 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 15 +17 0 obj +<< + /Contents 63 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 16 +18 0 obj +<< + /Contents 65 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 17 +19 0 obj +<< + /Contents 67 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 18 +20 0 obj +<< + /Contents 69 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 19 +21 0 obj +<< + /Contents 71 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 20 +22 0 obj +<< + /Contents 73 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 21 +23 0 obj +<< + /Contents 75 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 22 +24 0 obj +<< + /Contents 77 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 23 +25 0 obj +<< + /Contents 79 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 24 +26 0 obj +<< + /Contents 81 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 25 +27 0 obj +<< + /Contents 83 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 26 +28 0 obj +<< + /Contents 85 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 27 +29 0 obj +<< + /Contents 87 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 28 +30 0 obj +<< + /Contents 89 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 29 +31 0 obj +<< + /Contents 91 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 30 +32 0 obj +<< + /Contents 93 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +33 0 obj +<< + /Length 34 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 0) Tj +ET +endstream +endobj + +34 0 obj +46 +endobj + +35 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +36 0 obj +[ + /PDF + /Text +] +endobj + +%% Contents for page 2 +37 0 obj +<< + /Length 38 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 1) Tj +ET +endstream +endobj + +38 0 obj +46 +endobj + +%% Contents for page 3 +39 0 obj +<< + /Length 40 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 2) Tj +ET +endstream +endobj + +40 0 obj +46 +endobj + +%% Contents for page 4 +41 0 obj +<< + /Length 42 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 3) Tj +ET +endstream +endobj + +42 0 obj +46 +endobj + +%% Contents for page 5 +43 0 obj +<< + /Length 44 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 4) Tj +ET +endstream +endobj + +44 0 obj +46 +endobj + +%% Contents for page 6 +45 0 obj +<< + /Length 46 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 5) Tj +ET +endstream +endobj + +46 0 obj +46 +endobj + +%% Contents for page 7 +47 0 obj +<< + /Length 48 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 6) Tj +ET +endstream +endobj + +48 0 obj +46 +endobj + +%% Contents for page 8 +49 0 obj +<< + /Length 50 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 7) Tj +ET +endstream +endobj + +50 0 obj +46 +endobj + +%% Contents for page 9 +51 0 obj +<< + /Length 52 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 8) Tj +ET +endstream +endobj + +52 0 obj +46 +endobj + +%% Contents for page 10 +53 0 obj +<< + /Length 54 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 9) Tj +ET +endstream +endobj + +54 0 obj +46 +endobj + +%% Contents for page 11 +55 0 obj +<< + /Length 56 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 10) Tj +ET +endstream +endobj + +56 0 obj +47 +endobj + +%% Contents for page 12 +57 0 obj +<< + /Length 58 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 11) Tj +ET +endstream +endobj + +58 0 obj +47 +endobj + +%% Contents for page 13 +59 0 obj +<< + /Length 60 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 12) Tj +ET +endstream +endobj + +60 0 obj +47 +endobj + +%% Contents for page 14 +61 0 obj +<< + /Length 62 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 13) Tj +ET +endstream +endobj + +62 0 obj +47 +endobj + +%% Contents for page 15 +63 0 obj +<< + /Length 64 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 14) Tj +ET +endstream +endobj + +64 0 obj +47 +endobj + +%% Contents for page 16 +65 0 obj +<< + /Length 66 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 15) Tj +ET +endstream +endobj + +66 0 obj +47 +endobj + +%% Contents for page 17 +67 0 obj +<< + /Length 68 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 16) Tj +ET +endstream +endobj + +68 0 obj +47 +endobj + +%% Contents for page 18 +69 0 obj +<< + /Length 70 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 17) Tj +ET +endstream +endobj + +70 0 obj +47 +endobj + +%% Contents for page 19 +71 0 obj +<< + /Length 72 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 18) Tj +ET +endstream +endobj + +72 0 obj +47 +endobj + +%% Contents for page 20 +73 0 obj +<< + /Length 74 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 19) Tj +ET +endstream +endobj + +74 0 obj +47 +endobj + +%% Contents for page 21 +75 0 obj +<< + /Length 76 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 20) Tj +ET +endstream +endobj + +76 0 obj +47 +endobj + +%% Contents for page 22 +77 0 obj +<< + /Length 78 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 21) Tj +ET +endstream +endobj + +78 0 obj +47 +endobj + +%% Contents for page 23 +79 0 obj +<< + /Length 80 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 22) Tj +ET +endstream +endobj + +80 0 obj +47 +endobj + +%% Contents for page 24 +81 0 obj +<< + /Length 82 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 23) Tj +ET +endstream +endobj + +82 0 obj +47 +endobj + +%% Contents for page 25 +83 0 obj +<< + /Length 84 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 24) Tj +ET +endstream +endobj + +84 0 obj +47 +endobj + +%% Contents for page 26 +85 0 obj +<< + /Length 86 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 25) Tj +ET +endstream +endobj + +86 0 obj +47 +endobj + +%% Contents for page 27 +87 0 obj +<< + /Length 88 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 26) Tj +ET +endstream +endobj + +88 0 obj +47 +endobj + +%% Contents for page 28 +89 0 obj +<< + /Length 90 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 27) Tj +ET +endstream +endobj + +90 0 obj +47 +endobj + +%% Contents for page 29 +91 0 obj +<< + /Length 92 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 28) Tj +ET +endstream +endobj + +92 0 obj +47 +endobj + +%% Contents for page 30 +93 0 obj +<< + /Length 94 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 29) Tj +ET +endstream +endobj + +94 0 obj +47 +endobj + +95 0 obj +<< + /Type /Outlines + /First 96 0 R + /Last 97 0 R + /Count 6 +>> +endobj + +96 0 obj +<< + /Type /Outline + /Title (Isís 1 -> 5: /XYZ null null null) + /Parent 95 0 R + /Count 4 + /Next 97 0 R + /First 98 0 R + /Last 99 0 R + /Dest [ 8 0 R /XYZ null null null ] +>> +endobj + +97 0 obj +<< + /Type /Outline + /Title (Trepak 2 -> 15: /XYZ 66 756 3) + /Parent 95 0 R + /Prev 96 0 R + /Dest [ 18 0 R /XYZ 66 756 3 ] +>> +endobj + +98 0 obj +<< + /Type /Outline + /Title (Amanda 1.1 -> 11: /Fit) + /Parent 96 0 R + /Next 99 0 R + /First 100 0 R + /Last 101 0 R + /Count -3 + /Dest [ 14 0 R /Fit ] +>> +endobj + +99 0 obj +<< + /Type /Outline + % /Title (Sandy (Sandy [Greek]) 1.2 -> 13: /FitH 792) + /Title + /Parent 96 0 R + /Prev 98 0 R + /First 105 0 R + /Last 106 0 R + /Count 2 + /Dest [ 16 0 R /FitH 792 ] +>> +endobj + +100 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.1 -> 12: /FitV 100) + /Parent 98 0 R + /Next 101 0 R + /First 102 0 R + /Last 103 0 R + /Count -2 + /Dest [ 15 0 R /FitV 100 ] +>> +endobj + +101 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.2 -> 12: /XYZ null null null) + /Parent 98 0 R + /Prev 100 0 R + /First 104 0 R + /Last 104 0 R + /Count 1 + /Dest [ 15 0 R /XYZ null null null ] +>> +endobj + +102 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.1.1 -> 18: /XYZ null null null) + /Parent 100 0 R + /Next 103 0 R + /Dest [ 21 0 R /XYZ null null null ] +>> +endobj + +103 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.1.2 -> 19: /XYZ null null null) + /Parent 100 0 R + /Prev 102 0 R + /Dest [ 22 0 R /XYZ null null null ] +>> +endobj + +104 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.2.1 -> 22: /XYZ null null null) + /Parent 101 0 R + /Dest [ 25 0 R /XYZ null null null ] +>> +endobj + +105 0 obj +<< + /Type /Outline + /Title (Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770) + /Parent 99 0 R + /Next 106 0 R + /Dest [ 4 0 R /FitR 66 714 180 770 ] +>> +endobj + +106 0 obj +<< + /Type /Outline + /Title (Trepsicle 1.2.2 -> 0: /XYZ null null null) + /Parent 99 0 R + /Prev 105 0 R + /Dest [ 3 0 R /XYZ null null null ] +>> +endobj + +107 0 obj + << /Nums [ + 0 << /P () >> + 2 << /S /r /St 1 >> + 7 << /P () >> + 9 << /S /r /St 6 >> + 11 << /P () >> + 12 << /S /D /St 2 >> + 15 << /S /D /St 6 >> + 19 << /P () >> + 20 << /S /D /St 12 >> + 22 << /S /D /St 16059 >> + 23 << /S /r /St 50 >> + 29 << /S /r /St 54 >> + ] >> +endobj + +xref +0 108 +0000000000 65535 f +0000000025 00000 n +0000000145 00000 n +0000000541 00000 n +0000000746 00000 n +0000000951 00000 n +0000001156 00000 n +0000001361 00000 n +0000001566 00000 n +0000001771 00000 n +0000001976 00000 n +0000002182 00000 n +0000002389 00000 n +0000002596 00000 n +0000002803 00000 n +0000003010 00000 n +0000003217 00000 n +0000003424 00000 n +0000003631 00000 n +0000003838 00000 n +0000004045 00000 n +0000004252 00000 n +0000004459 00000 n +0000004666 00000 n +0000004873 00000 n +0000005080 00000 n +0000005287 00000 n +0000005494 00000 n +0000005701 00000 n +0000005908 00000 n +0000006115 00000 n +0000006322 00000 n +0000006529 00000 n +0000006748 00000 n +0000006851 00000 n +0000006871 00000 n +0000006990 00000 n +0000007049 00000 n +0000007152 00000 n +0000007195 00000 n +0000007298 00000 n +0000007341 00000 n +0000007444 00000 n +0000007487 00000 n +0000007590 00000 n +0000007633 00000 n +0000007736 00000 n +0000007779 00000 n +0000007882 00000 n +0000007925 00000 n +0000008028 00000 n +0000008071 00000 n +0000008174 00000 n +0000008218 00000 n +0000008321 00000 n +0000008365 00000 n +0000008469 00000 n +0000008513 00000 n +0000008617 00000 n +0000008661 00000 n +0000008765 00000 n +0000008809 00000 n +0000008913 00000 n +0000008957 00000 n +0000009061 00000 n +0000009105 00000 n +0000009209 00000 n +0000009253 00000 n +0000009357 00000 n +0000009401 00000 n +0000009505 00000 n +0000009549 00000 n +0000009653 00000 n +0000009697 00000 n +0000009801 00000 n +0000009845 00000 n +0000009949 00000 n +0000009993 00000 n +0000010097 00000 n +0000010141 00000 n +0000010245 00000 n +0000010289 00000 n +0000010393 00000 n +0000010437 00000 n +0000010541 00000 n +0000010585 00000 n +0000010689 00000 n +0000010733 00000 n +0000010837 00000 n +0000010881 00000 n +0000010985 00000 n +0000011029 00000 n +0000011133 00000 n +0000011177 00000 n +0000011281 00000 n +0000011301 00000 n +0000011388 00000 n +0000011584 00000 n +0000011730 00000 n +0000011905 00000 n +0000012258 00000 n +0000012449 00000 n +0000012659 00000 n +0000012828 00000 n +0000012997 00000 n +0000013150 00000 n +0000013319 00000 n +0000013484 00000 n +trailer << + /Root 1 0 R + /Size 108 +>> +startxref +13801 +%%EOF + +% 1. Delete page labels +xref +0 1 +0000000107 65535 f +107 1 +0000000000 00001 f +trailer << /Root 1 0 R /Size 108 /Prev 13801 >> +startxref +16059 +%%EOF + +% 2. Delete outlines, reuse page labels. + +107 1 obj + << /Nums [ + 0 << /P () >> + 2 << /S /D /St 1 >> + 7 << /P () >> + 9 << /S /R /St 6 >> + 11 << /P () >> + 12 << /S /r /St 2 >> + 15 << /S /r /St 6 >> + 19 << /P () >> + 20 << /S /R /St 12 >> + 22 << /S /D /St 16059 >> + 23 << /S /r /St 50 >> + 29 << /S /r /St 54 >> + ] >> +endobj + +% Reuse object 1 with the same generation number. Leave outlines +% there pointing to a deleted object. +1 0 obj +<< + /PageLabels 107 1 R + /Pages 2 0 R + /Type /Catalog + /PageMode /UseOutlines + /Outlines 95 0 R +>> +endobj + +xref +0 2 +0000000095 65535 f +0000016648 00000 n +95 13 +0000000096 00001 f +0000000097 00001 f +0000000098 00001 f +0000000099 00001 f +0000000100 00001 f +0000000101 00001 f +0000000102 00001 f +0000000103 00001 f +0000000104 00001 f +0000000105 00001 f +0000000106 00001 f +0000000000 00001 f +0000016227 00001 n +trailer << /Size 108 /Prev 16059 /Root 1 0 R >> +startxref +16768 +%%EOF diff --git a/examples/qtest/bookmarks/encrypted.out b/examples/qtest/bookmarks/encrypted.out new file mode 100644 index 0000000..4ad63b7 --- /dev/null +++ b/examples/qtest/bookmarks/encrypted.out @@ -0,0 +1,11 @@ +[ -> 6 ] Isís 1 -> 5: /XYZ null null null +[ -> 12 ] Amanda 1.1 -> 11: /Fit +[ -> 13 ] Isosicle 1.1.1 -> 12: /FitV 100 +[ -> 19 ] Isosicle 1.1.1.1 -> 18: /XYZ null null null +[ -> 20 ] Isosicle 1.1.1.2 -> 19: /XYZ null null null +[ -> 13 ] Isosicle 1.1.2 -> 12: /XYZ null null null +[ -> 23 ] Isosicle 1.1.2.1 -> 22: /XYZ null null null +[ -> 14 ] Sandy ÷Σανδι÷ 1.2 -> 13: /FitH 792 +[ -> 2 ] Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770 +[ -> 1 ] Trepsicle 1.2.2 -> 0: /XYZ null null null +[ -> 16 ] Trepak 2 -> 15: /XYZ 66 756 3 diff --git a/examples/qtest/bookmarks/test.-show-open.-lines.out b/examples/qtest/bookmarks/test.-show-open.-lines.out new file mode 100644 index 0000000..ea66669 --- /dev/null +++ b/examples/qtest/bookmarks/test.-show-open.-lines.out @@ -0,0 +1,22 @@ +| ++-+ ( ) Trepak 2 -> 15: /XYZ 66 756 3 +| ++-+ (v) Isis 1 -> 5: /XYZ null null null + | + +-+ (>) Amanda 1.1 -> 11: /Fit + | | + | +-+ (>) Isosicle 1.1.1 -> 12: /FitV 100 + | | | + | | +-+ ( ) Isosicle 1.1.1.1 -> 18: /XYZ null null null + | | | + | | +-+ ( ) Isosicle 1.1.1.2 -> 19: /XYZ null null null + | | + | +-+ (v) Isosicle 1.1.2 -> 12: /XYZ null null null + | | + | +-+ ( ) Isosicle 1.1.2.1 -> 22: /XYZ null null null + | + +-+ (v) Sandy 1.2 -> 13: /FitH 792 + | + +-+ ( ) Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770 + | + +-+ ( ) Trepsicle 1.2.2 -> 0: /XYZ null null null diff --git a/examples/qtest/bookmarks/test.-show-open.-numbers.out b/examples/qtest/bookmarks/test.-show-open.-numbers.out new file mode 100644 index 0000000..3680c2d --- /dev/null +++ b/examples/qtest/bookmarks/test.-show-open.-numbers.out @@ -0,0 +1,11 @@ +1. ( ) Trepak 2 -> 15: /XYZ 66 756 3 +2. (v) Isis 1 -> 5: /XYZ null null null +2.1. (>) Amanda 1.1 -> 11: /Fit +2.1.1. (>) Isosicle 1.1.1 -> 12: /FitV 100 +2.1.1.1. ( ) Isosicle 1.1.1.1 -> 18: /XYZ null null null +2.1.1.2. ( ) Isosicle 1.1.1.2 -> 19: /XYZ null null null +2.1.2. (v) Isosicle 1.1.2 -> 12: /XYZ null null null +2.1.2.1. ( ) Isosicle 1.1.2.1 -> 22: /XYZ null null null +2.2. (v) Sandy 1.2 -> 13: /FitH 792 +2.2.1. ( ) Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770 +2.2.2. ( ) Trepsicle 1.2.2 -> 0: /XYZ null null null diff --git a/examples/qtest/bookmarks/test.-show-open..out b/examples/qtest/bookmarks/test.-show-open..out new file mode 100644 index 0000000..46667ef --- /dev/null +++ b/examples/qtest/bookmarks/test.-show-open..out @@ -0,0 +1,11 @@ +( ) Trepak 2 -> 15: /XYZ 66 756 3 +(v) Isis 1 -> 5: /XYZ null null null +(>) Amanda 1.1 -> 11: /Fit +(>) Isosicle 1.1.1 -> 12: /FitV 100 +( ) Isosicle 1.1.1.1 -> 18: /XYZ null null null +( ) Isosicle 1.1.1.2 -> 19: /XYZ null null null +(v) Isosicle 1.1.2 -> 12: /XYZ null null null +( ) Isosicle 1.1.2.1 -> 22: /XYZ null null null +(v) Sandy 1.2 -> 13: /FitH 792 +( ) Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770 +( ) Trepsicle 1.2.2 -> 0: /XYZ null null null diff --git a/examples/qtest/bookmarks/test..-lines.out b/examples/qtest/bookmarks/test..-lines.out new file mode 100644 index 0000000..a6de7db --- /dev/null +++ b/examples/qtest/bookmarks/test..-lines.out @@ -0,0 +1,22 @@ +| ++-+ Trepak 2 -> 15: /XYZ 66 756 3 +| ++-+ Isis 1 -> 5: /XYZ null null null + | + +-+ Amanda 1.1 -> 11: /Fit + | | + | +-+ Isosicle 1.1.1 -> 12: /FitV 100 + | | | + | | +-+ Isosicle 1.1.1.1 -> 18: /XYZ null null null + | | | + | | +-+ Isosicle 1.1.1.2 -> 19: /XYZ null null null + | | + | +-+ Isosicle 1.1.2 -> 12: /XYZ null null null + | | + | +-+ Isosicle 1.1.2.1 -> 22: /XYZ null null null + | + +-+ Sandy 1.2 -> 13: /FitH 792 + | + +-+ Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770 + | + +-+ Trepsicle 1.2.2 -> 0: /XYZ null null null diff --git a/examples/qtest/bookmarks/test..-numbers.out b/examples/qtest/bookmarks/test..-numbers.out new file mode 100644 index 0000000..7ff9e2a --- /dev/null +++ b/examples/qtest/bookmarks/test..-numbers.out @@ -0,0 +1,11 @@ +1. Trepak 2 -> 15: /XYZ 66 756 3 +2. Isis 1 -> 5: /XYZ null null null +2.1. Amanda 1.1 -> 11: /Fit +2.1.1. Isosicle 1.1.1 -> 12: /FitV 100 +2.1.1.1. Isosicle 1.1.1.1 -> 18: /XYZ null null null +2.1.1.2. Isosicle 1.1.1.2 -> 19: /XYZ null null null +2.1.2. Isosicle 1.1.2 -> 12: /XYZ null null null +2.1.2.1. Isosicle 1.1.2.1 -> 22: /XYZ null null null +2.2. Sandy 1.2 -> 13: /FitH 792 +2.2.1. Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770 +2.2.2. Trepsicle 1.2.2 -> 0: /XYZ null null null diff --git a/examples/qtest/bookmarks/test...out b/examples/qtest/bookmarks/test...out new file mode 100644 index 0000000..31a1cf4 --- /dev/null +++ b/examples/qtest/bookmarks/test...out @@ -0,0 +1,11 @@ +Trepak 2 -> 15: /XYZ 66 756 3 +Isis 1 -> 5: /XYZ null null null +Amanda 1.1 -> 11: /Fit +Isosicle 1.1.1 -> 12: /FitV 100 +Isosicle 1.1.1.1 -> 18: /XYZ null null null +Isosicle 1.1.1.2 -> 19: /XYZ null null null +Isosicle 1.1.2 -> 12: /XYZ null null null +Isosicle 1.1.2.1 -> 22: /XYZ null null null +Sandy 1.2 -> 13: /FitH 792 +Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770 +Trepsicle 1.2.2 -> 0: /XYZ null null null diff --git a/examples/qtest/create.test b/examples/qtest/create.test new file mode 100644 index 0000000..bcdac25 --- /dev/null +++ b/examples/qtest/create.test @@ -0,0 +1,29 @@ +#!/usr/bin/env perl +require 5.008; +use warnings; +use strict; + +chdir("create") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +cleanup(); + +my $td = new TestDriver('create'); + +$td->runtest("create a simple PDF", + {$td->COMMAND => "pdf-create a.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); + +$td->runtest("check", + {$td->FILE => "a.pdf"}, + {$td->FILE => "orange-square.pdf"}); + +cleanup(); + +$td->report(2); + +sub cleanup +{ + unlink "a.pdf"; +} diff --git a/examples/qtest/create/orange-square.pdf b/examples/qtest/create/orange-square.pdf new file mode 100644 index 0000000..28fb47c Binary files /dev/null and b/examples/qtest/create/orange-square.pdf differ diff --git a/examples/qtest/double-page-size.test b/examples/qtest/double-page-size.test new file mode 100644 index 0000000..0c4a08b --- /dev/null +++ b/examples/qtest/double-page-size.test @@ -0,0 +1,32 @@ +#!/usr/bin/env perl +require 5.008; +BEGIN { $^W = 1; } +use strict; + +chdir("double-page-size") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +my $td = new TestDriver('double-page-size'); + +cleanup(); + +$td->runtest("double page size", + {$td->COMMAND => "pdf-double-page-size in.pdf a.pdf"}, + {$td->STRING => + "pdf-double-page-size: new file written to a.pdf\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "out.pdf"}); + +cleanup(); + +$td->report(2); + +sub cleanup +{ + unlink 'a.pdf'; +} diff --git a/examples/qtest/double-page-size/in.pdf b/examples/qtest/double-page-size/in.pdf new file mode 100644 index 0000000..84f252b --- /dev/null +++ b/examples/qtest/double-page-size/in.pdf @@ -0,0 +1,55 @@ +%PDF-1.3 +%¿÷¢þ +1 0 obj +<< /Pages 2 0 R /Type /Catalog >> +endobj +2 0 obj +<< /Count 2 /Kids [ 3 0 R 4 0 R ] /Type /Pages >> +endobj +3 0 obj +<< /Contents 5 0 R /MediaBox [ 0 0 612 792 ] /Parent 2 0 R /Resources << /Font << /F1 6 0 R >> /ProcSet 7 0 R >> /Type /Page >> +endobj +4 0 obj +<< /Contents 8 0 R /MediaBox [ 0 0 612 792 ] /Parent 2 0 R /Resources << /Font << /F1 6 0 R >> /ProcSet 7 0 R >> /Type /Page >> +endobj +5 0 obj +<< /Length 44 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj +6 0 obj +<< /BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font >> +endobj +7 0 obj +[ /PDF /Text ] +endobj +8 0 obj +<< /Length 43 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Salad) Tj +ET +endstream +endobj +xref +0 9 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000129 00000 n +0000000272 00000 n +0000000415 00000 n +0000000508 00000 n +0000000615 00000 n +0000000645 00000 n +trailer << /Root 1 0 R /Size 9 /ID [<071a6499182be9cfc990b11d0c4e5bc0><90dbb2f2f000af76d1107187b0e00349>] >> +startxref +737 +%%EOF diff --git a/examples/qtest/double-page-size/out.pdf b/examples/qtest/double-page-size/out.pdf new file mode 100644 index 0000000..e27706c --- /dev/null +++ b/examples/qtest/double-page-size/out.pdf @@ -0,0 +1,69 @@ +%PDF-1.3 +%¿÷¢þ +1 0 obj +<< /Pages 2 0 R /Type /Catalog >> +endobj +2 0 obj +<< /Count 2 /Kids [ 3 0 R 4 0 R ] /Type /Pages >> +endobj +3 0 obj +<< /Contents [ 5 0 R 6 0 R ] /MediaBox [ 0.00 0.00 1224.00 1584.00 ] /Parent 2 0 R /Resources << /Font << /F1 7 0 R >> /ProcSet 8 0 R >> /Type /Page >> +endobj +4 0 obj +<< /Contents [ 9 0 R 10 0 R ] /MediaBox [ 0.00 0.00 1224.00 1584.00 ] /Parent 2 0 R /Resources << /Font << /F1 7 0 R >> /ProcSet 8 0 R >> /Type /Page >> +endobj +5 0 obj +<< /Length 15 >> +stream +2 0 0 2 0 0 cm +endstream +endobj +6 0 obj +<< /Length 44 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj +7 0 obj +<< /BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font >> +endobj +8 0 obj +[ /PDF /Text ] +endobj +9 0 obj +<< /Length 15 >> +stream +2 0 0 2 0 0 cm +endstream +endobj +10 0 obj +<< /Length 43 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Salad) Tj +ET +endstream +endobj +xref +0 11 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000129 00000 n +0000000296 00000 n +0000000464 00000 n +0000000528 00000 n +0000000621 00000 n +0000000728 00000 n +0000000758 00000 n +0000000822 00000 n +trailer << /Root 1 0 R /Size 11 /ID [<071a6499182be9cfc990b11d0c4e5bc0><31415926535897932384626433832795>] >> +startxref +915 +%%EOF diff --git a/examples/qtest/invert-images.test b/examples/qtest/invert-images.test new file mode 100644 index 0000000..0dc15a2 --- /dev/null +++ b/examples/qtest/invert-images.test @@ -0,0 +1,32 @@ +#!/usr/bin/env perl +require 5.008; +BEGIN { $^W = 1; } +use strict; + +chdir("invert-images") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +my $td = new TestDriver('invert-images'); + +cleanup(); + +$td->runtest("double page size", + {$td->COMMAND => "pdf-invert-images in.pdf a.pdf"}, + {$td->STRING => + "pdf-invert-images: new file written to a.pdf\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "out.pdf"}); + +cleanup(); + +$td->report(2); + +sub cleanup +{ + unlink 'a.pdf'; +} diff --git a/examples/qtest/invert-images/in.pdf b/examples/qtest/invert-images/in.pdf new file mode 100644 index 0000000..30a1649 Binary files /dev/null and b/examples/qtest/invert-images/in.pdf differ diff --git a/examples/qtest/invert-images/out.pdf b/examples/qtest/invert-images/out.pdf new file mode 100644 index 0000000..cd3c591 Binary files /dev/null and b/examples/qtest/invert-images/out.pdf differ diff --git a/examples/qtest/linearize.test b/examples/qtest/linearize.test new file mode 100644 index 0000000..700cdca --- /dev/null +++ b/examples/qtest/linearize.test @@ -0,0 +1,32 @@ +#!/usr/bin/env perl +require 5.008; +BEGIN { $^W = 1; } +use strict; + +chdir("linearize") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +cleanup(); + +my $td = new TestDriver('linearize'); + +my $qpdf = $ENV{'QPDF_BIN'} or die; + +$td->runtest("linearize", + {$td->COMMAND => "pdf-linearize input.pdf '' a.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); + +$td->runtest("check", + {$td->COMMAND => "$qpdf --check a.pdf"}, + {$td->FILE => "check.out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +cleanup(); + +$td->report(2); + +sub cleanup +{ + unlink "a.pdf"; +} diff --git a/examples/qtest/linearize/check.out b/examples/qtest/linearize/check.out new file mode 100644 index 0000000..af887be --- /dev/null +++ b/examples/qtest/linearize/check.out @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.3 +File is not encrypted +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/examples/qtest/linearize/input.pdf b/examples/qtest/linearize/input.pdf new file mode 100644 index 0000000..a7e01f9 --- /dev/null +++ b/examples/qtest/linearize/input.pdf @@ -0,0 +1,79 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R +>> +startxref +556 +%%EOF diff --git a/examples/qtest/mod-info.test b/examples/qtest/mod-info.test new file mode 100644 index 0000000..145bf13 --- /dev/null +++ b/examples/qtest/mod-info.test @@ -0,0 +1,100 @@ +#!/usr/bin/env perl +require 5.008; +BEGIN { $^W = 1; } +use strict; +use File::Copy; + +chdir("mod-info"); + +require TestDriver; + +my $td = new TestDriver('pdf-mod-info'); + +my $prg = "pdf-mod-info"; +my $qpdf = $ENV{'QPDF_BIN'} or die; + +cleanup(); + +$td->runtest("usage #1", + {$td->COMMAND => "$prg -in target.pdf"}, + {$td->FILE => "usage.out", + $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("usage #2", + {$td->COMMAND => "$prg -key abc -val def"}, + {$td->FILE => "usage.out", + $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("usage #3", + {$td->COMMAND => "$prg -key abc -val def abc"}, + {$td->FILE => "usage.out", + $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("usage #4", + {$td->COMMAND => "$prg -in source1.pdf -key date -val 01/01/01 -val 12/12/12"}, + {$td->FILE => "usage.out", + $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("dump #1", + {$td->COMMAND => "$prg --dump -in files/source1.pdf"}, + {$td->FILE => "dump.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("dump #2", + {$td->COMMAND => "$prg --dump -in files/no-info.pdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("dump #3", + {$td->COMMAND => "$prg --dump -in files/empty-info.pdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); + +run_and_cmp("modify Subject", + "$prg -in files/source1.pdf -out out.pdf -key Subject " . + "-val \"Export Business\"", + "", "out.pdf", "files/1.qdf"); + +run_and_cmp("add Subject, remove Producer, modify CreationDate", + "$prg -in files/source2.pdf -out out.pdf -key Subject " . + "-val \"Tammlin\" -key Producer -key CreationDate -val 12/12", + "", "out.pdf", "files/2.qdf"); + +run_and_cmp("add Subject (empty-info file)", + "$prg -in files/empty-info.pdf -out out.pdf -key Subject " . + "-val Tammlin", + "", "out.pdf", "files/3.qdf"); + +copy("files/no-info.pdf", "no-info.pdf") or die "can't copy no-info: $!"; +run_and_cmp("in-place Producer added (no-info file)", + "$prg -in no-info.pdf -key Producer -val \"Obivan Kinobi\"", + "", "no-info.pdf", "files/4.qdf"); + +cleanup(); + +$td->report(15); + +sub cleanup +{ + unlink (<*.pdf>); +} + +sub run_and_cmp +{ + my ($dsc, $cmd, $out, $fout, $fexp) = @_; + $td->runtest($dsc, + {$td->COMMAND => "$cmd --static-id"}, + {$td->STRING => $out, + $td->EXIT_STATUS => 0}); + $td->runtest("$dsc output", + {$td->COMMAND => "$qpdf --static-id" . + " --no-original-object-ids -qdf $fout -"}, + {$td->FILE => $fexp, + $td->EXIT_STATUS => 0}); +} diff --git a/examples/qtest/mod-info/dump.out b/examples/qtest/mod-info/dump.out new file mode 100644 index 0000000..a453f9d --- /dev/null +++ b/examples/qtest/mod-info/dump.out @@ -0,0 +1,11 @@ +Author: Yours Truly +ContentTemperature: 100F +CreationDate: D:20040212104653-05'00' +Creator: Adobe Acrobat 6.0 +FormerlyKnownAs: target/branch/leaf/leaf.pdf +Keywords: 40, 128, public, encryption, ignition, primarily prime +ModDate: D:20040212112832-05'00' +Producer: Adobe Acrobat 6.0 Image Conversion Plug-in +Subject: Of The Matter +Title: My New Car Title +VeryImportantNote: pordofor stands for portable document format diff --git a/examples/qtest/mod-info/files/1.qdf b/examples/qtest/mod-info/files/1.qdf new file mode 100644 index 0000000..2b63f6a Binary files /dev/null and b/examples/qtest/mod-info/files/1.qdf differ diff --git a/examples/qtest/mod-info/files/2.qdf b/examples/qtest/mod-info/files/2.qdf new file mode 100644 index 0000000..63be243 --- /dev/null +++ b/examples/qtest/mod-info/files/2.qdf @@ -0,0 +1,1338 @@ +%PDF-1.5 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /Metadata 3 0 R + /Pages 5 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /CreationDate (12/12) + /Creator (Writer) + /ModDate (D:20041221113239-05'00') + /Subject (Tammlin) +>> +endobj + +3 0 obj +<< + /Subtype /XML + /Type /Metadata + /Length 4 0 R +>> +stream + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +endstream +endobj + +%QDF: ignore_newline +4 0 obj +3154 +endobj + +5 0 obj +<< + /Count 1 + /Kids [ + 6 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +6 0 obj +<< + /Annots 7 0 R + /Contents 8 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 5 0 R + /Resources 10 0 R + /Type /Page +>> +endobj + +7 0 obj +[ + 11 0 R +] +endobj + +%% Contents for page 1 +8 0 obj +<< + /Length 9 0 R +>> +stream +0 w +q 0 -0.1 612.1 792.1 re W* n +q 0 0 0 rg +BT +90.1 615.3 Td /F1 80 Tf (abcd) Tj +151.2 0 Td (-) Tj +26.6 0 Td (efghjk-) Tj +ET +Q +q 0 0 0 rg +BT +90.1 504.8 Td /F1 80 Tf (mn) Tj +102.4 0 Td ( ) Tj +20 0 Td (o) Tj +40.1 0 Td (p) Tj +39.9 0 Td (-) Tj +26.8 0 Td (q) Tj +ET +Q +q 0 0 0 rg +BT +90.1 394.3 Td /F1 80 Tf (rs) Tj +58.7 0 Td (tu) Tj +62.1 0 Td (v) Tj +40.1 0 Td (w) Tj +57.8 0 Td ( ) Tj +20.1 0 Td (xyz) Tj +ET +Q +Q +endstream +endobj + +9 0 obj +404 +endobj + +10 0 obj +<< + /Font 12 0 R + /ProcSet [ + /PDF + ] +>> +endobj + +11 0 obj +<< + /APEX:Id (353) + /APEX:Label (1) + /APEX:LabelAp 13 0 R + /F 4 + /Rect [ + 63.461945 + 339.112457 + 525.003418 + 700.653259 + ] + /Subtype /APEX:Zone + /Type /Annot +>> +endobj + +12 0 obj +<< + /F1 15 0 R +>> +endobj + +13 0 obj +<< + /BBox [ + 0.0 + 0.0 + 9.199997 + 12.399994 + ] + /FormType 1 + /Resources << + /Font 16 0 R + /ProcSet [ + /PDF + /Text + ] + >> + /Subtype /Form + /Type /XObject + /Length 14 0 R +>> +stream +0 0 1 rg +0 0 9.2 12.4 re +f +BT +1 g +/LABELFONT 12 Tf +1 2.32 TD +(1)Tj +ET +endstream +endobj + +14 0 obj +70 +endobj + +15 0 obj +<< + /BaseFont /NimbusRomanNo9L-Regu + /FirstChar 0 + /FontDescriptor 17 0 R + /LastChar 255 + /Subtype /Type1 + /ToUnicode 18 0 R + /Type /Font + /Widths [ + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 250 + 333 + 408 + 500 + 500 + 833 + 778 + 333 + 333 + 333 + 500 + 564 + 250 + 333 + 250 + 278 + 500 + 500 + 500 + 500 + 500 + 500 + 500 + 500 + 500 + 500 + 278 + 278 + 564 + 564 + 564 + 444 + 921 + 722 + 662 + 667 + 718 + 611 + 556 + 722 + 715 + 329 + 389 + 700 + 611 + 883 + 722 + 722 + 552 + 722 + 662 + 556 + 611 + 722 + 722 + 944 + 722 + 722 + 611 + 333 + 278 + 333 + 469 + 500 + 333 + 444 + 500 + 444 + 500 + 444 + 333 + 500 + 500 + 278 + 278 + 500 + 278 + 778 + 500 + 500 + 500 + 500 + 344 + 389 + 278 + 500 + 500 + 722 + 500 + 500 + 444 + 480 + 200 + 480 + 541 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 333 + 500 + 500 + 167 + 500 + 500 + 500 + 500 + 180 + 444 + 500 + 333 + 333 + 556 + 556 + 0 + 500 + 500 + 500 + 250 + 0 + 453 + 350 + 333 + 444 + 444 + 500 + 1000 + 1000 + 0 + 444 + 0 + 333 + 333 + 333 + 333 + 333 + 333 + 333 + 333 + 0 + 333 + 333 + 0 + 333 + 333 + 333 + 1000 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 889 + 0 + 276 + 0 + 0 + 0 + 0 + 611 + 722 + 889 + 310 + 0 + 0 + 0 + 0 + 0 + 667 + 0 + 0 + 0 + 278 + 0 + 0 + 278 + 500 + 722 + 500 + 0 + 0 + 0 + 0 + ] +>> +endobj + +16 0 obj +<< + /LABELFONT 20 0 R +>> +endobj + +17 0 obj +<< + /Ascent 1098 + /CapHeight 1098 + /Descent -281 + /Flags 4 + /FontBBox [ + -168 + -281 + 1030 + 1098 + ] + /FontFile 21 0 R + /FontName /NimbusRomanNo9L-Regu + /ItalicAngle 0 + /StemV 80 + /Type /FontDescriptor +>> +endobj + +18 0 obj +<< + /Length 19 0 R +>> +stream +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo << + /Registry (Adobe) + /Ordering (UCS) + /Supplement 0 +>> def +/CMapName /Adobe-Identity-UCS def +/CMapType 2 def +1 begincodespacerange +<00> +endcodespacerange +100 beginbfchar +<20> <00A0> +<21> <0021> +<22> <0022> +<23> <0023> +<24> <0024> +<25> <0025> +<26> <0026> +<27> <2019> +<28> <0028> +<29> <0029> +<2A> <002A> +<2B> <002B> +<2C> <002C> +<2D> <00AD> +<2E> <002E> +<2F> <002F> +<30> <0030> +<31> <0031> +<32> <0032> +<33> <0033> +<34> <0034> +<35> <0035> +<36> <0036> +<37> <0037> +<38> <0038> +<39> <0039> +<3A> <003A> +<3B> <003B> +<3C> <003C> +<3D> <003D> +<3E> <003E> +<3F> <003F> +<40> <0040> +<41> <0041> +<42> <0042> +<43> <0043> +<44> <0044> +<45> <0045> +<46> <0046> +<47> <0047> +<48> <0048> +<49> <0049> +<4A> <004A> +<4B> <004B> +<4C> <004C> +<4D> <004D> +<4E> <004E> +<4F> <004F> +<50> <0050> +<51> <0051> +<52> <0052> +<53> <0053> +<54> <0054> +<55> <0055> +<56> <0056> +<57> <0057> +<58> <0058> +<59> <0059> +<5A> <005A> +<5B> <005B> +<5C> <005C> +<5D> <005D> +<5E> <005E> +<5F> <005F> +<60> <2018> +<61> <0061> +<62> <0062> +<63> <0063> +<64> <0064> +<65> <0065> +<66> <0066> +<67> <0067> +<68> <0068> +<69> <0069> +<6A> <006A> +<6B> <006B> +<6C> <006C> +<6D> <006D> +<6E> <006E> +<6F> <006F> +<70> <0070> +<71> <0071> +<72> <0072> +<73> <0073> +<74> <0074> +<75> <0075> +<76> <0076> +<77> <0077> +<78> <0078> +<79> <0079> +<7A> <007A> +<7B> <007B> +<7C> <007C> +<7D> <007D> +<7E> <007E> + <00A1> + <00A2> + <00A3> + <2215> + <00A5> +endbfchar +49 beginbfchar + <0192> + <00A7> + <00A4> + <0027> + <201C> + <00AB> + <2039> + <203A> + + + <2013> + <2020> + <2021> + <2219> + <00B6> + <2022> + <201A> + <201E> + <201D> + <00BB> + <2026> + <2030> + <00BF> + <0060> + <00B4> + <02C6> + <02DC> + <02C9> + <02D8> + <02D9> + <00A8> + <02DA> + <00B8> + <02DD> + <02DB> + <02C7> + <2014> + <00C6> + <00AA> + <0141> + <00D8> + <0152> + <00BA> + <00E6> + <0131> + <0142> + <00F8> + <0153> + <00DF> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +endstream +endobj + +19 0 obj +2311 +endobj + +20 0 obj +<< + /BaseFont /Courier-Oblique + /Subtype /Type1 + /Type /Font +>> +endobj + +21 0 obj +<< + /Length1 1346 + /Length2 145230 + /Length3 0 + /Length 22 0 R +>> +stream +%!PS-AdobeFont-1.0: NimbusRomanNo9L-Regu 1.06 +%%Title: NimbusRomanNo9L-Regu +%%CreationDate: Thu Aug 5 23:43:46 2004 +%%Creator: frob +%%DocumentSuppliedResources: font NimbusRomanNo9L-Regu +% Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development; Cyri +% Generated by FontForge 20040703 (http://fontforge.sf.net/) +%%EndComments +FontDirectory/NimbusRomanNo9L-Regu known{/NimbusRomanNo9L-Regu findfont dup/UniqueID known{dup +/UniqueID get 4162059 eq exch/FontType get 1 eq and}{pop false}ifelse +{save true}{false}ifelse}{false}ifelse +11 dict begin +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0 ]readonly def +/FontName /NimbusRomanNo9L-Regu def +/FontBBox {-168 -281 1031 1098 }readonly def +/UniqueID 4162059 def +/PaintType 0 def +/FontInfo 10 dict dup begin + /version (1.06) readonly def + /Notice (Copyright \050URW\051++,Copyright 1999 by \050URW\051++ Design & Development; Cyrillic glyphs added by Valek Filippov \050C\051 2001; Numero, infinity and Omega made by Dmitry 40in \050C\051 2001) readonly def + /FullName (Nimbus Roman No9 L Regular) readonly def + /FamilyName (Nimbus Roman No9 L) readonly def + /Weight (Regular) readonly def + /FSType 0 def + /ItalicAngle 0 def + /isFixedPitch false def + /UnderlinePosition -100 def + /UnderlineThickness 50 def +end readonly def +/Encoding StandardEncoding def +currentdict end +currentfile eexec +o4…>£ö‰à‡Ã¬`0˜šB‰ÆCTà£ÿ&5. + +Svî‹ik úˆœkA¦ ëÙ£¨7ñ¢F`üôƒ$àyJU4ú¢ßÊÀºNLŸõ·^¼§“ +ÈVöÙ.èÐ+´¢Y¼ÂÒÒ4Û³\ºs‰mã'v­Í½=@R3GIJ¯z°ÉvŸô®N1€§ÍŒdð²Õ°¾©f~žð ÷e:^ŒÑ/’:0部Ï(}æÄl^?ô¬ˆ¬–2¾-ª*Йu3KÛ65g*ß Jµ(Ø]»<ßMÓ¶»Áͺï·”D®ŽÖcqÙÀ|ìÿùdyPËâFb°ß+h;p#Š]Ô +Õ#!v'«Ë…ˆÕ:m(Üî^¾ä^¹Û ç ïòô±mzTG´ó9‹~^¥ê@ªs?;†V¤lñ1ë ¢¹`vóQ¦L¼aïÔÒXîìj¶p¤¾¸ô›êÌâ†`Mïÿ `ÔjïýQhì|?M'ÒÑÇUHÑêäçj=¶Î^ý+t‰í½òLÒ©u¿¸ÖŠ$£ÇV´®Z‹ ýÆ8=˜Ýh^I|ùR2Ž‘…š•šiTéMBí"² Ï,0\ ïm`Æ3ßõi6ç\8s'‘kÂ##Dcá{sZû«;B–0–d€±ßi÷aÚûwÿ¯)ÛòÇÀTSSBõ0Cß]G3gª9dò¸gƒ%Êžà[ þÏ;]éµqÍwº¯êª¤{.Õᥠ_ºHˆž{æÌd\RŒUœ“yx5E<ózμ<©üˆìÅ÷ <ÞÉÕWÄ©`:§"b¶AYÜ·ÝqUÇO¥¿+¡—DÏr;Œ«œe‚ÎÕt ’¨Ü(³¶9üÌÃŒppæί`¤™ÑÌ"¯æù¨=²Cð÷¬ÔcÚ¿›UsÙuIµøiä½2$﹚¶»Àz$ÍØl†¥b˜‰Áñ,®õªy:a§C8®yÖåtÕnVfíEWP$ÎuÏÜZÀQlÅ!ê^e¿¬ÂQÇ×äÒ¿¾Š´ªµ][«<Æíh Þë;=‰±¸Z*䀵Y— Ï“ ªårHø þ¼w0;lÞÉý.ðXÜP†Ãú­Ooð)'ÛQ¬R9ag–èù}„bºwvlTkÖ¥*Ì¢Ò÷€³Îó!BuÅ]‹ø×&NXøwG~¨R‚Å_P9*6'õÅ‚fTã™Ð/f¤L©C¢òÉц2ÇÅÿ1aš§qõ¥rýÄ~׈ò:˜±«^¸’º£T+É*/ÓS´ÞOÛ/›VÔÅFçsÚsl­~Øè9½k_%SX¤V3•RC>ÊEpïòº¥ÔÃBãpö{ŠÚ‰âÏàØ#Ùb(¦Ñm)È©Ä̺48Ń/]=MçNEð¥àgÓE.ú+¬ –ëÀéb³(®pp–p9n¦L¢þŽ¼Êt •Dæ3—øÒ÷(WÓ•Ä›­G?ìó5a^…oÇn‰7ÝÎÁSßÚáÃ^c•ÁͶ[Gêcþ-k™yöê…,g»uuy6ì£Çæý‚:ñÌ”S$Ùe¡TOáË‘Å @ü0;7¯ÁŽõFZƒžÎÀ·îÀÞíq®Sš°`ÓîòrÖ÷°ƒu,–²š£!B>á¢Ì„ÎáçÀ¢7c"ñ\·©#´"y½8¥ùK5FyéÙBÄ ¤ŸÆvÁÖ]t]%w¥ÁhÊŸÚdúˆ/­º‡—›m¤³KËk.H‚W ¾I Åüvd߀¥ý 4šæ>ªÌËã!ßÒïn&}¤‘%—•Ñ«;µwCHBbp6ÔB¿¢ÜJ­¹¿ÏæF·bG—¼Ùß^´š¤fšÌ@½Î^ut[”7Ä”“Í5N?>žf£ÚßÃÕ«@ã‚€ QÖ‘# € ›Ø‘ú’ˆÍØ5 +Iè#"Lbûþ:çT­Ì£*fë}tÊËý‚àgxÀ½yW¨ŸGûŸñxVVÀF0ɘévǦ>—;ê 4ò¯ÖwÇÅsž¢ßOüðEó©ÃÌhiåEº¢/17ñ¥±²YY$ãd5x:¥8/); +¨D%Ø¢(צ†Sù¶s¹bø¥ w¹b!“ô«GP7:8Þ<Ü󖯇PÔ¬ÕTîÖ{ÿ½Î“ú|¦Š·<Ê2&ÇäR†Þ‘`°†û?l0T¢é%uNùæ~ +ÓØ-°‰ +P–Ѽ+IEs›´PŒ›7f†’ª&ûµÍÿ8òùؽO]ŠÐèÕž²ÜV}_ˆ2ôR•5‡É:8`”ĺ1îÅÅIŽ^Å8 £‰Rs¹L‰‹˜8¶ÞÏn$û4ÉüWf“î=p.‰ Õz|ÝìçU¸­¤ƒrî½~Hø Ö&žn¤×òãT¹<•å³EÉ“ì‘ÏßoƒmWàô‰ Œ2‹U÷¨_íѨÅÊï>:Yúož;-kGˆû¹p#Ùõçœd¬Ý¢0Že³E£¥Ñv®®0ÎFä!øNì˜]ˆì¹œ ë)Ä€8”êéýó‚ç¬8ìÝzKú•¶ËG¢’7uÉôpž©$ú|kS5vβâŒR*ùÔé±ðÄ°…Ê?’pIѼªúT³Ÿ²£úM6%ט̛ þ´:Q5·*¤ÚÒ¸$ü»ÓHGJ`±Œ1°ÒWîcÌàá¹çm]¸E^ÃCH¦¥\¯Š ?Ó"b±7Z¾zu‡$+ÔLqJèÁ9‚²ôŸvu ·:!¥ô¶§ !–·¹¬cÎa̧gb‘¤›Á²…#~Ýjq­ÿ&2Ѻ+>·4!b$Ú3-Fl§˜'‡±÷{yݩ皟ÇÞSåÆ#\sM|Ÿ›X9©›;wQªÇ¡† iÂ>Ñ„znP¬zò1ôaSÒ`-W̉ fõÞTo¶°¸À õë0ï~gXÆÏ~ÅFÜd(Ùî›™*áI][Æö;ª´êù@»’°ìMÁº‚R‰1ùBös½üZ¬ÈÛÊÎ Ô hÐc`S‘^3|u›¸ædôÖ¨É'©ùûÀQ»®ò$òÜ„µ“4g»x Ò†ƒxßOú½'´O4žþ¾ùI¬–33:Šáº’d÷€‡Ý½JÞ^KÍÞÝdí° $*¥-[P„³p÷7.ˆkó&%„wÂ$RØÝ¥‚çȤ'ÓÑ7NôËñ9­–‰jzìœd·9þ'ÒÞ Y)g)#…£âQÊ@ÛñÿíŒ_ Üå5`O)BÊÑVÕr YoµµçiÞ¾³b»lŸÄ ÍÀŸ½Ž»·F‡‘:<ËÓ9}z.ðg¼Sí‰@cræÜ:p-莭øJåkšÓBŽ#ŠTŠ…bØWrbÀ0hþ;V©Ñ9;ÃÎ8UÀ]=©’ð-p·W‹8{î[LKa½«˜Gíº@;ã&©ù°åü5Fþ¯$‡ +´mZ\ÉZp4ü0e ' f¢®‘¯…(#)B:ÉÅð Y¡±îвAì]rÛ›®ÑNUÁöñ£Ù <ÿL¾NÅÓ¢q±Žõ¯åWrÄ ƒ´¸+Å’¸0±““È{ãQi¢}”ˆÀBú“ }íáÿ*²ÕPª†ÒdΆ"%î^v“`-œøï—<[ª¦_ G¤€èÞ¾ äeÐÇNtœ]Ê%ê&ë9α©­å˜d´]}B‚W üÆlýv—¾æç8Ä—Ct#ÝÝ[ó{Ì·´)§±ãl{#é¿óŸèÖh{‘üUå‘S ésh¡Z3ÆK%æÊs—²Ûè¼±˜Î ¯ÎsWª|Œ¦”ë|fFýÁEäß=åw|±Â¶˜õžŸ¤x¼†HŸ'ÙG^aš––2]bϽ¸Ó÷bÁ*á±;çþþi½¯B´å¶€@3æÃ̾µàuÂT¦ ¦5GîIÔ—4uIwŽ âOÙ6QH0¼ +ÝÒ“i…FÊV¥y9ö7íp}¦ƒ6Û‡þÚÖAίâì¼ÝÓ Çí$*|µ³r A1GW¯ìårY³Ó 9õkËë_Ô¯­£ ’›2Ý*:#­5•Õf+êsÓ0Û=ò÷_1ñ [ú€‡XLMÑB›wŸó³Æu(Œzo_~K°ºúRñÚbCþ*ü:Y7ΊICÈäCÏ´¥uK ¥KW™Õ²–ŽµªÅßÓA´ ¨ü?Ö¯*èP3­\䛿'ß_‹6ƒP ·MÐEéçRHõQ‹­z¾.ÖÄ{7!¾® I¬âk1Ô÷ãëR…:zÙ 1²íGªØBîæœoÖس•RT.D@ÙfŽW›ìO1ž=²MNezŽÝ|]ºlvú¦8`ù‚-Èë´‚1Ö,²ÕßÖÎFŒ+4`TJ"}fŽx¹û´WŒÉ¤º_ú‹ççܦs79µnÜS8kT”:ùsoL8C‹X×v‡:Aãlpå˜É”õ²ã'Ûk•>õš¾7 ïnð +ŽJ;;Ä¥úê#ý _µ‚Bˆ°‰´>.îˆyÀå½Þ oÍ ÷ÆÏ퇜‡·ÜñÙú¨ Í•².B±ÇQ¢” u[²Û¹5G âîqUÎÁ‚rœÚ×”}lô¨¶œwãÓã`½È£r`3dq„×&xwT +ølÄRY+R“‰¤”—fÀÄþÎ}„Hÿ$4pm›æ1<úlÒ4eÕ†ª«¾J#0 ì,øé÷M„³ë^Ö~UÒ +:j`-µ{ k +m"庖Ö/²®x°B‹Fd8©ùÚªû ÅÓD[L€aÃÌ@ñ‰¡È&ïJšRñ’ü“»RîÇ,âŠCuØ`ªMxÌAVl¯àÞ¦QȈèÅòÖ\²Î®›%œµË# }ù‡AÊ5j¯k9†PâÖ‹?u&†[km»…Yý¹|¡d°Ñ†…×á{ïÉXeÚ»H”`›À‚@gdÁS…­¯jÜG(ÑðR‰iÉ”aÌ•ãÔ E3§Ñ%È8w™LæšÞ¥±‹â÷‰¢1:$ wµ´¡ê;$&àOSJ€s÷Þóž)vzO²Ö 2P¢X\`bÈ ææ2_|À Évt^®¿KzBÇ‹>µý:Ó—Mg",{41™ù¡‚‘"8ö½r€Â0t+Ì&É×7ºo"š«#„³±†vcxaË°é4¿ˆ1™kÇN¤#ÓsLŸúøòBXúi’„Ý„qGè`Ö„¨-’(É“C9ìuáIN; ODܪèF‰kõäˆê~SydL½÷&G©õ»ˆ—VÌçɈÅÇÀNTåý@*ÉPz¨¾¯¹ÊY!Fñ©ÛÑ]À@{ËV'ú% +sxôú6÷k®/£¼‰½rU„™Š³ ŽsçmëÔ`Ž æ6pr:Úi—š"!yÐàÓÒ–Ÿ„w±’FTä|`²_<êTÛíE¤˜Úº<ƒ ¸ìîdß°žC;:ûBœj9rÍT¼V\¨¸/ñ=!ï.z÷ƒ +8"ÜcÃÉ»–Á-õ(É^È!Ëž*eÂ8´Ïþ õø*^øÄ'”+>Zâo1EœT©/Ú’ÖNx¿¥¶ ]b¬WP¼ J b ¬0 `ò/ò9²Î¼CÔ·y{|ˆO${–9AÈ£Õ‘*7Í(þ•a¶F‚B—âQÜ¥ýÅÕ–‚€Hô ”Mç½ +×Oãõ´~\EfqÑ·¯ oÛoÒL9 ÆøóXQÙ÷ßCÄ0¿ââËÒS/ílAÓ‡þ\¹¼*‰®® †Óõ7…^IüŽÈQ“æløYü³õF˜¯¤G:E|â±õVTG78{ ï3õŒâ¸ã0ïÕ"7·Šû"g +V3ÀTÜÏÁ/\ÂddAËæDÆV®Þ T³ÞÉ´éâÜK;Öªõ/«rØ-ʈêî Ô±¤®;:þ‰6Tò  +¯$6âà¼Â}¨dúÏŠå©OéÕ/1‡ßÙå¢,÷¾—´Ú¢GÄFì Uqf€0YÆÈ9\°ŸÙdUIg=_>H‘jL6ŸPÈÄ—CcÙ4±}–ÚÌ+ö7ÍLæÖå +Ê‚ÀÃ>@<ü‘nzFUàô+š:©ÆÐ_ókÞ¿ðía|j”ÚGAe%úWÃêÌÓC^ž»Ô!Q>]¯R6Ùø áeÐàfõîßaýôàimÆÉœ:Œñ±_6.GZ€¯Þþ£Ë79Ùÿ­¦ºAf—ÞØwÇ?C›! 0‰4«‚ƒ‚,øRàÿÁiÉ+$…ÿ ÅMIA,p¼ôÕ˼~VÓ]‚Ç×-´<†5(Ûrñ˜›»÷ÇÛUo‚gÚÉhðTxm¼îdþ‹:ïu\equµeÒ´¢Q$`¡Å <­ó‡¸Çípï(ÓW„Ì.¸3Ë'ØS€Ü·® »nÔ”úXï˜^…q Xà7­4ÜÓÙQíÝè¥r•àø§Æ‹¥G?~ýÍ3üB±O$ïíGÒS·û{€À쉗… £qäuC™0ÑhÖÓ\´&¿‹`û•¢ÍÉ6AQе°˜‹µ“½í£×A}Rš0ì3Ì +öÏCêǸR¦Gr…ÍßzÙú%‹Q+˜p…´?‹æ£)—;F%œ8€0*­+gÖ‚@ŸŒÁ³ûÜ}G­æ5y»`tì‹ú)qíÂ#¼«¦ÜM¿r}z¼xádô¿â¸š>gPsÀh 1¨Ï rAé Dª +’AÐFƳƒ÷H‰Ãt^Ý÷ ›j&:€mVO¿oµÈªÜ)Œ³×7É—QSFûõVÐ=¶#?Þm ‡Ü#!x ~ù f£÷l›m¡‰@XôyuXÍN¶`éâÈyÓܽkºgÞGƒ¦9¦Ú‘éÐÒ uùS<–stÍ:tñ_ÒšGž÷[!š—?Mi 1èöâ~œLîzJ[9)÷Mªï¯ÕÈ„IµÃ7”˜ÁKXŒàÞ‰¾åçCä¼u(r`®  m)¬©BDyáBóÞUöµ’ÊeòÛ5¬Ý:Ý‘r\2@¡ 1( Zó]Ø’¾õ½Rpü€šÜ.EÝ;ðô±D†Ä‘òü fÿq§¥hͦæ›=‰Ô›æ—áÇp>1#X \.~~‘Ao~•ª—Æ9uÛ¢¥ÊZ³¸²±•é?K6:vÍ?Ö/yRíÛ©¹}t¢‘ ¤*ÞT–e»o·-½šµ"À2?;ãrŠ}& oÅ£6r8®B^¾ìuôƒ-Ågø×òÆþ> x¬…Ý`®JÌÁA™ÍÙæ¯z™¯¥s˜«•iòy´nÀö:ìüàæ;âq!ÉÒUÒ~ê×ý®~rbdATÎUlŹUÛètó_óÆ'@<¿i.È àUþÄWk~­:xØ`Ti©çÚ¹w¥àͱg„Q +ÎIÌC†/¨Ê¢+›q;l=‘Ö<èãŒó?ÅÕ’%Çú¼M÷‡ò|<ÙyŸuÌ.8ÁÔ,yæRÿa›1qµæEÜJSë%¦ "¥ƒ¢ý×0³q°”™s¡Â¯D=»Ãc…¯\'"Wù£ÎÈo¾htp(ÏMcÍs`º-hŠ0nÏÇ¿„þIñ⌲Ûl†ù0×YG…û€wíåöŽ•¿%Á'ßòä@rÛ5èMúC41×v]y윊OèàÃrÏ[}#¬ˆO}¨7H¾=YÝÌIÄa‰¦¨ï`Ÿ 8Â,ª}Ã2['Ø,­ ÕJ60°ì¾[æá7=ÈÀTT‹¿Ö‡ëm rűX¤ )Žƒý±Y,âþàM’‰–8À?pû€Ÿæïú'ÊŒŸ1;FEØ1—~̘±ÃøAÐ87ôQXþ¾O7·d‘Fcºß+·˜}G˜Ë_CÚíXWÑ|µ–Š8M:8‡V½;¥ñÿ^CKÓÐ="wuCÂqâ#?´z•J<]!¾ïý¦ð·œéx¬Žf€¼Üà=̲)ÄFxN4¤ñüÚåÆLÚѱ脖:Žùÿ©–9vÊÐF=úA+Y7¿CháœY/%U±¨7D(t²_˜"ZârLõ$ßÓHAAbŽ½ÉÝÙts݇,?‚ÌÎ:%ížr;Vºx åÞ%ú½„9ýŒ" ¸ˆæ2 +B,p%ЀDý§àmàÌ¢…]z5uTzŠÓ3Eû3h 4™ð¬9º²„MYfå~]â2KÕö#Å—òÙôû‡Ø‰^ o–S“–­¨/Væ¼›mkbpó¼.¨l@à4ÿªñc_•1þÉ“/ÅY@Àðn‰çÆ´ˆÔ{t½4Ò +§@˜¼BâÓ? ‹žù7Ò¿§å‚°Pè ç8±c©wÙ¶R=‚í>pomƒ Ó|6fWáùÑ6$Q˜"AšœŽ¾3 +Ú»­_EÙjè“[²•U ~ydæ†ûž€bÑ»{Lõvòvß'î³2X²f–‰Ò‚ÁnSâ_~¸¦g†o‰3‹û7{|ó›ýÂI[¤uØL0ÈncüÝ$Z0Z9$óŒAÌsÁÉöh“ºŽãa¡à™½o["´òÉHl[¿ùŽóÈÊò$U‹ÐÂýÄŸ”á0üžð´\àžòp=bô )÷àh|àiÛœzN ý4n`Ïn²;Àõ6(ãTËЀaóUUål+Küd¼ÏjJ3(I=»b>òèæô.yEÞè:B›V;þŒ¦sÌX´Æ¢4DÂ7µ<¦[…÷­d!þYæÿlg÷²ZùŽ©ç–\N¾qslúsù‘jm‰ý‘³8ÿ›ƒ7–o×Ûi†zÔJDñn¥hkÌ©^ºy·E+‹`ö…ˆÇ™.Q5 ñ¢$ÇQÐüTÖ€j œ#›po]L]WûÑ23f\"W/÷u…ô¡¦llO)Ÿ’‘¿+§Ô›´ïké–Åé„ûwCµ÷>ߪlq²‡ …Çj”…êÄpnQ3\AþÒê¦ú˜)\Í«Š¬@‰_ñlÞÆâ;þ¿W,í+¥¢Ž¸Ö´ºXPjô­Óç{þ*ðÈñ)ÔŒ’&‰ÿ¤ ÜND0üÃ~BU“>ÑÙî¿ÛÉáÝçħvK)§QDç¿%Âh4Ò /¥9 *¥Õ7¥ž¢ÝzÓËl Çðí­µ=t&[ŸMV ýÜÁŠ¸PÔ([¢EÀ+&kΞÄíƒ ‘A*ßÖ>@rOgù.|s…´·Ž‚¯.T¡çzÁÇE¶ï´gxd¼m¢?³è¾bûäµAWÉ?‰ÕÝ¿ú¨LQw«“lhK$·sB#_“1´±[»ó`®Õ/,MË–âSÐ+Ò·¯¨ÀÒH“×uNÉ;Ù‰§7ÄJ( I¶VçVhC”v´r¾¤ÿz»ÿ*ý®»'Õ§åDk1;É®+½"îš@n§¬>ŽªQa÷›©»îú=È~°_nÍÔgòέˆq9*sP}r~‰Œ×ëøgšÝ³Îí¶àuÎ}v6k[(£›Ræ®BÚÍŸÃ? ³¾ò¬:¿l³ÐI·¥„êPt«¦œƒ(Íú8Ð ÚÄ.ÿmiýUÜ.kN¢˜íf0!<#5ìÒžUjƒ-^ÀFãuè“_Ú‰1œ W~#N¼ çPz AÝYk¦MªdÇ-rˆOM:õG’$ïOÝÚ>¡¤4÷M'K¦*Ö¹­Öü_/4ÓEù{D£`q§*mÕUP]ÆÞúáä%A2.ŽpY)±%|ŠïÂvã¥R3¸È@jd„âÒ]ƒÁÛ1o]±’rîŽã8~„M)M¡Ê5Ægvf½ âRà^ž®-·0t^ÙŠA^¤¾ˆ%?ãj‹‚!~¢q¿=“ú7ˆ™6ø#ШÞù[LÊ‚@ßÝ€ · êa£ÄÎÄ13C2îã6Ö +OŠ?oóWÏÊ÷?•÷'úqïBq¡Áµ­‚ç÷„à˜–eí—mãa½we¯@Ô† ¾ˆ +ûDóßý”•ê}MQ¨ìÝä¿°8®–0‘Ï\ªôf3R(|L{ãKùrFp`TÙÛÆ&(¢J/Ãk )NÔˆVÉXw²çTaÒ‰ fÄy‰J¹i·x­ I/%Ínt_2”ß–êÕó×kTÄ/^J´rð6ÓTcwÉ©¾Ü¹äÎ@t‰?‹yî^ïEÃHoo¸Bž,ïëÎçXŸÈæÔ¨·—œNvÙ³)ã+(]½±”bÓU!ì88*îAGΟ;P ø’.<»Õ_ÍcL vä°hgãʧ™ÁåaƒÖ&ˆ=] +Òj湆ô³¤oòiª·.¼R#6!0騱®ÊÖ n{’@W´ÕùýAjÖ¢=H¥Ì\Ÿhpñ‘;íaá»»3`v_êÚŽïR1â¬1V×1¬ê¦I <ºÈ#zH€CAHGÿ'ÂuŒZƒ’ð¯ü< +µS‚EòÍóëÔÒ=\Žî)šdU2™ ¾Ü¨䔜º7ë <×CxžCR:œUQfÀ3»ÇäH¶ãYK……¯îè·Ñ¹Ì6„Á&\‘ +ò—Íî=©§Ä’n_Y\­õW,üäx– s~¿lÏÂî¯Iy‹—Ö+³=r‘0òÖM¶xÜ`p> (dLÓÿŠª kiÇð†ù&ºVÂUó8˜¤¢`P•g*÷Q„AFÇÚ¦Ý]y‚›Ìg¨é)iji¹ŠŽá)nïÄÌ!º‰aåhz«b3ˆ,‘å3’=?Ò ©òçËMRVç*6ýßšâb6¬ýêh¸'Æ¥‘ªö¾º$Ó7„xâ ¥Üw›Dç –#h÷ÁV‰ÍD1‡ÿ#O£…ÃÅÕŽ ¿üªæŒ*ÛZ\<ʨ6è²Ö% +‘D í´Þ)ª^×úhX)¤{ätFNiÐPðM-\|1îQ]n3G’®ÂÅp t“È…›}`-¼!*õ²º­ÎužÙ«¼ì’{Û/÷Æçå°&ÐxíÚQyr{Tº¼ÉWÏÐG^µÀ·©PÄ ‰*¨,‡gÙÌ’t‘BUeöÖöCÝo„Ú¹cõ!1F‡”lŠçFø,ÅÝ’óõoƒî®°vR>À2)H¦–¥ºÐ­äl¤KìrvX𳧅ñ¢ØFáòmvR*o ¨«¾B{{&'ö:!rÖÐ ª:í_–D”z“j9.ÕMãÆFÆÛÜŽ+Ù3†ÂTμô˜ìàÚ¿F*¾àgâÞm»:ÍnÅf’ØÃ]¶OÑã¹f…ãé +ãœÙô•'¬¿\õp¢MydÂŒKé{Rp1ªÏÚ½ÝÌÐ::q8°K¿ ùdy¯»Ù6ÎY³mÇWVþÌjG]î#C÷Üâ?FZüªŽ¨f’dE9•UX';î3ºî ˜¹µí©+àïpœ{­¿]bZú)’½¯´31ß a F?•¨¬Õ`Jæ£ɹu«]-…S|Ák|$ùÅî©õiñâ åzUoÑ[Tk¢£Jq71±r¿g+KùtÏ"ó@Ù‡×Ã2A3¦9ÂÔíÜ 8þ` qO](ÚƒW[SúõÆã}Ÿ n27UwÙN)Î.Ý$y½¸¢Žwóë—$skÎ)§u©¦~w/ƒ›aM‰iä]a¢“Øäf9H‡I¿Í2 Vk–Ò¤Y&VõX@„³6U*°ªf§Œ#O¢àu¹þèù§ÜX¨?¼©‘KÙæQŽhçýϻ¿p­À”ÖÉè 4õå\ý™·äЩzªég Pz’7Êÿrsë¸l"#ðK™QïÁ{.!È/q6d“¯Ó*Ñ›A1¢‘y5ù»‹b'׉eÉOàEfÙ@2Í‹Þ u;F•µµS¯è¿¡žß=¿>§Žf‚Hã]Q+[–|Ú…bÄÜ=ˬ|¹U#×’b²l&P†@ŽSÁK“Йu[%©#Ë€æÐí;åÕ†ýQ5ñ*Mò ­Uª;.ø—Ž„„^=rÕëÞǹBÈ—òn° ¶Çgœ$l®O¯±‘ :ŸKßö‚ZŸ#Ó—ÂÐw}ߥ8ü›Bù>JÛ±¨ü¡È›³ò¬/cQßÆPkro‹®1Y¯΃¸÷”Ô¨_ý!Ñp5^%4Õð•*²-¤Òß)v-èE¶Ú˾T½þVRÿžÕðÒë·M ´Ì‹@ÚNüuGv‡S= +q5]AŸY«Û\a⼎1Y:T¬ùn\‘Î#PÅîIðÁ=YÃq½öPçxû\.ß”V˜úÁgEù‚ÈÌNÛØñ)Ù…¡?4ÄâªÏà’*<Õ×ß4um›[–5`²×¦üs¶À²yØ–ôæ‡bw¦Hý +ž×ñÝéÓ°Žµr²¹x%ôAüm9Œà_Õ~HƒoÇaËT¸°êÓÁÚ›!N A%ѹ 4Øâ! Œ¼>ÃEÁšÜkãýU‘qµZÏÉXdÈé¼¥,{žSÙDèƒÑ¼^`ÍËO±7w(Cã2ŽB}¹M1û§ì<ÝO7´db¢*ZíU8Ô`ÓÜ‹¾ñ~íýÎEPÒã0âŽÜËNÕÎ~À@p¼ +Áòµˆ»Èó Vˆ º/寿Hü„?VfY„CÜ? §B]«W1 ¼Þj¬ð, +ûo³.ü5ÂUsj”‡m¤lQ³êÅèb¿Í CTky¨u3Öºö±Üùl-/n¨†ÔøðvÜíL¥@‚ K΄mÙûQºí8D¸ÙZŸdÚ¹¤kÕsß(R`_Öx©‚Ý£%ÔÓK0Ê/ÌF«ÔAŒ¡?Í7‰»@I§fÙÈZ ø}¬@‚SŸ»Ø\à¿@ô‚ÌS„ZQ®Î„éM‹F=;-¤/só4¢ÚÈd_È9¢v^æíØ@³À¦s’%gÊç%Zó$·¬¼0ö±`ùÇš‡êWë¸õCk¸¨8w… /Uné +›JÇ]ý#€Jδښ€[•Í8ÌCÃTûKrT”0¥q›´ðî½WîãÉžâÑÒIý½,e )¨¤Ð…Cªÿtó†\½ó¸ž³u8£ºØgºaTˆBƒtÄÏŸÑXhí ¯(Ü*Òü¿,ÜPüìK]cÒ7mL!zzË<˜+®Að9>Çåu¹Ëmð¼ï ¬ +àÒ”Ó…-hrn€MågÛÓJÅé¬9hYþí r€@ùYἜ>f»”¥ë +vlhœT_Ý#â,°%Õ|lxóAÀTl½çóqæ»”XÜmš…βz|j}oÆC›œv6˜øŸó[žc$ÕJ¬û"ìaï}Ùt›U^ØÈèÙ§ãEÐX™ ‚ÜÖ6ÉÄÒþwî°¶¨}eõmB†%µ,n§Qû³TâÔ¹ÔLœ’÷A¢Î#p}7Í Šˆ«’ ˜˜å!áDÓ/ò1¥`˜Tç…ðûIi¦nþÖ'Ó2\ØþÄï’¦*î½ûñ{;žÌ Þ·õÑíÖƒBÔêx@9÷S/.›¬KůD’±jùàŒZjÒ‘ÊØ¡‹„ü±úƒÎ¹ÅÀ&^1Š¨LÂÕáçz²h-ö6eARw0)fRq€‡’ý¶dš¢7>tÍ(â…I&—¹c³ä̪‘þ¤ì)ñÜ(ÖàÇk††™ íÒê!Z¨ªµ±Ö™q[c×¹áXðçA–Ï%«)…]ûŸªÜ1x;TRa¾þ^°q${¢« RÌ°¡Ø¥¨ÄHž#œãOÀ«1™dø9·)É)OV ]Z¬*$âãzÅóÖ@dW›Á¼#&*8F¨”¼Ù÷Œ‡¯}ÕYÂ7½OÙUGõm +¹A"£KDÃ%’ºµÇ•(A,u«ÁŠs± ÛÅŒUiz«ò^9¬|¡k£IJN€ÿMí²"®½ï‹¥V“&iÖ"@ÜDf B¨5S¬¸O½;#ü•Åð–_’ &W{ûá1¼…¹õõk.ªQúãëp½ÂqU‘‰÷v{Ô]¯EêÿÁ0Ûek“=uçÀÀå„•ŒƒNªÊ‚Éùæ nÉPë÷} ev2´†ÑüF±þÝG$;?S$ÞMÛ¬<”Ñáó“G°‘´k ¯b˜z9Åó?».q-ï_ö¤{…^µFÔà«aò)µÌç„æ‰^gLM4æÛd]Ðì2;P-¸‡ +JÕˆ¦IÚÝÕžzñ ÈÞë¯ß z+7FŽd#àB½êÅí¢ûiüé^í¾ëËA© 0ÅØL¤£6OÛ5ª Ûšja Xªo(-áÆü—c{7íUäÖYòè¦WLuꤩtuÿ›åm×Bt °T‡È°n1àWcà³äR€²\Ö-ÜÈ|‰?ìâ1‚5«½Þzmây—Oœ~kZzäðt‚ +Ü ìà +WÞÒã&tøÐè$ÎFnýûÒ½‚±·³Ë׸‚ùmËï”ÊÉÁÔ­©1ШlS{°dþýÛ¸¾U¨YÜ +MòIÈáÒ˜ÛÞ”ÔAå;>ßg7Âä*÷]{ 9îF&ùtYu+íI+¸}ÛÈ@D_7žnéÉ.¯£ïZŒ¿·Þœ Å_;Lò} ^|¹ +ß0ô¦ÀãŽÛ9ÚEZ#‹»‰h}ÅbÙð€˜ÿm05Ñ*\1»âŒ¥@±Ö¼—§ßVû³Œˆ¶k›ÌòZÙ`¶ðç6à¿C1ŠÈsèâëwÂù~à*Ùp´Þã%{íñ‡t V¯u;ûwP“>-_¦ýCãW4(.…k¢ÇþUì4!ñmÐ>¨ovòÎI}Êéa˜õœÒ#cã2°t`?çÔ‡ÞÀE›¹t¦ä%ðÉ_°oÓ:n½RµYAɾ¸rÂ@&ÍÌŒØ$ä¼aÉ:{AÊÎß&ë®*•y }NôBù‚Q€SêÞ=q«U•»[Á”ŸŽsn¬c¢%&8äLáª0æu 0ׯj¿WÞªtÝÂŒ„ ~< ­DºEÅ€5ï»°0¬Ù÷Ù@Î%Cå#ÍfçÃ*)p³ñŸ´`‚ p”µñÙô ùèïßøL Œ+ßë ØJ"rpÑ?öyÆáÏvŸŽyp±óc¹èË_á†{|%f ÓûuZúž§±UûD0 •O1Ø°L0íœ Û´ ®À¯ 4ÒÇOMÈM)¢íÑ}áPúÆ_Û«cÊ;j™>®x{+u ÏëD䩦3hÁÔžsaÚXûÂošò2¾R#0ÅÁ >ã1<ýùø4‘‹ô­Qf°«F¼õê|¦IN$i.†@ )ÀB4®b^ðü\‹;©–. wíFT5cŒ’Yîôã6Üùð„D |+⩾ۓK‰ÉÂÅÿøݯÑU3’ÐiظH´\L˜7‹ #eŒäùT?jëžj5Rv¢v¨ ólðÑçAlö‡€zlþ!Žê—Ó–îW/‰»¥.‰óh+,ÜÐœ¨âöTSòDÊò'·”0¡è«EIcϳ‹L¸5É;üã[êŽß%Ni—óÛŒÍÞE±j9¶®ë¬]‰±ì0ÛÓ'¶L(­{š<<žøÄe +ê0:Θs„"»ƒö\ +ß$o éDÙšb°¡ñL[ˆÑx4±¥D±/“t’\k)ÔCµó?ðl¢ µd'5¸Öß ‹˜Ä•&IBo½Fû´D>†­¯èجå©]é+mžÔÐV/gÊJ,zëuIt‘^\Â:0ûNß,ýT ö%Ü`8ýñ¢bôÏÄCŠG•Í—û*œ(²–èÄÅl¢îA‘7™™÷yåä‡-ô +`³’m=)žŸõ² +&ÅÌÄ«cDsÈ£šÓ€ØԦȉ ׇ}ãÁÄ]¸oQ^J4P Ðßr¶Ö1Òt am½j”‚ßEŠöd\FH×jt!v%à¤ÈY=ép²Èƒþ`ó-“ï¯ïa¿ý™<¤ÉåŠÂ +¸y€;_NF`ç6Ù‡îýF˜–G‚…1†}ÀYæv=CA­¦¦óUp³6·¾„1gtvªàL:昃6/‚§7»5u¤'ï\ÖéaõxÔ/º@¤Ÿ[ŠÆ—ti„?>Z˜êaG. +OëóØÒŃ˜.¡–Î,É‚QëUH…>Ñ-ÖÁ½6$£svŸ.ÝV‹>œx¶ÅRGÄûçTh:Re¶ô!?ýxˆ!±L#Å¿<YCîM`’넨tmº½È@ÄÑkÛÑ~ JÂm¼+Îò + ‹üG +µ*2Ãõ§ YvÓ‹é+çéÕê¦Í^.žr5ç÷Æ3(N'¿x뙨è #èåŠw,4—N'_#>¶¿>§*†­ä‰ù,• PôM0%ÐEe}G\”]ûž¢ÊÅöÍ›4öÐI´ãX¾oÎä’ÀÐ3±!KÝè±|$Ú§ +Õ°RñX‰6Ç»0í‰3@skO»HßæŽVîB÷þÈí#«Zaˆ9A8ð41‹”~Z^gïA¸3oã—)üé±<¨®y§Û—qe$Ñê,W»MÜêáœ@~8ºñ8”)mºVËiM'V`V4{ú3mK^žƒ- +“Ö.Êwj*t¢M‡eö®NMI¢ë|Í”}Ø*ü'`š¢|=xDϳí@–´÷OŽÂO–Ëik±P9W¹Ëò1àLåR#GË÷¼™ a—E9i•Ÿ,Ð~°dú + +Ä% )C¹fƒ.AF´‚±¯eÀ…Šw{ÕhV“²iÈZ'Cê‘M}﵃êÖƒ.[¾óS:ŠÙ·Y­_3©ÙUÎÕYäˆèø›»Ñ_ž/Ý«*4+ã,FIwœ¯ßoF¢Ù«þ|Û^å±òhrÉ|¾ÄM›Kz< +E({¯Èñ‚×Í"‰µ|ýlÿÁóp!2ö»sÊI åËØzeX‘ƒ¼‚ΖÃGh:¦^ÊóIeÓ½¡œîè$SLÁ‰úºS`¹‚~nÄDHH+\°2Îíá­2êÕŸK>³õ »£+ž¶ã<¡SëqÆæë_F3œölsò\hfßà)Nb>èewÆfþ)¦âª+ÙRñ Ç)ªõ³;© €´ Þ]qZÞoà 4ÐwäîíPÀD8¥óQÎrqý‰Û£Em…Sê¨TgHê0ÁÄþU\–‹-ÄŽz0ÞEl + ù_óA-CDÍ*µ°æIå”I }·ïy½×Ì–ú’ÒV5¹í|x=8*$ßIÁà ,^mŸ;ØOy¿·†'ýþIÆ,•3oÀ`%’´Æ°r ЕMTƒãÎiÈEN]  †GMÕÂÔxÛ* ž±º üjÁ+z²îóî–ʵÑ“Æ]¸ÇÕBð©øWw!9aE•þLÉq¾øÔ½ti€Š+ü7šH¡ +7.“ôª´BɦaapÅ\ãZ°ÀZÖÐdCï6Zðfö¸z+ãæPCw—‚ŽàgÙо1cE äLöa’ƒÚmZw°Ä8!ðDG×âã(a‘öÄd=âpR÷ø—Q½&‘VÐ:Ö ™WdõìµéÇœÊ)ÓyL^Ñ”Å%]ÚV¶fÚ½ ˜æQOŒèËg¼wÿ›<Àà­Ë0Ù , ™ ¸Æûø²¨M\Ã+TE±¥:§ .™bŠêÑŽƒƒ2¬}¦Ýzí*³&[­BCÉÔîË®a×êt™jƒ—ù3ùL[Tmý¹ÿ±öä>g”±’ +a6ÖáTw@H*ž¤cz,vÚdºl¸–0„ˆáÒ!Ñ´ôŠ„¡cÏì,áC—ÇÜXà}”±xç)»C*À•Ògv2nÎ(h 8†zñXôüU4§šrñÒú‚Çúù+Þtf>•#.¥êÄfç2– TŒÐuËÖÝÝ» òCÒÚ2rœðûßolâ+0ÛU æ ¹êghÅw5­¼ñZ+ ÐLÐ-`†3‚*wí©g(¸äÜ©øÑ£Uc ßög > +AÑ´¶þi†Ö4UÖnm1q•,yÆ5Šb)‹ ßvÊ]?(fÂgûT‚ç …ÑO ?†Ù1G"Iˆ¢cíŠ2ŠN{M@ì¼4n<!M[}°¤`s +«¶31& ^òG]³œ–ãŠua<†ñ*˜vNtœTsC"öÌ;›0)šô“,„¿7}#ÊPH*ã¯%)2$àÔ)޼ū:*9ã8yÐXhå1Cr%Ý«ßþ•®Ùñ̳‰ª¸O¹3ãÇÄ,[åtʉFÉeÚDz·n… ÿÕ[wÅ¢­,Ú°yQðáõ)Gž^«Ü”úŸ“¶úݧ`ƒõŠÇ´±¾áu€•Z¦}Õø–ô¼=–€ƒ8Uif¥ºÜÐ5S¥–Se6XAÈõÞ¡ð‹ZTÜZuÚõ¬\+“pIL¸šS°Ÿm°Ú^þZ]©$Ì¿ƒè¶ ùêmµ=æöÚÓ=N¦ ™ôͧû,Õ´‹™Ü*JJ¡0ÆʶH[–š)…åùP_ZõÎhÔuè„gÏÒŠ··îÒà²ç™”¤°øçq<&˨ܴ±¹ aôcˆA†1RmÍÉ(vî†<¹M~„Ê íK[²süYÜ –V|(HÉí jß–T‚ÖûÔ· ™#”ý6ƆÑÙ™ÅD½1ø êèÔÅ-˜àÁÓ V^†øc.Kj´fÒHØ"ñVeùvÔÇê/¦Á‰%gÊHÝ´¡a@ØhöÖG@L”;Û%±¹UØ6kïØ‘ƒO‘ãרˆ12ÇI‚³e²4eCü.w—™$ÊxÄúe#T™NÔ +kf¥BÞ¿ÎÞ©´V·Hx-aDpJÓ(‡Ðxç÷Ü×ß4#ép>’;0 (fa ½ò¶RIMŒwë[ªª~YP®QlUçBõ˜±`¶¨ü5¸†³˜"•]ï縵9ˆêm—æ9†Š¿ ¡Ç"1ðÄè^$eË,Èú gÀãQs} M’ÓíúH ! >P˜ï¾S>ΚôÙ‰åIÒ»= ·‘fšÛÎX;=ˆžï߸ão4âð c<ÕY`B3¿Åú×:_€^úH౤Ps±ÖFTPyøn€è¨Ëûøû•d÷Ní· `h›f¬Þ˯A‹ëݸÖAÔ\$íP¿qÓ´ +ÒbXxÖ¨Ÿ–\ô*ª™KIÊ5hžÛ2^Oçï&+w1H¢:L0›cYE(€ñ|mæ!SLZV´2Åñ!Ic#qvÇàDÃ%–€ñ‰x*X/_Éy®Ë·Ä +Ea˜È·A…aa{uŸ#Ì£!%š­X­¿[ÿ1=¿"{¥²ÊÆ÷*w\ŠiXª†€í£s'äè8ǵ-!‹F5¸þ{ þ—&0<òÑ´¯Ò6hs§þõö@xt”ŠµÁÕÆâgŘ07»nžÀ…·ãÄ—²ÚõsÞµH‰S4ÍQo½ƒßv‹°ÝžÙÆùv¾õŽ! ‡Sý˜•׺ÞØ·o“fŸé2`Á¯l®ç ó¥~¦¸N· ÕÚ£@jœXkNgA1%7ñ²×vÍœ 6~ZXÔÁ¨a§ÝyùÜÏ*'KŒA¥ÖfFL—",ha“óŽmz¬H†z%i¢ñ¶X>I€}.;Ñ„2KŠ%-爠¹f¶¹¦/ d_¿`Û˜¡~wDÜU˶0²ƒ6¥T<GNR'Bˆ:±2íÕoÑ2ü“Tù`:,}u|'ýa«]Çï’©W¥âßë$³hðÚ§þt÷…œôª5Wø2ÞÈ€J ûãL¥9äP¢}4¼+se'ZBS¤Mm[l@Ó$=bb̾T5?6ôà«#5ÑÄÕI"8ˆbûK×ܲ½xQ+|šå.ÝÝiahwm?sZ}Ò¶þ‡ @û ý“Cí$æÂãdY»ÝTñ™T:ªêȸ(GÏT)¯©Œ…½|7z5m +°¯Þ‚Kt4:,“¶EïÒl…®ˆ«|lFêwÂøb¼+È+æš­[ö+ƒ¦W¯gnHeñã+#‰t=XîŒ-œñó/•ñ}7—JMú7”bàÙ'!"Îc Qq—`Âpî|ÐtõÌÐs;pŽ¾x! }ß@x,s3·õKÕu»ÍɶþhhµîèI;3Ük”ÇkF,4"pêÆê@5Ö†­˜˜S?L[xbÇÔxUüµ[ÔÁxûº o·ê¼{®a¥M0ÈËŸ[š›š«¾¥ˆD,:voíJ <ضbY –0Çé +ì÷ijP‚,«ÖiUœ÷š'ü8e¿b‘7^(‹AèT«ª‘‘Ô}ö¢n1ò9¾ˆ•oˆNë!’f)pK¼…ÖÚ\÷ÔïºIÔyg{Ô“øB¯U#0‘9¸ÛL'&W³gF$Ó¡ÒJŽ8©@«î¾w42 $µ°–ýpŸÒšÆykójÃN°…è0ì¹Äo7~Èî3;èp.'®£â Ÿï¨sšëÐ +s+#N|zÀQÊÍ€'ñ9^™Õp.·}zŽÀJ¶‹R LyªOÅéáªÅˆÓ†t½}.”ƒÜ ·kz§Ae;¬Írš“ÐÒ^ß@G»gÓ}ðQu–Tf‹ÙyÐá‹÷‚‘µ +—&xf¤Ç¹ð ?I’˜ºsµÕÏ¡R¦ž5„$ô ss©¯(?Þž’ž çN HÀÙ‡ÓåAaÐoïÕRMìãFs½v1æ^çÛcèB©#!Ž>Ôë²= Uë€@~Ìeª®?Q[„/×fQM/ˆó®Ù G\¡ïlð´ÇÑ}!U_˜ÕÎÖHk)+4$AZn%†(ã[ê¿/¦º ÂòæÞŽKâ2ñ‹ÜÖùèÞ:–Ë\C!‘¾Ìh7š9£í˜°É¿¸5ðñ¯©ïëÉ™sÕWQÒ­OêLàlÝàÿ0€W’ÇújP¸¸]_z:Øïr½©ï‰ê7MB+ý®Ä’$ ÿt¢ëßÚ|M8,ÕÉŽC}‡V’¡ q¤éxlz~œÚ†³Xï4êŽSšO 6W2s9‘#¸‘)á>iê|ŒVPIè‚FKÎÄ–쎢èx¾’»¤ÿ< bÔÞ}ÊÂF<®άmÀß¼êjH>vïð"~v‰½¨?²õ:ÙSš5àÜeuäísFiÛe÷/£_ŸNëC3~ÿ+w¾KºZè«Š‡™sbÉ>HÊCº³àÔ¼Ú$B0*:dx¶†d¸à÷Œ Ð*âÌÅ…Á‹ÆQÌ—fK0(©Þímr'†U‰ÁnUÕïÆmz‹í`D É€Ë@ÎÿÞ$‹6H¼lfkš âz·ìqâÈ#Ý3‰WŸóD m¦î‹»TònP½p>_½Ê¿ÖÔÀª’#sgÁå(N™s‘WjÕšx7¯1Oøv«4'›Ç&ãêC¹ÉÏÛ“¼$97J4.uteºlßæ,<§§¤K]YloÓÈ8Å+w[–ôŸ^ÿäø¨ã#G~EýÏ:žviÅ—ÚÌv”ú‘Òœ»CzǺWôPÄF¥#LA~³Y´à”ñ°a{:‚G¯0Érç༕fÜfRÌXlžy!÷}3øÓ\,Ãï[ziÒ›Ç+„"3Ä2~]¥ d›€ ¬µ'šC +ùÇ¢kàÆIäþÎvo«ùLi¦t¾›ýEÇŸe“Iãl|áÈ>bS…ãŠpBa÷¡ú«*—“"A ÁÑ‚¿c¯ @ÿ®# ï²N 4énßç×4ÚˆT°¦-Ï‘ß<¡7œ7§4À„=žW.æ+PæË+7õê…c¨æM” :Õº·é^K«©>€»Þ5’Õýn}Äk{ûJ9|t·ÅÂWœW{mo­—rð%áÞ,­¨|"sï|Ø o‰ÞöIs\,@Ìã'úîb,G4¡â7 ´K'?¿#²{>4·RyWO GÔîÉàU3z¬äFî[ê|ëu½‡ìŽ,f+/ÏøVÚà% è* ¨™ªW™„Ù³—_ª‹¡Ù\û“ÏkC’ù‹µÕ~,àÆ3ø{1AÙQ_Ì5¦°ƒðe‹áΠY`ˆ^=Nxƹ4L6g…¥3‘´ŒÙÝü K¢2V©8@¯ž@¦ë±G8»Š¥Wà‰›Ñ›ª»ÜºÚ£˜#ö¯­”úˆ=#Þ˦Õ3é`zAeM·˜áãv`8ÁP·%[˜rNèv¶$)þ$9"aÅ£„)ä›se©Éž±^éÔ½Ñß2Ðx¹Rï‘žA{p†%ÐþÅLþÏJáe=ó ¸Šq‚€ßq´‡jMÔÐñÈtwâ>È[*{!D\c+iRG:_„ ²pï#â¤÷øWp "(² ¤Æê,ĸ±žoÈã‚o:ˆåk‹Ö¼eyˆo Å«ÿˆ¨ÈIá¢ò©ˆ]‡ +¨ 2£öÇ2ø(UqÈ/äéK úµr>g +Þ3¤¨¡6‘«Nç9¦ûÏ–mqœ÷r•â"ò*¸½¸”¬KàÚ¡KìåÆTv²àïÒ³»ÝMŸ +|®ŽˆK{~ÝB€Ô·$CUUvÅÿ)k. uÚÀ!z7‹\ì‰L8‰)‹]:L,Û Þ¶2e†!íå"d´BI×Äâ pð <¤^îBMîBÏ£¿¾EŒ”r߆ö±è7 B)ü$KâL +^§•\Û.ôgÍÍJ²?|EÐë¸ÖG)úØ뙳ÊÝ@j~ÐãÚJsÁ^ ¦Õ~âíÓ~¾å¹D„Ó˜ÀDË2øš~vèªÌì¬È³"˜ Êü²a)XÝ´ +ˆó fƒSÝS‡Â›ˆÆY½{ÌÏä(ù¸ŒÞ¼ñ”nÇt5 Ía¯èuœNàëbÍ€_Ö˜ü°…à‰!C£nŠ#}, Gú¨÷=æ3‚0•Â §ÎÖ!yXêúí,øÒoo¸W˜‘Cî´¾"¬ØÏÊ׬Ί›AžX‹Aïz|ln\“¬pƒ5ª¯Vä=iXjIø±!û4é6ºfÞMŠ¬ ­8?›MHlÐôà +³‘èvEÄ„9»ºÖKœˆ¤ )ÜÉd;‹u¥ +¹î^æn9.™_½SI~¦¼áŽ*í–ú >2ëp0qäÓÂ#ŽÎ +ÜŽÀœþ9é9Pèá’ñ8õ^;‹ »èJ´iR)¡=þh@HÄ B ù†pên‰{ޔџnÆQDE£ßôVUÜ)†Ø+Ô×ö)F-.©Ù_¿«Ÿj”úÞ@ +î ZsAo™Å.Õý€», 5͉ò¶ò=èÙD„g¶–&áŒRJïÆï3±ôðÑB©?Ø›ìùT"¢¼º^vÆ—¢V^y[©­½Ð“•“ØÝP¯´ß‚}óÄ,G^ŽÜƒ3Da7«OXÊ¡M‹å¾a¤}j_s—%Íe äËCW½a×Ë–,N¦³—.6šÒ #!Â0äÞªbk9ÂGŒò¹SÒƬÁ|¶¥(YòuØ3ËsmŒÝíècyå¢Æåå#ð·b%TKX šàõL J»àÓúêý J½ +RUö+&ãj +…!ÏgÄ‘›¾ÕÑT[”²jcŽа[¸n±¾ƒVA‚kG\+Mrèf|Ͼ|¶¾ì:,„®8ŽV8´­ð@„§guÏ¥%m¿ìI2‚E &Ù¶s–ÅäWô¥kA®ñCÉÞ¢Ìæ[FF·á¬ By±M`€«•vÊ®.¶Cƒ·'BÅõ\ÉÇêDqdc}ä¹0›k_éÊÓÄ#™‹ïxº9S'”Ô(óá‰î{¯d¥n¦âÓÓ÷1Æ}êÝí’~Œ¸¾Óõ¾(§B g\Ìçd®škøÁû4EU}Œ|ìÆ”ïIÚz*‚üó1xühâüÈÕÛÁkDÔÃ2îðÖ{“ë&#ך“­3pA˜c(Ö0 $Ôiű {ésì,+C_Ò%g‘zoz¥Ü²@'\ñ^¢M£Ä‰Ê[£Åáîjìq/Û_­7ü{u¹¢¤b^I –.©ÅV›³Æö®sõXãøv~ÈåÏÈ]íúvz ƒWq>:·Zo§¹cÈE째6^øƆBÆåñß<Ó "ŸîE¸Á‡>Ù7Ë0mâøÕ,¼·0‰ú+]¶Rn{IåE«Àuæô#ÕD ¤Nh6 ö‚ð_j 7L=û”ÔK…)YhÐΧ2±j³Fmt#àô?&íúéÏx×Rð,5xðÍŒh¸HRq%Øz>b.3;F> g#eL¶ü|áQiØ~Åñ™üÊ9g3qè6Ÿ³X­äõ¡}ë÷°f¹çÃÁíÛókü*wË]Kï.¬7éós}™C„ùu}Ecuê¸u9ÖHÅÓ'¡é˜Ãªê•ÄŸÑ:æ †/,¦à%…µVò—¦k.,„lH[ + åp¬C9òðçŽ0²­9ŠàhÆ;-åÏ;13røÐý$U& æ"Æ;³tٛΛùzg·<”Ü઼ØåÃr›˜…Ïm€Kåx¬`EÓÿM»o4’O{Ùžy°M4=tÁÛ:kì'‚â DhuàJƤ ñw‹ËÕ&+„Ü#ã ²9 s+ãyËtþ$ vÒÇmq8Á“©¿I¨øf +ßW™'‘×JÛ™ç]µ·õ©3a†)»W? +ßõŽm‰ë´HvõʱãÜmücƒw´–Re¡êöððˆÄÂ…•˜/wìP3‡sšMâÖ T×Ãœ™#+…û÷¡ý³ð¿»uk’:ãK‚¼ô¶óÔ¨ È©·ùÀðtÇË) +&½Nþk·G£ ·þM$³‘EWwlC¬M9»›’Æy çÛ®éFâ›…î÷K÷ÿRN)ØÚæÐ!F´é‘;Åiд¿ +µjNßJà:Û#Ã=RE%¬+ª–žÚÌ›(uÏ”@;#²·ˆx«c¼IÒ¦¯ûG~Ï~Ñl~ µVâ‚êÄ{¾œîÜÃý¼0êõõo§ñšLˤ“¶ÂXŸÒŒgÔNªÎƒòÄ–NRm‡Ó±1ø6b‰!#\¨öiÄ»”inÀí„ç$)b 뺯7’2Œiwª†"Fn£#ë–×ÿ°þ˜ñ)Ô±”AÆÎt }Û«Ù¬!I‹fä[=¸Žwz½Tl—#œh¸öåQT“PË£ºïÈ[­Žg]ZÂ-…Í]äZ¥—5r)?;×[6+ð J ‰†mf‡$êÚ±ê-éñ¶ ÞYØhÈö‰Ôª öc8 ®¡yÃ$í¯Ø¼6±Š´{­o¨éØ\GG€ÆLã(5ó6 ¥)-J—zÆL$¥ñ‚ZÔQ_ÛP—u"P>ýYc\2O4À--5ŽØ›’XàG¸gðù™¡Žd¿7M¤¢Ïs%Ë®úIvÐ%|M÷ÿD‘È¢f$-8ašÎê^süÎ?¥ƒdû9•×öˇªD%A… öv‰9EÕÜäeãÏ<̱Q7ÒÌ¢n^HÌJð¢Né uJœÀÔjŒL%uóNïyÎzÄèƒN¥áò Ûøc4ÿ2¾ê×dhΚ'Ó‡Û‚œÖÑn]ÂYãõ0¼iÜÝØ÷ã¨R¹þ‡4·“Á:»Æ@h´•éîåýýBLòrÖÝýXBuÌCN3¦'É•G 3¯¶ãû¼Uú?>ÎòÀtV#×EŽïEËëvnô„'VÉÏø0R!<Ζ–§s,_9ÖÞ’œOÍy1fa×UÃpMIJ/Ësœ‚<±_¹èÑ(ˆÿ&Ó&; !Þ@(‡¶ê¸•F³ÐU®X&è±Hî°ÏYrúD!=´(Æ]ZÑÕõœ²ì¶“BÒwJW·; בbÀP”z†jŠÎc»…âÜõMôý¼p¤‚ésV}Œ8Ê2ofJJ|Qåë]}®Çÿ\4_Q|-þ#ôƒ-[ðSvCIsÆO¡Îf Î2…ü-šòcmž’ú£§í±šUˆßIñìÑ/ °¼&`*–ÞÕpáƒß~¹$¼³È,¢GX-õ• ½Šw¤D %¹;Þ"ú^¹ÈºùM Ûh@¤Þñ8¿pŸ( ìŠ2»„ãèäÍ\éøÚr“à³·Q†ë´Ê)¼×ãÀz{*´d†ÏicoF ;¾}]Í€y.Qíuzîqú6Ÿº=¢¬ˆBtñV¨·‘ÕÙ94‘á­Ø¬KsÝAÃèUvEÉ´j–NlìóãXÐKòÕ$.L…ÂU¢áÚçÆVÅ þwV‚QÉ…ßóœŽòkxÙ=§ß×Ä“ûƒñjMÓÛa{ ·ñõ¹e¾A:{Ïóµÿ©yŸe¦õDõŨ賀Ê鸰§«ÅN;Oò6O½OrMà=C]aOv¥ãEß­ÌýøU¾ÇÀÂÂö'ïbÔ­ƒ²­–^ŠÑ™ŸÓ†¼º£FI•@éðº&1/÷ÛqAëéùêhFÛæaQ@•ƒmSu›Í¹ÆûØ^7QAc3T 1d)*KÛjÈö–+‰©à=aøŠG%7…f£ææóÞ Å0Bn'dÞsIz‰ùÔ‹Næ¤Ø`Îk¡C&GÜ@1·@Œ‘¼Û ;—/)ãé‡4ãk]¢*ŸÄX(B²ÞÖx|[aäŒæõpI1W¬d- a pêìÏ3­ê…¡Æ&ܸi£¶W&&±_å&ðÆ/&¾it³VŽíCÈcIt[Ö°Ön J²áa±ØˆMO&3âóϬ†TŠÖÑïôjÐÕ-Ù¢þë “"7[ž11ÙAÔ_˜•KåÜsväh¢ñÃ@o™„ ,Ë…ï9ÐùvuƒÜ‰FÇ´ÀbBq³ …q«\æx+–w»øëÌhQYû|Q©F k^.w}öÊUÿ€ÖÊÖŒqà:Sbº„·4Q.ÕÝ…ÈVoŠçF}÷cµ³‡q`­ÐØ3¦LczÆ ‹Ÿ²’ËÒ½Š~î9´½Ö5ýÏ.:aìôWîÃÞ4/ N=›–-\/ãÿL>­èØ•Cw›å¤ù¢w0D¸ªÐ±¥ÎuJ™"s»Û…Õ:M°3I•ÁPãŠÌð.$K›Ñ3’f‹4Üúßʱnmf\,…!9o-õÖ!ñ¢Ñô‰åDŽ‹ªˆ°O"Œéúuá }i Yq¨Ë¾QšWÆn.éCR/›ö–±„ÀGN}nýÝoˆræ fÒϵî}ŒÖªü¡møm;Êy4—«¨Ý¿ Ðr}émM‚>SžÇiéK".Qw'‚µ#%\3—³ˆBEemã„•ô˸W]ÚOÚ·öÑe~£Uóz ¹ïŠlÁYØÙOúpåК–zi¾évÛ.ÓIcbwÚ[SIs Ò¿ÔaÓ„¥æ¶zUŒÅ,{AÞ—º>9~'ìµ(ç!¹kuÊUnªl'±!Ù$ÆþëyÖ2àkm¸MïÐÇòøºlš”„ˆ‹«Y}@e,MÆýnU§MïŒ-¢˜:e8 ð>€Xµ àš žBë ´‘ Ë÷Y}P É“K tô~r­”Yç¾ð|ÂäOVnˆ€ÒHcß›!7»°hš-Ì$#HV VZÏd‘Ǫߓ«0q£@ÇW#…Ùd¾/£ßø²9ÂP6å~£Ñi9\Ú Œ)À—®>UlaÓ´¶°ûö?O›ítt+vœ{©§\yºìã3þ¾‚r„HšÐ”åUh ¼Mþ“Ix (Æ ŠÃ’CmÇPß)õ~“¤,š×玲{Î  ö麰ÿ³,A¾³K#K¡}ËÔ§A zè®#çlª +ÌQšû¹¹´#%œnáÙD{௱>}ZÞ¾c'7øo$W¼4è–úŽhQ¾ŽÀ¤² T®mþžš7ÈËÆá‹D}Ò_²hÉøA9¯UÝe3Uj(‚æqËš”d‘ +²8`×\æ—Nn!y–uܶ–¸k€Š[1·\6lË_…‘6¹Â¼\¶ñŠÒ¸‡,Ùå[.:åã#Ìïkź¤ë2°hJ)Ù7Ôœr4§?ÇðVßW./؆€´¤‡2vI>²s{Ž›³.ö¹¶KݸIÔNvaÓè‰%$Cõá¿¢myf$…°ü “C Ã’Ä\%‡ŒÌ.“±ï7j~ØŸ›Ô,"-ìÔ¯ÄX#îAÃÀè†Ô½^'-àŸÐX°©äøÂAÁ‚X_—k?¤à)÷  ûÄÿ¥Yû«ç\Ç×?ÿÏ”ÂG’ +Õ”Bx%o_`ï• ¾Š.v¤{íE"j೓eÏFŸÒÊA Pá4ºKµ&Ƽ\sƒ4œü‘M~-R¢ÍPñÕ`ïLS£Éƒ…:\-ò]ôë¦þ)¶c®†-Kgõ‘B•Ò;óYò åÏ?\u(ç¥~ƒÌU_ëgZ°¯£ÜÇ‹1ÑþǃàV†:{vsÀ¹S¼hŒýZ±g$²0W?Èyqîad’t[¯èõÄÉ$ ë^ž~ù© U ®^ª™,´ê§Å ¯ÖÅ°p†í}]¹¾”8ßxéPà·×ø ó"Œë­º% †^%Í­¤Îûwú*tp3ý‹êÚ‘Ј'20•xJêÌʯ´sà·žùeÝÇ¥¼ª‡ª,É ¥Ó\IÏBa¼#¹i•+R ò†NH÷«<ý`Š:Á«é󄲌‡Ÿäð¿Y†¢”î¿{ü;ÈdÆá{zS’ʬ4 m®^‹»ê4é¬0òaŽ¼ö*tæÃn1S «‘Ç@`Æ¥GìqÞµ†8--ÏûÒšõóY&TÝÇôt˜&(ú°äŽkÿ–\¼6 Zó~B6iå_¥}¸ó1Lñ"¦÷ E-ØKŽô±ÙUmc¨ÏŸ,ïµlbèvwŲÍ48©Q²…Ð +ÿ”Š¯øöKb@ô!{¶ïE@<;€è+î§ÅbUárÞþ[ˆ4¼ü¹­"ŽS`:v-Ëbã É§l2 Ü51Dñu·”“o#,y»RÞå +T̺1û¯wˆ\èòÔrécÄÿ•wê³¢H ¬&õáî­¬Û¹V=s øwS^°­!×0”fÈ +3!„c|k›]BHVˆ|g¹Š)§öÿ¾U‡jÃáMßT›ò%ûÑ#ŽA»Ü}úóf¹‚±ç›Šä&^6kko‘W¶{8yRÛäÇæef€¥Å¥ø£±gŽ8!c]‰½*ÄF3jјýrcY§¤7ʈÏÂÿø%€AŽ‘à«%w±¬fÒµÒ£® 5ÔY0J¥¿FF×qK|O¤÷xÿä@µÂ@U²S2Äò¯É9È ¿B2?ÁÃ[¨÷¼ TMoZºˆ±<Ÿð)Í,`l¨QÍ2“Ej9>wŽá§KH*<.*¸…ïÙw¢ïÞ¹ÚYGu>líSãg‹„·[‚®°=²‰ „ ÃT‘'ãÖ² /é÷ؽ6®Ðáõ{í£ß4„~CÅZS𴬳‘33›9‰MfoêÑUÒ¥|) òæ@ù•/ ÙŠ„x ü¢æY-&t35¾Vx‹]uËØ‹ë ñ2©¨A<¬m’)€#;!‰õ¼pØØjT;"Ã4vFƒód¦ƒEwW±·IÇb8ºÔDÑ)ÚƒH±nŠV¨ +Ûí]œq–îJÁ»%t•Œ 0Gÿþ£Úí¬!žmÝ2Uâà¥!—@RÇØø’‹TÈžŸÊ!lÜ3èÐ[AEÑå>D @Èò]°OÙáü2¾ô! WI;¸Vˆt;Ü 'Ç((ÌÛ¤Bõɼ'*!gíØÓñ•Žè$¥¾Ã…sQi%uÛŸ³9Hï‘Ì: ß½a>¯|ïcóûi¨-6ð¤Ü’ýGr‡lÙ’»k]ir ªÀA¿¿¸OØæg ÝCõØØñ›†^f¶ž¾ŸwWˆ®˜oKG8r¦Ÿš=a/cеWÐꩦ\ò¯²î€GyD"ó˜LÆ + WEEtUþ»¼8z… Â_1³Ëå­ÔNè‡NTÞ:GÆüx_Ä#Ùä< PÂÈ·K÷Œð‰–3òÎùF ±¤ †ëÿ/ÌþH°@Ô‘=è’_áïv< JöXŒnyy…tEÅ Uj1n2ö{ÁNÍ+ÇQÑÌ™!êe:3p³„É.°Lµ¥1wEÍ 6TÜV•8å£8eÌÈ(,¡‡p[Í. ]硳u´É‡g]rºë®Ç$«2mضˆ ¦ž- ÿá/a"]ç´êOá?TŽ4N=£às$Ö]@ÞÓržd¡üø9!Êksš¸4¨1Ãôc·TݬzƒG׬îú&I“Ô’N©iÚ†)"¨} "X$L2ØBè#°1SøiΖÖB˜*~«â«„QÛh1Y£”yð3­Ì?DÁ ¶Îxo8^>‰nƒ½ÊÂÙ3†ÂTμôœ#….}”R£èˆÏP6 ÞZúØdßí‡ÿQ$„Ü}½YF@ŸdXr#˧ïy Ô‘ü"Ò²Iú‘ ½Ò_"ªsxI†C…¬+XwµäÞ!jJMé£ m,ËK«Ïæ¯×>Âûòs3UÅÆÈ:…c +UªQJ1]ï$tË×ñ˜B D;„],¨G'Ês2›vAªÔŠDW3†ÞösS0~¤Å]\™ðµ|ðúPðmË=T|»[,öŸâÒp—J³ûýîz3»A@Øã5Kióï t@‰:ËQWc¹ä|(ÏJ¾C›¥å—¦ÀñÀÝNvÈ6ÙVE=®ÄØÒG½—ûì†ýב³8”o ñŽÙ¼©=‘Y¿%'å?bÁ¯ašË?IfÄ"ò3CCànMúì)!›ë2”Ír1?bqÇR ï[÷µä][H÷´–r‘ØôÁÌhðCKåÖ’ÓÇ‚óíÖ|;ÍR >Šø +.wâ5æÆsjÀ'ǪŤ+BhÀë/b)ëâô,éoÖ{,Ž¥pÜJ×.ÍpýÞßD~óœPÈ‚”~ÞÄxAÀfobÈŽyùÌuþYÊÖžFC®=¡Ù™z ­ø áßæ y; V7D> +á\7P kÄ «øÿF<(Ü´aƱÃO*¡Þ™ì‚‰SÍTàFùÓ…,ëÜ¥ë Ä¢[Ž)ÛRo9U4:±hг"_­ZñäÍÙµÊü·˜ÉÕ¹öØŒ}>ÎJ€¡…ÒXý¬&=Ãyöìtu´„Bz§yÞÀvçÓ„Y©0&›ö[„jÈj’I­ú¬±¬OøɨK;‰Ý`bªB¤•M̯•;ô À\U3W7AbΙs8¸yö}Aà{–ð‡K˜ +ë²oUZuºø-Ó¢e<úôë®ÈàÉ=‹W7ý_SòE©I ¤§db€1QE,ÂîsãkM2ùÃ"xööÉIKÜþ}JÒÉG°{A-+šÜÑaõ¤ùò·éã±Wø¾aÀpAσÔrÊkÿ,µŽ)¯†nÀ†«B¤j p8¹jChååЄ`Ýô‘_fþ0Ðð4.Zÿ ¸Agí/õõ,yÇ r*.$ {Ö`Ü0´‘(.Û¤ã$‚°*ìFÚõA‚w®¬Ç%š^ó“Ü÷ßSƒD›3¬žsP—µÐx®Æ ÈÈ-¸̺ÀÍ)«|¾ÐŸ¾z„S!ÖatÓõ&Cs‰EºfOÆâ°T‘ÊÙ„BÉýOxtcH±ÄÞ²kà7='|¤iæÛ£SÕ®T.LýMVµ'AˆZ~b¼gŸå ^¾q¨GбÊÎÚÏ¿—IÏK[ç‡$±maÙkóc”‘ý)½¥/)7ûá¼aßÏ¥±çl©Nu³‰KM­’V6ßôl“¬ xYxܬ¶° Š127Ç,Í_ÊÑS‚kä õVF +§ö £N‹´W( é§ïªÿTۑሪ;ûs‹ÌƉ9‡6œ~kZzäðt†[’osÖÛç8bµ©uv5X÷ƒH¬+÷‹4ÖŒ + KÍxly·J—Š¡W»Äø QÛд†-øºû2Ž†7Í=f—d9ùúo'÷cbžï›Ú§Wð³ô’ÈÏx²Ðu×ìkÏ\åfIòOt‡ÙG´K?ËS€ŽEÈ%× pàˆ:Jua'Ìä=ÓQ3Kô™@ý{bÌ_þ +,vEˆ‡©J³-:Jy‰œÁ³ÝØbÓƒuãED»±_ƒ|¯Ô¢©SuåŸ4BÙ<í_›wòÉL!ûñ/¤<°{'‘}b‘íþÙÄ[söîÀ çe¿o+}éÓD’$ÚΆ_£7@ŸÂNŇf×(#ü¡˜‹ëÌX²  k€£þQ>ÆV\»¤~æÅîwx# 9u\ȪÉfF‰L *Ÿ%:$[hñü¥ÕŒ•%n-eY–\a.³R}œÏï™­N¦}þ/\f;oå1ö¾b÷Œe†B ôŒs:´êÁŒO`tñ8©ƒ\—Ÿ¸µû'{u;à Þ`¥?µÕˆ¾Çâ㉯¨i_†îדN©E»Vù:¯€8À›ÕŸ—²AòÑ`iÉ»ƒÑðåM/Û" · +õ.q_€ÃSo‚á.{à Ò:íÜhª.Eç7[³•¡ü¤’ îîÃ^uæCîSÌ‘‘åUÇ9=1ãw:£ã)F[c¨Žb™å?êÈï._23º™;õ¼;ÜpoçLÆŸ‹§¯ßÑvÌ‹ËüâÏ°Rö^ zéûì’Zæ=ë˜ió °S.ÜÉÛg­O\—/ƒ‡½ ºŠH; õ¦n,«° ÂzQãy«^þn–Õƒ)E-•1üŸôV$ ½[­²?A"¶~çU©S»ø©KZœÓä rBÅ!)%œ|P0ÕÚˆu«ñ‚ýMKÓòoKíþÿA÷ñ*K\uÙûwZzÛCFwŒägú­3Î(Ö2ßáû5Žì¡MmÏè4|åÑ€¶SÊ’ù| +JçjSO(&aOuY矗ÂÄ%ZM(ZªôrÝD‰vHŽœJ«Þ´¹òm"­¥\Ó ž!BRâ÷µï“3ÚyáŽ!Z™²+sÐø‹<ÏV¦rb_¬Õu훤¯ë£ ÁªïFÆêò“]…”š[uýÎÙɨŽ\T5¡øá”é¡ú>":y&¨<ö=Á.ÙP4BÚ½e„à„q-þ›˜MOµ•‚( $ËC¨¼Íù.`ß¿Œ|Tiè–çj<×"·áxnKàc ÔŽ˜.zJj™UÎ.ŸEwA£ø6}˜˜y!1¢Ÿ”gvu'@¥ù’Ý#§' ˆ‚üȾ¥ñt©jÅÙ)']Iµ—8Jÿ¥¡ôñú|ÜoU.ª_4ºÈÄÕ•|R4dkâô‘¢d«¤vh±¸´Ãî‡ïÄàAGD÷ƒTÛtX*Ó7a9œ¬‡¡,%8¬»>äVŠÑ;¡­†:l4 f‰¿-¢/'\·ÛÛLH««läé{uÊ1G.'J$=kö šð=½õD_”X^”SÝÀÛ¢IÈ–V²‘é²Ð˜#Zº±{5@5ñU†€gÆkEìI©Ho—¥Ãq”µr·º©d•‚Î)éàõÿ¿ƒºñLÞt“a’¥´ú¼}ÃDñuÆ_܇Ȼˆ|ÏPÅ…Í™{ÁÔã5ºA¸}Ê ¿Û öÏ?EþCt$£û¼ ÐÉàÙûŠâ4}8¤å—ûÜmÆÉO3§[L¶SãóMUSb‘gzÚ•­¼9<ñ©÷I‹´ +ü…–&Ÿ5þ¸3è(–¡y9a”Ö“ßì j¸ø>™ Vâì ×£yÉ<’13‹Îà5þ¥óÑ>ˆN²nÔß»÷ ìRãÑÞÏŒuè\Ó¶ýí€Þ§qÔAïCt–6rE:w‹*|LÎcúE¯>î×=Úᦂ|(õèĈiú¡Ó ÑP+Ïl¬$Ø»ŒcÍã3NeÐ ïÕ¸ë‡Z[„Åq´SpŽ©3c•ˆ:CšhŸ”[ýµé{B&ÜOkSE_ý_˜,ðWw +f&Þ±ÉÍ’ŒÅ ¸”ÀÅõó‹_Z`s€E{HÛ‡Tª,&°Ý:¾ ›SÎé!l–2 ûLét䚟ò¨¿C«µ_ ÿ.Í®ìÁ•ô7²«^nÉÂZ# Yk7©–È°¼=¨ÂÈŠRDb³fµÒk‹*÷Õ°€|2Y0 +‚ÍC‘ ñšÈ‘øúëa"’3e4I.¡ŠS—¨ÎÁHâÕQjÓµ!ÊzÚ ëþcsgEatßù›]¢FÑR Œf,:Š…vkTŒ!CV)‰ïzÄ ß´‘I`8)ýMY_äIm*R|÷m|’ÍùP¨ÈSÇÀÕæ8W’¦5g ñA¿ ÁÃY¯Å»”¼9ŸÔº·Of]O÷t½F¦UûZ‰Ðž|¡§¾94$ôŠ[cJÌ¡Yïõ¾tmÛ%NJœGÿ0aù7ëCh@–øHk~““ÎÌ >Q¼fJνÓm`…ûbÔÉÛ\×±ˆ9ÿÉ—9Åï õ„¾ºˆŸ¾&Cëž1Ίҗ@iE}ø3ˆÉÉÃBÇ ôXZÿΈ”:  QÅ.3VìQº[ªp7+Vi§½è!«-vf¬­/Y¿f¿¬"n>ДZÎ*”F°óŸWWG¤ÿó²u…E€˜O+{_´UI —A̹hº²§«ð_H0@þ@¼5©¶y_\àɪpbJâ8€ÒU0` ÚL“k­²^«²’ÕW^™zEÿ4£Ä³f÷§™§èÝHû@x/Dö0Èú¶ù%3ůX} •Äü:QIÞµeÞHXg,©0¯0uoôºmá®z7œJôé©uª·á¥®‡t¢„ÿáwQÕ$8½æMBùK‘‹‰¿ÿ+‡ ‡ƒ TpC¦Zs¬8áÚyy‰bàÕ7*änrRìÝ×¥]}eà~•Q4âîú™÷z¥†§úŒP©ä1¾:tÄy®K=å~-ï\SÅÆ“Ë—#u +¢ôº[çV>—ßN–0LX&dIÿÌ:q˜>¸–”Ýuæxo½žkà=–”€ zâ—ŽvDCߨSä@þš¥]»Jíõ­']“Õ {EP Y=mú’;w:(H5Ó _EðTÃE˜Qc„5„HøG8ÁU†ßAÞž +czNÌ'Àò}?Êx9Ü1`ÉsÎܳߵERà¥Þ ’y62"Ž#ôȹRѲƒ»#á²Ï:#€‡* rª¯T>Å ÷ü ®ûdÌC\ÆÙÛ´@‚âý±Wô™âýËUÁøfŠ©Ù_Œd1οZ [€sží…@Ÿ¹Æ·œ ^ÎÕ!ÌO1uºŒZŠøZÇøž¾ž^ÿ@žžb<ÁR£k eŸ¤7†2’€áÏõ8Ýv ]úø5ŠÖÈX…—á40Çr¾mýyNJ:Ü儯Ù¸³‚ý!@뀋•0ÿç”]%*3p½|AÐþ£–ÔSf¦“g’`6Ÿ| ØH£ ƒŸ(‹eüÈú—Wɳ‰$6>jY$ûa2¥XPŸ¢ ‹ù©Éú—¢f/H“¥(P¸¿0ISœvFè77ž7n¹«f'¬¶.d¸+é,°­¦ÓY‘Ç’º¿’IÉbÓß2Õ·É ¯¼ŽCy­£a]¿8|ÛëÝÁŹùÇ ]¤¶ðÛí<ËZ7¹lBiÓñ[ÞÞ–õÒ1$/95qLL³Òb£™¾F³£GþJ 3‰ø}ýN„ÒÇçø7å‘ÄLj¡J}Aýÿtµpe>ºÆĬ"M£»íÊùmÌ´{³âë¡ùùk8›¼ðR5ÞÓWúÅ—¨3ž i”}ÎÚç‹qh¶ƒø5ñ#­´þÀxb&Gf];Dtãû^@¿+æ^H‰ž+›&H_tlŸ2¡|È|ì ¹âWïYûÑü‰v‰E°øTê‡ +¯{Båé{æ÷>i†GÇþíùº¥û”²Žá?M9èÍã6êë nã´8¢ÁNª•}¢éìSט¼²- P@-j4,œH¬wK‚ÃvºU19ÞzücGIN + èS4=–ÒÐ ¬»¡cB⬴€Å¨°rµ’-y*j‡~õ}}ñÞ€Ø]iïG“ jyu~‰ \öl [ÌiÕ¹yÙ& J.=’uتŽY6M2 æ´ÕÞÏ0ÿªüì—Ài½äÓU1ëŒ&¿ @¤Y&OâéÈ3£ÉÖþ0%Ÿ Þ¶Ë ðÔ)ïI»& ú©P³í@çAPŒ–j¯ÓŠ¹™fþȉýW¶˜¡<{òyÒ^¬”øÝ;uË*c`î’1¨®Y/cÜÝ‹/ òôàòc.½þ\©ê¯×ý}UU£)(O.Í\„Wȵ¡$FþŠI<Ä‘ÎOºvú1fÅ>ÏÿmÀTÕUr‡å4uíS£e)ŸÆ֧Ǝ ,+A[6¯:_žáÄ;–º@ +cýšhñLvÐçôÚtSþøÉ›T¯ËBºm;|ÃYž‰"uæ±Ö9IS"2øShÔ£ •¥*ƒ%ª»``äФ6Û+Ç [ïk—÷{¢ŽN°ÉÝÏ¢Þ€I1”üõ­u×9ø½9,>“ %&nŒébÞ" H=Ö¨G¶ƒâ™4ÉTû«P¤©*‹ýF¼Œ5r+í8…ï°cÇÔ±HY5´¯,z(¾²t:f‰§¤KÃVQAóâÿ|(Í¿0‚£ó€…‰ãðÐüìÍ‚4wiÁÒ!Á‘ß@cRÞ‘³3>)¿;¹V£):ï'›B ô=Ù4ªBŒ X€Ÿ!¶þ»‘°,Ãîüˆ<äŸÙ‹ /¡à á·¹KÖ¿D¥!Î 6FeÙ)kÌE»‹oƒµÚ^×ßîÆͽcš¦`IMb¹ŸEûÔ½«}àKhŽú[”nSè·´/k™}Jàvé­é^öBY8%SƒJzÌRÌceJî¦Ì¦óÏ b“§dûBôªºSˆ@Éý<¤ wÚ»‡pÙ2™Avùxêl be¨±±»4ˆ’K…‚ /MÖ*§Îˆ´!ç?OdÔbf©e$*­5Ki4ÕhÙ!ý… +à_gqÄþ’ö¿½o~n·çXZ>®­+ûv[*Üó.uÙí!!¡2GÄ ŸCð{ +Dú´Wì(E»Ë'1~!¼nN§šŽ7¡Zq¡Žn@÷òüXð^‘DNÞ“WÔ˜ò‰þCÛR “¿2|QN»f!E“}ã$™¸cð—v8ÆÀbU¯rðÚ msÛó1L_o= Û^~”«NuºéíMÏa~Þÿ^i¸³Ï*d®=[mOÌpœô·@Êzþ×Ò 6AÝÏʱÌøñfòØ¡2é­XcR9UŽÞ·÷öy…L ± +ðåx›þ&äŒW;Õ_®ÃfýC&-[7©b@?i†‡™ºþA1¾¶ÙrO%–C‚s0ð™É¥‡1ÒHN$œÅpìg) s†ŒÅÉI`= +~1³Ð†ÝÍæûɘ”&fÅÁ߬Ù:ŠÂ¹jË™ÕF(0šôá4Ù?pJƒÅZÚÜùÁbm vK|² +Þ_Ñ‘ò×_艽<1_-xÞQÍN°x06ßZóÌí\ +ãã¿y¡˜èX&‹ü¾5˜1iFúÓ¸ ²÷jsÜ:·x-¯–41Ót’w\Å­¸oPo¬ÓÜCn'ktâ`ÜZÌým¬ÿrŠ->6lh+*l1t… éár(…çþJ¬–}Çwh|ËÐ7›÷©4Ú«sèBÝoÆ÷ñ@j9?š Îß9ýw?D9.[N2Áøk-Ò}—Þ{¥yÆuµá];öRî7¡²‹éSp’´u¹ÚXob±UÄ%dób”<’[ øÄ<Òá zd÷C’o^cñu |üz¥ûGèVW‰¬«óû™pùfi¸‚}søÍÔ©«$†îÅgš]^@%ð4õ»‹›cüÚˆ~\¬?TÿpÞ+êÉM«¶Ïû:h÷{SÚ“[µ0×Û+68ŒhóÓnª$¦y%½§ÚÖ9ã +wë»æ°ŸôªçÉ‚îzú;vÉRvS¹©5°ø.*K¶µ:T 1ã+냮KŸ_vkΕ⩴ þ› ­…Z’JX¦p•Í5 +ûs&‚·†#ýšõÿ$0d"…†—¡<‰>-‚©U·•=Íð[°ƒÉ|@Ðd²ª ~EPz‡¿p1øQÁ,ZÒÖîT?â¤óŸfÿ„Àñ¹N0QmfGí½Ù¬¸€Ä#`{ßGyêç“ÇÀ“” $Ö¥c ¯DgÂï®às$H‰³ÔÔX,Âçä²õ®ËbôÔöW§¤ÔØé5œŸnj̔!¹à`~?$‹1÷ÞUªpTxJÞìÅýŸ£Æ‹}¤Gà·í}$árGÇ<ššÌá.†'Иr(ÛôGMЮ³BòT¥ºÔ¾'_¡OUÉô'ÉúË–,(.Ÿ\" ‡ D¡J€(IS‚ÈìØV™q–«Bè÷? /1f__Êê!$ñ$Ö” ­‡ruÓ1&¹& ¿ Çër¹ÁÒs:ŒR Á¨Të¯Òl|7üü8¾ƒeÿé) ,¦¼az3ÃP:ߟj¦X1X98rýô|yàìŽÀÝÛ ±‡2°Å%YZ¶èÈ=a{zºº‚#:"a£ú7p>ר1r¤j“_»6¤ŽSyp#ý¹·²X½pù)R¿ôúŠªýW‡‚ƒaÃD€˜˜ŽÃç›Ò2<ŒÕ°½[^*Séû€Où†I9¡áZñâ†æžûP­X” ÖÍg›*?J€Ö‹ƒ£ŽLCp;¢ª8®œg¤`$LRšrîT)P% £‚ÉÊÖ:ED-Ê+¢@²Ãl%J‹èdŠZ1JM8´ápÎ#¦BÛþfê÷õŒiØ@™6OL¯‘¬Gß* )ƨàöÜÅHÄ»i×j9 Š²ÂÒ’·˜ª±G0¥— K 8ewúÞ:Ñ<ì™VQJˆ&ubÆc!‰c9å;'(žÓ0·~ëyé¼,­·výQ]—/è-9˜û÷$Ýæs'*й륊·œ(ìõDìÔ«<(:+/ËR0Kj–Ûc «ñFšcœ¹Dn’ÜähWå0AõœAÈ£ŒÀÑŠåHé¿Õfá3 <|.ã|rý ÿªÅýfà2‹O”_çG0žÉrÕOk»8è11'•=ãfÊ»ùŠÙŠA±(V•»á[úS·Yá'§³o‚>›K_,xÿ[ØÖ¢ŽAf‡¶dQT¬Kº˜–þTèöƒ­¬õö£ydTÀŽ˜÷PÝ2k/êu*õ÷æeŸf7wx÷…Ûh|åÞp–RÄ…uÅŸtJ×Åp£Ÿò·H«æEµ)r\7Ãë¥'ì$þH÷6·ö\E¢Ï»Ë7ßq"Æm}ô™Æ+ÁS , +VMHîAõ•²uשd„Ú‡çËJ¨cQ³E]€†ea_LÓg*t¸J¹¢¾=ZXdÏy&ÇSY¤S”vÃÇg¯¾Ÿ]KÙc‹UÍÆBE£cûž…Š·wÌ”/2Hh0ù'æ'øjRfÇù&£¥ŽXwý¯É¸(®¢êz’î¹ÉÄ—‰ûÇ–Û/õ+?ý[{ÐÅɸÉmÁèszÈ?R›Yth ›y.s8«1i\_ŽŸ ±X³î&ÿ459>“²Ånj©fæЕ”°é³Yùôxù€^XBcÇ41ˬ{%Ø( ©|¡Nž1Æ*LÇòŪºW¡(ÔÃ|™MœÇÛô„dµ¯-&ém8zä`¹zUug´[$\ß{'YŒ˜ÿÉ»Ž=eZßOPÖ<ƒ½ +ÅãGµ’’IÊFëé{a aè[P¾à+ñmøDöoª^ØÚ ÕyIH† +Ó·ÖtËìô.¢1ù)f?•ü6ƒ$Ǻ²4ç’8ðàFã‘÷óÁ@b=Gô2×ÿ;b^Í•ëœc*‹øžŸáýšÎT¦Ïm… ûgìèÊl1k«æ»ÖÓ+±-ïbh)Z,Ö­t2õ¦ÔËIòMì_°¿ã° s+©Ääœ^Ú‹¹}Š¥æebQ“ HsÔb_Ëc‰wBÿŽ¶›‘€ÝW‡DM€]ƒûæñz‰ø”«\NNÒÒ¯ª¶²al +ìK*éΣ}Ý’ó¦>S$Z¼°Çòô§ +˜ô(µônƒ‹ ô…QÖ觯dHW2FÒÈUd2⊚9Å’L1"Lj-`¤bÜä «Ø逖¾'<†¡âŸ¼»ÛÙdþðzá´q,—3$g¶E HŒ¥wºô€Ôö#ñ‰@ž—Õc.âh'c³I}AuÕ´u^N¬·2#¦(¹ìRc=HW¿ìÅBSy4׫¶ÊR0Ë/”Ó(°±²ùƒ†&ѯY†)ÎÈ×°,.è ¤|Ñ}qü5Öa#áûÕ„‘3~(¼<Ú ûñIIá’iÚ€¾<œãë àšÃÍ0à µ§gŽ½*-§‡N²¢õ]ÂSã¹(ºé XFÌ’Ý°6a¦¶ü5 -=ã”íQX,Üb%_œÓ.UVC'G©onËBn¸Ò>+~aÖÒ.ê¯.çdä9ØD{’UÄlŒyßuDQWì×%áÑ\ÿ©ù“w¼»©ïœ?Ž¥ÒSp)óY~(¯§$Öð£äú¹ëËåÐà?b!ýʺ‚¥E÷(H wÈG®β0/}Z˜4Ÿ*¡KÆMÑc`a]]ã°¦¤±¼ß›vÑò…žöO´…Ðh$%§šÆ ©Rp‹CÆ<Õ¼{ð9#í¨âÅ“ÅÛd^j|ßµ•ó…ŠôÍ §ÏŠq#Ú>z½úê9gæúòŸIG²FÍ+ž9SE¢;}U=<?Œˆ¦\šñ1ž­å-DižFCæ\Œ­ tªÉI…q‰{ +¶—†(b³¹EŽ³_QR¿±~Ì÷ô›© vÍÄæ3XÖ3ã¾^I— >È5b¼iÒlƒ•x†H>Ú×1EÈ~ œEØêO÷`‡Å— ãÈ«á0ÎñÑPþÐ%wö²|ä¹wq=c;5€e)ªòŠÌÍ}ê_KÇeJóGø"Šzã^ ºsv£Bš wsœ¼u9Ë9T2·Ðš®£¤ŽÞ…ö{õÿ=äu².rÍ}×c¶M+å=2NÏ¢4‰«ÓÎRx3½¢µ-ؤâãs4zá9fܘ¯í‚y#K¥L秽±Sa ›=@€‚In"î;Ÿ ¼ª¿ VJ åCd+»û«Ø•E-˜Hâ].‹®àŸÚÝÙM²òË,ÆÿTy=Ú¼¼^w¸$Š>¼Â(ùŸîÙLRæ+j…®dJNÖd3ö¾Nct; ÈÖDx¨ü?•¤,â•^¥òˆG¯Õ÷_‚çØ—úIi¨÷.4¯ŠæÒ}óD?ufž78Iýàƒ´mƒÂ¤‹´DòL’2m¾Çû\ÜΡïûxM‰êÖ pÈ_žÜjκNbÎ+HÜåz¸Tö§m¡­‰·Šð ŽÆŸ/B”„€Ps‘º7›„ôÕ&þéVtØxV`Û `¹à\É8¯ü÷”bìÆÈpz˜Ñk˜ò?]% ç"˜pØV8â¹ìc׋¶Ö°³ÍŒ%B½_:¹wŸxxrRÓCÿp)÷…SêX~Øýå ŸÑÂ%” 'rcÛߣLëe,ð=OôKŠdWNr+xø±#ü…@XÈŸ—ÞƒeúZ Ouç¥jбfüov×Í+Âp¬e[[t%^BèSØâ$.šø”¶·¯žÑž’î3 Q>I«†– Áª@ბQò)MOÇ”ï£ÑÈëZŒõ +xlLâ#¾!«™„ŸÇe_eR;•–ÏòfC“ #þ“‰ÁAÝQß¿À²P3~’<;tõ†nŠªÁÔADQa¿íÄP õXÖš!=ºœ†ÎE ˜Fž;Íå„ËŠ=[VŒGÎÍ®‡ÐKÆ}ž3¶Ÿ¿ÒyO4¯Âž§Út›ý\ÐBéûg£xñ¨”β†HÆ|ìŒÞ÷.£E 4pPfü.ÉéçÛØ}3>V~úÓ+?5Yì&ÔËq¹N3<çÇ’C7[¡´·$«’8(³jdÃÙƒÈ{çiÎ¥`UðµZýxHiÎùá´1Íý/}µ M³w‚I›ñÁçžÔ½ØÒ cŒQóFpÔÕ—&õ…°ôÖ¹¼õÂ8¸nd˜ kšùJ“ªïãƒ|ÎC½Àn"UÀþìYÒôìùf¡5.xæ}ŸB`º²Älán3 pÇ_„Q±÷.IŽÌ–é±ÞzèÉ€¿g—_ùÏd}óûIäXI(™kßJú湈ŠŸ>Ó™ÚîÁåLÏ¡U¨î ¬B®Â4Ï[ÅI¨¦”: ^}Ã@¿Üºª¹X'–ÙdûÆÒè€:*$$2¹A¨–û¢Á”²0ÈŸt"ÂCUãX5;Ì~íð®'ÞAúÙ²Ôh²ÂîÀ¸öN–èn<‰q¦zEµ/¡(´V]w¬?8#vͱ!ï*ßjtª2c]âC^´¸]hyûÌ÷hAƒâkÑûÉ ¢¡˜Šf•µq£i௠•ÎµÍŠ±Ù8ëª8dÖ4sçWVBÁ²P8Û³OvZ­wïõIÑ64´Ÿ°4°Ôt…¥ž³Áºµ ú¡q– Ò8Â~xqP”ž0ª8‘Ç–în—àiÛ‡ÂV€ZyÐGa½åÛ"¹Ý…½•Üå×€‰‚£ˆg’œ•™PÅç<ʨ­'UWhëT²à¾·'‹ØSÊ{¬–§©U77$“’^dKÖ)a!v×4ÁõÂŒZ.Fi)b„1 µ«Yu+óÖ¦w!¯'Âe`i¥Ru.ë4FŸ‚ÚÐxðMi˜x)“}°@ºò§ÓÆ9¨_›‚)i=Nqæn‹põòØïÛPLÍc•¾Çí¼ºëÿ.jwŒƒ"o÷€ž1@d!» ªx±)›í`¼’ƒå#è€…Ì ‡fD4~n„r9 øèU¡‰¸yÎV¥ †z‚Ñ ®'>!ߨ¾Ò¶G˜«Ç?»œË·‚]¤ÙcуŒÛ„z‡ÿ9yê'Ó¹–Ûn9,à°ea91¹ŸË;š¿ö(ƒ—ªSçKˆªIãÔçžN ç[úU{ÑKí ™ÄaUlp_ ö:µÁY©’çú}EZP©ì˜6ÅÅL3Rzë{Ï7xF»…¢E)ʸ§5kþ2€“ eÅþìò 4ãp.Ño9ݦ>/ûvþ´ ÔùéKº{®f®Ql±ì*ùù63mÞŽÿUr‘ÚãÈ4ð¾Ðm¬ðS‘³âÉZ0ÝÉ7ºK8fŸfL®ôÅÑwKšõí†}Ðjñ-XÔ~Žv‚Úß“…hg|oua…°±Þ¿!nºkÉyçQ‹c:uÀaÚ/_¾2«öSˆ!,ÇY°Zµ¯ÕÅ™ÀXÙ‡AÔDür5¸Àz«9ÈÈ¾Ì p1¤rÍÊLUa«7,9ë/Á=;ûú”y¹$L¿@4àŽÕ"'&C"}赓B-Ðз˜'Š‹ý‡Ã…åïÒ¬ü‚ÑûÙ*†Ã òþ¼+ç%ž÷ªU$VyÖd]UBt§í[–*\¶ 9)š8‘ÔBwÔ/†±Y¸,qC¾BÅŸlŽ³áúì îõŠy=ü[?ÿ¸ĵ˜åîïòEòÊ?îÊœÇì^ÉQŒ£r¾’Ô„Õæ%  &BA¯ý±€"»Œ^ñ•Ìçyº9Îw rËÜ•í£´^­IÃmr8É=ªl>¿† ²o¢™~:r”èE) »]:¸¥kã㯸HÑóļ{1Ç¢Q ƒþ±òŽÂMíºDj[¬“‡æÖÁ[οì…_Uæ + oŒÿ¡Ëp ÁµÝ¬"Újfµ³¬Ø Ó­¤»Ü ñWœ¾ùJîlÙAÓ]¯bøšgd‡w‰"ñrq¿ô6Šñ9éLä«/Ò9Çw%;=J«-b·3ÔF\-‡’*ËÙA§çxž’ñËU!ôÖ˜QŒâFi/™¿3‰9eÓé[²]C»Û‰ÍÍ­!Ùr{WG¿Ÿ©ÐÄ8”Û¾³s0Žõ{D`jÖÀ];d:¦¾ô{m¶ÀÊ»|@k Dlev¯žxXi Ô™„¤“,½3Ò*\FzaýL"ï(f5ðòV:?gXë.Và/-Ši%vü¢Èûµˆ¤K¬/ûŸŽÖÜ >‡ð“ ŽúžìãÇ ñäÇÕRÌUÈ£Ž°ó²6M×îNú·¹¦ˆR)߬ì–ߟž[ãÞ; *WNH¬›ÿ¯ß¸ý¸(?t eVÛ«A‹±'÷ôI!o<á¼êëÔyèIŽÜ| + ZÐ\Ð<þsKá4KQÌŒâ{_µmL£¤Qª™»c›-ð*ìýbïÀ¡Öµ'¾Ÿv؇‘¾½‡øS¦Y÷z5ù;dÂRæ ¸¥'ƒdùÕnzFßî~ûáËa|™2è z$™ÍÌ|B~6Îÿ§„ó}Ùc42ÄÈÁÏ_Ê{ÌdS¿h ªÔ<_)¶A¿ÙsØÙ#ÇJ¤üò+W~ËUtl +4àêˆÚkQùlÿÙî'¼³” o:Ï{Yd)7£ÌÙ*WWËìR›­u(Én%2,°ïÞÏ….¿ë–Jš…Ï~ lœž-Úåwù¬.¼oŽsUs2û½ÀÀZs_ð1ÙÓ'ÑŠ§³ŒÊ‚?Š'¿kËL¯„r,@CœªLÞ¾dÖ_ÙŸàÂÖ„ÎO¿ØEY|צ`lЯè›F>NŽ£W罘¢­|6‘¼¼ˆk9à4ÕzgŒ*2àÝá·é°ÛÏœ·œ€Y"§ .>¼‹â´»9rÙï&¯˜ð „ûû— —:…±7h:ª[ê:ÁK[‹[)5‹× Ì{À›Ý%†f5\Ú%MvÏã—È«Á`8Ãv§Ù¤""N?ç•óp;´;„žzè7/˜1úRÃ3šswÕ3)×_`ÞëÙš¡ˆ1H¥¼5=EÀ„»V£0Š¤?ª+$‰) ˆ¡hUÙLK(j`d)!N-zk®Á &Å»ë[³ëqQZ,ì«<ÙÔo©–_ÿ°ªs˜Þ€3K£GĘ³ËPâքؤ@üÉB^xæU `UçkY¸/ãFR´r‡ÀôŽÁ€¢›Òi‚¬ÖçÞd0a×^MxÍf O‰Ð[îWð¿ç‘²lƒpÞÚqêè¥Ñ·Óp .9–Âw ìXo•wó‘îg´hæJÙzðW þø ƒV‡ ŒÏŽ8)U“ Fß·qýãº;$+φ 4ŸKA¨öÝH¶@ª| +)E)åõ;¾1 dFÏ:kaÞixšù5,?{ú?#¥+ÚšÍI¹jOfF™§w¾á:ªzâίGoqÈ5õÇ»øº +ë¾ Ôv86ÖVt¿2â EPe‘¢ûWqtXÌNå°i.ÿjɨÅùÐÊEßU À¿®Sš]Ì•5wãM²£ñHáÁv'C§1ñJ7m—¥S…øW.o1^à¡Gò#ê’ \Î+U7ʧRä>ðǦRMã2½ñ9€„t;bé8z+Nm0÷vÜüžÈÝ= )ßò=ÆÜ3òHnwÌôR¥ÿ£½±ÀU€”5û¢ÊIõ L#7¦;ŠKèÛI÷< êïDEÎ5i¦þ´sV{lœgÉHã•(“%ª_ñç€ÑtÐs³‡>vÆxuFaV{Œ!çm@²EX¶ŸáŠÔú]H&ø$#@ª¤ÆušWØ)1f|óR¯‰À[Lç:“ˆW/1hJû•W$  qëƒè»sÙóZ¦CÔ§hmíK–DuxÙ1w—‡ògOß\Ó†ÆÂ’7®TڮǦûsˆÆ»ê¤·f›œ´Ä[Çq­OÃ|DZ¥\€QDxÃýn„D²ÈT<×c¼xk¨ñAT6¾êï¯øqòcyÒhÓ³•@ð† Þ¥*¸¦û:ƒÎ‰˜ÑŸnKÉêôDŒO]ïÐ*óÅU8š(ÉyDöœô0µÙ62’kÍõ#¿Ð²B= +áéE²€ï¡çˆvÔ“´Ãë×=&¼Ïv0î»^À4Ê5;ÕX명r£¹â%Ï(s"¯¼=-LÙNýø|õ¦õCt–k„y\¼Vë.Æ=ŠaÔ†[£ÏÔïv¹L^vÞ³ç#UÂãÒJ‘p¿ zË•ï©+–mÁT¸ɪÐíC¿Þè¥úóßôσ=úö‰FVŒ^TÌùþ‹’j.YZÂÕàðéô2lz^Ds}÷|'ö½_WÈÓŸ[tѪªLê_.]ù‚õmS}·ºãvÅv§Åƒ<¹)Ò\,1¶ã ¼B‹À\,ØŒl¼mH€œž;WqœóÝIÛ’]¶u¼ïû‚zîº|ǸY¢æÁçy¨‘ ð~+œJ!:ÜH¼™]8“|_X0kÇF§ªÆeûå~ß{Á Îþ@5HŤÚæ&Õ€ßß*Ž¦öÊoH ûp‹Æ…|ü᥂ÝîeqKÕŸ!Ï1$ö:CåU/JHK™WáÛâÍ™u¾"Z¾†Ý»·ÂiAáþ<8ôEõ¬7¿)<•Þ7xt7ÏàrJ¸.†ê•ý?î“ Ä1 +Ë3NJvQðN/׶¥æ¯n[æwYÞ8à‚¢ikËxúûü=¢ïý1ä¨ ÉšÎQÕ™P±…¾Ùu9t\J£šÉ6V·lfçdȪB‰HC¸æýÜQ°Åb/ž×1Å:;N(ÉVÉìƒA76Ô}IfÊmø +÷ÿ\´’¸]¾_LWÞ:ÏâÍÓÑ÷?ÓªbaºA7_u©Í¼Â> +Tþ›³s;µ#d8!‘Œ§¥4Ê«e|Jî™Õy¥ûú¤eF¶’Ù†˜ƒßþÇ1Nö¢?UíyOÑk’Kw)NöÿD0Ÿô+yM; §kSÕ‘ÙõE¬DÍUŠZ¯;ÑÜ®ëÛóöFçeŸWyò M»Dã–H㺭3RCnIe¤¨q5•?¶ 5ˆu­^¶§ 2圆š·±·2’·kðjvf·ÂôaÙ 93ÎæÛm‚g’}¸‰}jà˜ ÍN‰fopNâ-`qWåM1è2¦ñˆUýó¤9SA­Ý2f‹2OD )ŸÏ>«·yÙÔ£¨feÈ7N¤M©)æw^‚Óà;•àl·(nº)-BÓ2>|÷°ŽGJ¹ä[N­*1ÚÔ ý´,¿Ëå'ŧÖ„¡¡š;¤7ت„Þš„¦œä8`^d*/¿ì±r¹5 +Ùµ˜®FLowa°÷ÙX +iÏVqþöAÔ¡ž¯Þ'úÐh)ëÛŒšƒ`—æx™ö$Ã…Á CàäÓ,8_üOdÊÇä×)Tq!"¨™(å2µr*ˆY—§¯Ì¢æ9‰f¢Ãòéê3B¼µUè@«¨×ÂØ.5ô¡æê¥îã­ãe|“÷RÚ*ÜíÆr•õ#©WÛeãcàé^°ûëâ6À]PS}#œJV«s?äÎR ¿R>UV‹¸ ò´ŠBÊ]:KzŸ¯|8éÌv“Rc@¸ûyúÉZ¹{1¢P?H*wóó†¶8ãĄ̃Ѽ¿nØö¿Ø4|“ÖhŸf°¶‚šÙ˜Ø«Ã ¿—9\ίD¨Âˆ»ŽJÜìÑöõ|CP¾¢Ä¿Ǽ¬ÑÞzúS»D³¹»à|-8îbèúÃ(”é ‡¹ä?E'c˜pÕÆ.R*TA*No΋.%ñ•dì"4Ç«Heíœ+\2aôϦÐëzÂ:Mh0j6ü¤{}$‡[@”Ÿd¹-ZÐìbEû¥#B0ÕuHd\_jL‰Ö46pjZo|k[p¯“•÷@K9ªÏfG¿ÆE¡C³Ÿà²r‰ze¨æO<”ö’þAð-Šö}{#\€9õËb‚¾ÖòA@¢½ÃÕÄY¡íömšÊ3A½yg®æ•gÎYRþH¼mÄ]¯!ÛRÑ@z>»J«/LOƲLUœÌdrù‹Ž—¬iǸÁ>›4õÐÏhôöØ\î”T‹|S#”î Ñú ½îD]k‘¶Ä6Ñ(~ø7ÙT¯‘„¶‡!¢‘çòWu°§%çµzæðiü´v[æ™ú¦XÇð;q«C·i‚’þ{žúáµàÃr&¨n6-óoµ|Í"Áª©ƒ*\@ÓÉf´Ë?jœÀ'úÒi:Äæä‘ã—ô¢Â­JÒœmâõA +ŽÚZx7 +SîLü²¸ð€»-ˆuJ'¼p1^(Nv]Îß/ÚçRÂoT¾F‚˜á,`wŸýXeè¬OÇýnnÌͲjågøÔ,€ü¸ e‘D2®¾ ùª¤ìšµÀ5ƵÏ!Ðáð8Ô—A ÍÔT‰ä}ù’VR¤fø­f6½©Œd;Iœåg £øO¶VÏ_´†í‹<{´¡ë"…ÿR¼Õ#‰µm±)w åºAþ?x +þzrÂb–e8m$ê6¡{"JžWÈNqq&½™¡°:Š0"™ß{5e´èc&X3>ÝŽí¶udÂÑP(ű¥‹s®霳`9è)ÞGã•z‡ –®xñ«`0ue7ñl=áÞ²”d »äŸ}«>ûƯLüFÕu$7)-™Ø’(ì_ ¼ ÒÄÖ·£÷«Ñ²b|vWàÃÚ •k‹ð‰‡R<5~8X7>­_£Ž‚·£E@«­½N­×88½îaíG 6*ÐÔcò«HúäÃvÞ×-£©Ù»ßx¿ÉÕvpRæ¿,’ªäDãÙ³¹“xu B·%hÙðmÛ$ù]Íu“­¾ðﻈ”ßøBƒ¯YÀ.3`,¢ÚÉQhÐÌ +í/L%±%q&töÛáãR™¶é›lyCQ´ Y|ZÙj ÙϨÚVY-Nj,;Ü„WŒÉ$±ÖÄû£ŸTY6UñåîúêͶâJtä²\š¥Iß·m#`œ‰Ÿ¡äÔÚ\ñ±ÅÚ +ŠòøU˜?¶nêžä/ãåõ¯l«&¾üg›ˆ¥;òNÓ¦D-¦bI6ò)&ìœ ípÌ÷~_h^ËŸaeLå[ ®¯ø)×C8·Küäh ì¦^ ÑÁdB˜ç/4ǸÎòá_R¼§dqèà=N|jÑ<&…°êe–f÷ZŸ‚þã¾£É x+ =˜ØÔ….)Yˆˆ©]šÂ»÷Ò{}º&Ô\6û²JIÎý AlfUø,&¿¿Œ'IÁyZÐâžå€ {å‘YŠ»¾¼´u>ïk?Í‘L‰3&pÑÌ=P’Ô“4<¢²Æk£a½0’¡À…ì¶Â>ôEgÌ‘F°ÂÉS$e ¶E=–|¦PÃ0°SFAIÜj= 4%¯›†gíYóƒîeìeWŽÇøê1Ö5ÿëÚ?gÁøÕW».|ìE»"´ }ì'¤É œv³âümõÙ™ï’e ™VåÚÓ,€oä®Ù®fóÙ6r?för´¬_ÿxÇ<ÔWHÒFÏG ¼ä–Yùû V—jЭd ©HÄ‹â_gpMf¸ðE6H·PxÙ.··¸gúÚ 7êªRèœÁðPºsàÍzÙÿm²8Þš‡hOIt:U·h®Ãa‰)i‹9è.Õ®°bÏU¯i›ðUõ«~%ê"CI9]Sœƒ°©ÀÒõ7Ð= #fô+çÅyAƒé¾úú ¬éxòcf,ȳfdÃ"oÀqaG ×MkãÛéÅ6“+…cüˆøŽ°â; +9`]ídjÙ¿ˆ,¡½Ê“ôOéwiȤº¿‘5ß +Þ¢]I{ô”öb§#8‡  +ûúOU'²8²¼›+ÀeôŸæÞ i,@xj"t<0TÃ…ï0äm” Ô,fm%g®>{ +Õë±ÆáhÏÜ~Ÿ gÆ6šfVÛ‘Á~ ËU‘,Öº-¨<Ímíf‹ øñ„=–¯€½êuN @ÿÀQæ;|ܸg¿Cl@ó™ê@–B)‘/q>C•z ·à›¿’Xœ ‚ 5‘ ŒÂ¼˜›ôH!ë SÛ7²q#æRùŸòÚm„ñü@ álÀ ãó›óYr/c1ÂØyðî#¥%#“EX[‚–ªÓ™š†ß­jROH•¦9†D«¢š#¬·ú›b:\näõê$/ +½m[aÁPsõ‡µŽ’ê¸NÌ*'y³zÞäÙ £]v]ÓGŠv6Ës„÷˜šŸAŠ:ïTʺ©þÚØ};¥zQ=Òy€c®Qù-©^F×#h‰Ëø@ ïˆÝÈ¿ÞU¥~X•ªü9ý†‡Y9¥{AžóÕÿªâxšÝg¼uà Fivš‰§1¸Ó ÿG‘jÑ=µÑ²ÔŽlëo:ñc Âß×cö¡^záL®ÙyÕdL]ËJÞ C±áPîïÆ,⬦3‰ÀáŸb3žÃ6 †¿àÜb> ìü«š¶òMYV}]$_Ró|ª1PÀX”À<8äy&eYÛPñ^Ô¸£ñ%ð<„õƒ™”™(ºb½Îðp¡øÈ,O'+‹¿üÿ3Í–6üàn¿ÿ¿¤^¾Ÿ;–èh©1(R¯ÍNñQ/GåzH†Žrï˜Í˜ǯÖ3Û„²”þGÍF¹P°·üYöµT`~d(müK®8!PzwWV_iÁÕÂÔ…U$¥ÚŽ†¸¤ ¨vÚ+|¾ÔÛ0 1EÊÕiom-(Ûh:1}ÿÉàÖ»@h¯Ðünø ±ã*4½…qÝ1àHúá"Q,ýM€Ë¨´érlñÞ8 |ÊDš“ÊfÉn‹ømBÕ$Ÿ_´­:J§q1.ÁIÌëéÿƒ²<2‹ ‚æƒÞEQ¼[OážÇ¡Aí£—kæáÏòEãÕ€üKVdÞì(âúcGçkkó™ÚýuîKHÀj‰Ÿ»¯–â0+0•'TU¤öv~z²kß)FÝ=VE ÂKlÏË‹w„¡ïÔ`w5’Á¨“:ÏSó?ê<Í…©­®wˆz'ðŠ<±Õ`çΟ<¨3/Î[@ðÍ"õP"&Ɇ y‡æ—¢gÁW(o +ìPÃëáîY’­”<È@5ž,_ð8,5§’¾í¼3|¬µÓp ›uUàØuž²‡éÿ—>”aT÷VæìP´Ü,äk|Ôú.ÌÌeiôúŽïùµHÉÐgÉ´¬à0¿²À'Ÿ:4út_ž=B~§Y*ÔŒu?iÇäÞð óÏ<—È€<Ï{“Ÿ{$m?t³”4ŽÉÒŒàM„Ä0š«ÝJÁã0¼¥XYö8Ë‚Yà¢ô¿“8H£9tkYqõ†!9åæT{kaÕÛ^E‰ò4–¶@õlh–‰Œì3çÓŽ””ë’F + ~ "‰öçôÛÕ—FùÙ²²T* Q+œuˆÈáŸeBÙY¥ë3Èm,{½W;ÑÂ%X%€1 êüLÌDqsºŒà;uUër/Ø÷ÜLh Ò½õ˜œ³ ˆ™ÎtrµYîÂG¢ÿ!<¥}(2ózoFXpbŸÑzÕ^Š'“iŸâ8ûLGxÞÞÒhE€³(öÄƽS¼JÅ¥ â~ ÁðÌGƒP­Á3!…S},6Á¤ûð&Yô”vQà‚Ü:jtÀ5!˜`b]{»×;*[¿cQY%Yzþü>4lISD|çN'Q€q_ÏþŒUòÁLµÎè@I%làŠ£ÚŽ¹Tu(X,¢ÈKß¾aÄO2ÔFàðÙÁdžüYaþž§d± ¨¢…Iþošg¯¿g î`p·N{kWš(¥û˜EY^=¥œ]DžQ,åÏšØnâµj|¤{<«2%ýý—\—&}@æJë³pˆãñ~=!ë²a8B˜K/Ey†#n¶¡T'B |YFX¹»7ïÁ]]Äd­TñÄGñ ‘Ò ¢ÌÜE,öJ¿»LÎéÏ¡Ï­RÓ,ζ,tž/¤zõ»'9©És5PN˜a˜fiÙÞ蹊UÙvQšÄtkþy™­kß˲ÉÍIïv·­Ãÿ'Þô:h ™çý±q,R*øíeÎ#3µ®n^:áÕ¡GEιOl†5'It¥¥L}FŽënæƒá–JІ®nÐ!Ëø×Í:òq|'&>xIoqÚÎ=ÛÆD§±ø¿ ÚJ•C¸æ.C~@Ú.†—ãýömšãRú[c'jÐð!BHwÁpjÄ40`3ââ¹—ìÑ)¯ ¡zªªø¬bóéDîðÌpÁcþVçÕ¹‰(Jéʶ?ðóÀ鲞ùÏMä¶NTnýtœö¿‡YÀÄ ãÛõü*q wÆg ªøY°yjº3Õ`êÈ=O¸ºcü„ŽRÍSÑXíÙÚƒ +w¢2K „ÕIøõbÅ#™Ui_§®Ù¡þí¶Ó£ß:”šuŸ¸i}š#œxÌÌtÈŠµ^Ây`4ÆVh‰ÉÁ´ç°väqàõNºã%}è¿âméô’hÎpÂÓÌšœ/bˆ¥d÷R’g’X›³œp¥A962w+zÞ¶ý˜ IźS¥Ùs™$K iòÌ FÅR“Á|¢›žH03|ÁÏi ½­ +%A»{+HxaÐãëY7ü$C¬M,|µ¢ïWÕN^ô ¸tðœ"b:ðg°’"Î74º²­·£†ð¤^mäõa©žÄ³|ý66ZG–<ý˜»a;x|[Žî»Õ繑‹ç?à/B\KL“ÿûñ +-…8\F7Bäòf`¸cW#¹R„gc\öÕ€%ѹ×F÷½dÓ ‘†ŠÒ™œ¿ßðé›t±_€ÍEMÀ8¢Äa$ϬîdhUQsÓ+A›—éø¤¯Ý?ÏÚÖøìS·*Ú?ÌZWŽøƒå C?Â)m©ïOz~ÀÂïíú »e6è*Ç4×6”˯ވ¸¯ÿ~ªÍ ÷ŒtSÏ3Øä¯|l̺ϣþøôàÁçnæÛí© µëó…Îø<ˆÚ›ðÒ¥ún½gÜ™™L–Q‘EË£ûÈ’ÃPQ„>êp9ë÷¦®-,ìà)õS7žM¿¡TkJõg"WšýÌMîâ W73Wx™±¿¡W3ˆ®î7ºâÅMÔyµÝ¾ôª®q»³€¬2zI’Ç t¹Ð:š;ÊF¨èo–SíÀ ä2ý<ì“´HÄdV0ið%ɧà9þFøIÙKhÖÄhC€[κl)W§4º>ørî{“v t~˜L­p§ ~|ø¨ +%_5hiT[ÛÔþNR§©•šíåRœ¢0óJ k«¹˜IøøãË”«ÌZPÈ Õz€–ÅŒ]y$ß~2d}ŸF¶†'â\,`®¿–Noš€zÐX®…Œ,uM$[a»æG7¸’EÑ4]¸Ô°T’¨áê·Ä×Nˆ³cA^D˜Éþâ.ÂM¦ÉÀùg%94fϳQ˜×i±^†`‘ypÕÏ‚./*"ÒÐ÷,zòþKqUÙO§¹²Ôº³«žHah F qÂYe -am%äç¹G"mƒ†axŸe¯–_Ëôk–ŽÅÐ1 ¾š-ÐùLÆ')åÎþÃppòzgÖÃêÈÂÁá¾z¥U=ŠÖƒ¨eÿSAB\þˆ¥KójHÍ@o 'òÔ[ 7îKÕ†ÈyÎÃïä.ÏV`îÙÖ¶‚-+Q;¤ýh²£~–°”‘Eç5ó&]ßX~ðLnË}“M·~ÐE«ã2 +”Œ”/#×ôÏ|‚SfßÂèÚbi´ÓK#°]ë¨!dá>%K)!|fôâúbqAÝÒ Oõ¤uXz<ö±Æ õ—óì‚lyùôœËæ\Ò¡î“Œ·“©JÖ:ÇÌ÷ý˪Á%ŒÁÏ7±ÆCPòïýÄŠnqe÷ºæþK”W µè‹-nÚ„ Õ ¶éHíDsž~`½W]“ !š>ãrÔ€×Ó²—Í6ð7H±š¶ÇÖ•31 Cxuò³iP ªN`ÐìÒ›~\¸)Óg-g~Ñô5¥×íÖX0-µ€ú•ö¼8¼ÆI‡ pæÃež)ÁËv(æu£Š…s&ã¾Ê>Ô‰ý¹aëéë÷ ž +¶7íâŒT5§:µ7‡–UK~é²³a,DG^À§‹¸}ÆÓ¹G˜9”/bãYgÆíázãSeñrµâo„@OúB gùüý–5œ¦Æ*?0Ô¾¤Êî>ГŸHÇî}"rÅÀWºßTÒ‚ +J9û à½Ã™°ËÌrOwc&ø +` +Û&5…³uü„·ÿo$¯Ïø[Gÿþ‡¥í¤` l™YÔî{Aál +à‹"7d»¡éÔdàg¼ßú ÀYÖI<"Ø×^) D±l«sãÁ×ì¡,ßZ%c\_t©\\åáÅI3­l𷚊±óËY 4kM¼æh”LN­j.aĽŒÚ Œ™E¢} 8>êÙ§ŠÀN j¡`n¢T?©¢]‚‹EEéØ}Qêf•ü˜q-Ìj¶oœuövNœ×l„ê«Ó³ÜdXœ²¦ û@‚Äz1ÜöáörÐUs¢¡\[®ƒb[Btä·)ðVX³óð;%§®x©^³ìA›ˆz†z?£IÔŽäDh,bQ8ÉU2û÷åž¼›­ÉC ¼‰ Á{}˜ãʈ_ÌPŠÀ³ñƒÎŸ8¸n4Ÿ°±;£oíËú¶ç’™ÁeÂägŽWú§N½Þfâ•¢¶Êh&e½í­z퉿ƒù)¼-‹»AÅ\GGb í½áä÷ ]a#x¶Á'ÑþÆ9!Íl *¦ÄþNáñÓDiyV\<ƒf5\À$;+;ë³Ú!(#œž¡×Žb} )X£âbT¾ŠÌ–UƒÚú蔋A{<›÷Ì]&ké1i®ƒÞîºÊ$8÷͇M1MáŸmƒÒ&‹Å>*iYk±x·ò1uÝ0lK²ój˽qY´½½Z£¸"Çü¹SäF¸è×Èu˜ßm³cöçžSLÔ~Â\‹#Âg[?«²ž™aÜÅÌB¥ø}íwWIQUñõ¦ò°PUÂ=¼ùä95?‘îãÿg©qB“/˜èø¯†¹XQáK´~Ù‚™1˜ Ë´¾­í'œ¶ê¾~à ‘ßtµÏ_á×Ï’Z„«ò«#äÞ¶D#ØþÜ_™·žy‡>L'-³PJ > û±§l²•?»BùAjH®Á0&.Œ2U(Α âi¡n)¡6¦?_B×Ó Ýrr¤y$ Óçdfˆ5ìÒ¯m憜5]¿ÆAŸ[ 0&úᤞF¥Ù.ç^‰½yé » Dw¶ìÅzÈJÁ·9ù­I”s!L­ZC#€7‡¿ƒ³vmMlö~늎üÈd&쉻|jm8³ZÑ ^_¶S“\Ĩ îÒ¯&]ë‰5¿bç½¼p>.ÖRv2&´/ĉYªÒÇššižP?ìDȲ•ñuªí¿i +V(ü†V?õØ\t&UÕ¸yïŒ.&kûÀãW»Úä”ölêCñxcü]º“Íß ;éU<*²œK`2ò©h *“ºÆcSQ§©'½Â[÷ŽÄ¾@ø"º&Yû;ÐþÐÌjÕz<1(¦È¨©Ïx}z7n‚0]>íâédAaMŸÕÂKš9ód8Zà…UØ‘ÇØÇ`ŽY¬:ܶÞ½ˆ´Ï_áhmó¹e—åQ*Œ•nwkù²2 ýÔЃ¼B’ˆÕª¨ñã›#ås¶У¶:,cây‡ëÇ~¸1…"èÔLmU³?×LdgtE¾jHt îL¡…o¦Td&¦å~sJ±øÔ)‚w§õs7v Á€iîÆz˜z]o‰¨„†¿ß9ßpµÙð-´$u]?$"->¿‚µæbæ©fOùA{ŒÊ f5ã´œÕåû¯HÒíµ•ûµŒRtZFB>+Óˆ˜Õnò0ÖVtùkVdTÈ•33òa¹Г mH.ÿ3€ë/Qa_¿0ˆklgÎ{Â¥´\õîÆ­‚GãT'|k4Fúì)!è÷Ÿ±d£AG꣢Ú=Î?#‡Œ;¿Ð;ëšRÅônÆà8Ìé!ç02c=½ï™èœ@ŒñÆ?kDVºá>“- ù˜¡ø©9ßba›µ€ØÎ|SžÆ™¡ QÍ«æóeWüãYwÇÌ“‘ƒp¡R!ö™Eé‘ÑKÖ*‡™•½Œ¹ÿÒNŠ‘[1EýÍ*•Î‘îiòÁˆê#¤$vÌ_æ¼ik¬·Å%ÐxÇ ÑDBˆÕÆåR/ +-…µs:9=—}Dü§ŒlÎJÌÝSˆRêŽüûŠW +qUÆ?ñúiŽòQxtþÝ¢´àé+˜Àiûb’iP)ÌûÁ×È9QdÒ{p™…„™žfäw#‚GO/4¨8ÑY«ë90µ·RŶ´!NÚÆçüeþ»ž¶…R™­Xýñ•ÕÍOÆYƒF¡—¸Õ0ĶÓ½<¬–SÓÔy?¦3.ÀN ' ü¹ð¶±Å‡xPqE¶ãñà¡oF|‡t%Ù¦~ýùöñÖx{ba}IÝò^ Œ»~Ͳûɪe†JfÁÃŒ…\ç©mÂVöX˜‚«gòû?X…XÂ×Þö‡ÃX‚X%ä~X×AuŸUÓÇ4}pû‚‹Ï{·Bb‘E )ô"OwÝpk@î‰pmùƇº#bcÛ#·+&–Ú¨°OFƒ ÁÚVTŸç­ ·D¥3ÄzŠ‘QR]‘T€î`” O©) +|°üZw<Îb8@ŒÕèH¢˜Ì4ìàJó÷ê™ì23¯îU‹³¿}ï8m8­×uÏÍ ïŒ.³÷±ˆ 0E•ŸÔ~rÍß;ÞSŠUvÀ€ÈK|ö}±5ê%K'ÜA‚ɲÚ#Hû9ÛVîµçé2¢µ*˜9;(õc©ÈŸÊŸ\öÑLãóéj†< ‡î‘¬˜4ö¯O-LõìÕ{ Æ®Ÿ.Ë2Õ[O©xÌ Î H×n40bBd8žlÈvh0WÚÄd¿6 qnKˆpR~Z¿ñ(ÇÇíW]ÓJh?{GÑ0Ž“Á"8_]½Öø¦Ó×]ó‘ !»bfX‘§u³ šô\ðq„Ãi• k»9%&sÙò–³[ð<‰ÅPµðyŸ3…GÁ¯¢Ìõ€kãs‚]L¬a+DÄñ¸ »ºŸöˆô"Œ $~[+œ`Δ0Ôo‹.ú(̵Á &[? +ÄwÚ0—±ªç©†ÉÞ&×?¤T{s=ñUÑPi|Êû 1tHËûkªÉË¿T¢*ñ˜&°ü¹¾ÄF¶2ž+ú§@3z…5¼”¤ƒì3ô*6Kåªv'þ¢Ãz­')ù“€†ÁáÄ8¦·q>à¶P‰ð{÷$Y"GˆËsw¡(V@ŠÙ¹:@ ¦.&’Ô†“쟃å SŒ¿Ôï ù-v$$߈NfTÒGQZÌ%~c­]»¬däÐ<ôÎ6òÞ!ˆ”å%LÖBÔEV ×%Çp#†(ÖÐÝ}ïg +Müt$žŒ#3¥„ñ, 9÷38`ŽŒÈÿäÅO«þ‰†¢6r*ä@)yKõKVè4Ù]zû®)ÒŽi2Ó„äô›Á™™Áɼ² ö©éßx3k;X q.aØuê©f(ª2 c>¦}í•F‘˜I:$u$fB8Q,ãWG¨.DÐG¼û<࿤Ž—´’)½¾?4’/;“¥Âë†dEËÅ:{x’Ül¹¤˜ÿ^!ðüÐN»ßÆ—ÒP°püãÜR fø}°>\*ã1ͼ›x?QÄùgù[ácKkŸ`¯O¸¼Ã~CíàI×+(ø˱MJù í!Š®¢Ã@²Èí—¥ÿ}]šN…NºcBÍ°´Ef•=Lºú_œ8<½«O(gçßÚ_ŸÕ]» È1~{ªÌóvfXÔÎpÔô«ûÉK4Tt˜´Èê(®³‡DÕFtíq¬"уþÐCò)îj[RÞgÖ`ìî<¤ðMŸ!?‚—/JG+é¼2ÁÇõ6xb¢ÔÙLNwÀ¹Î왹©w¾“½t’ÈÎíIÛ.ó#Ñ×8À;ñ*3˜{O y_OÊq×dœ³ìéź3Züï5o/EaI»¯—†NW]zA£’«ÏD ™œ2¡74%ò²Ë]Ón—ÃsÂÌ+Åt\Ò/ûzÇ$%xµêž,s]B‰—ï‹wÑòshø•Á‚S*”xùlû·ÿÍÆïˆþTÎtÁšd¶÷¡ž'˜‡™‰ÿͪ*záLÙ­9ºOFu€€ Õßy0ùgåÀ3E`’·7–Å~ô¢k@¥†¯0Ë ›𿼠H!.â b u…cm&©‡²OÕÄÇóºR#ÑVR(ÞŽûð+Aý÷Fáx“K"þ,ë‘éô0YEÃxê‚N Çkü/ÖùʇRi|ÀwÓ5}ѼVø2ê¤# ,fèd7  ŠÂb‚‚Â7-|:0Yba7㣊s3º Ñ6³‹Ù‰¬´>)÷VŒ( T÷Ο z÷ˆÖaïdxŸ`z6‹YWDA~(š•ßÈZ UìÜÀÀÎù0Ê…|ãg ësŒúl%õg“§WD:ã¿T•h¸=ºÖ¿ão>~ŸØqlÁ½èÑIX˜ÇŸýöð<¸¯Z]è‚Vè¢Î¼@kÓ:Ö\MW·»ÏlJmGÿäGÞ×{©¶JB#œÊ¡û*[ ’˜Ï´pýZÛïF±µñòü-JîHðõü[EXöR%S)Ì4êO ûj a¯ d²#ðŠùˠ飼(Ô12œzµ¦áÓ”ñ”Ïœ¨j¼V›«ø`Ÿ03¿>xDXê öî)5uQâ曧÷¹úxKXóë›èÑRž8΀¯¥›`v¶…@¼.v»0#TåœïOv76ýV8¢G*œ+J½hÃÿâë8ZÓ~BþÏ!Á!‡¬vý‹(m\´ë•>6PŸai‡#7Ov$ÿÉî6 þcήRÖ–íXxþq‚ûëènþ¯p}³ ž#Ÿ ¶A3)‘‚†q¹z „6ï<-qquOÒaß:D¾P1ƒÊ>ñH(È5 ú:UÀ¤GGLíT™÷]2Ûè#01QtÚ©>ýûoB…ïÔÁ‹EK¹ Eâ UâƘ£T‡B]M6ù€Œ /65[\öMŠI‘˜X+ŠöDUVYçM5}Äǘ®GÓìý5ú?ÌÛ8odv$,ÓKoGP¦ÃSpPþKRRà•–uå¡0å˜]öÐo†çVï3Ñ^Üe­“È$þŸ¦k«ë­¨znúÃøØð ¢ô=MÒHZ­õ¯Ýˆˆ7ÌÝ+ÐÝßMè|KÍ÷  +DRCr4·+éÕÜèÍøWñ†Xê¼bu\Ó“$ÈÒÿê’H¦‰V0•Ûd3' {¢¦Õʱ/ ¬Ê¸A3¤…ÐB‘4öqÒkÞìvc¯zzÀ`í°`˜k¢fØÞaò/Ÿ[ßKHl°ÓLâ=ý¥‘aú;xPs»9W³M‚hínˆ@(Ï8ƒZþšÄÛרZ< ìvý°ñÍrýëŒÃ©Óñ +­O¤[BnQc?ÿ`žˆØk¥•â¾w![„ø2x„ÜïPù>RfvX½Äëé#ÕQªâx©ªL²Ù)l”Y uDN2MKèÝÊD•¨boႾÁY£ì¡GHÚ4#2Ìš¶•t8 íCx˜mSFò΋W$¨RÔRԞΡc ±½CŽ.¢•[ù6Ò¹´9V¼¼ +gÍÊê°0â¿%ESÇÝ¥Iþ\¬‰fóoèlî¸ÐȱK cè¹z·.•Ç€ï³é O\»qré_¶“‹穆e0Ú_Ö`g¿º8+g[¿%tI»ÓgJäÿ„'€ÝŒW:št… ãA½R“ÿ’¿zP”Ý?|]…”_cñïÁ£#ä¯=046Oü7héÕÓ¾d§-løÈ®3v+ªìÙ1eãmuk•6G–­Ž—»↑†y034K«Ü)!žŸQ/5é^™AÔuö2»¤0R¢mÃvŸ3õb† Œb5~£7Ÿ -þƒ€ ¥~2Ô¢öß“j"h¨¬¼õˆšWYL“ö£Z³Ì€—ÞÄ&þ2"Ѩ¾ Ç€¡v†Þ¶±u›'k¨*/?¾ºC9–Ç1ñ‡¥ÛcþÚ胛ÁcƒvñЪB£×ßbN›ZçV{üetöœ{44ž" +²ï^æý÷Š´˜yÙ² ÜË9°‰.¦–€ª¯Ï%p¦tÍævS¶ªF9ºGqô±ÌP:²I0ï¢à=™E,¿PsÈkUŒÚàÚm$Kgü$\ൂºÍõLÅå!ÄÎѽ¡fÞ-~W­‡Í~ò6ƒ+§_ %þü3•ôaT»rM[T›¥»<û À-¶ó¸~n;SdÍ"Š¨wVá¾j-ž£XßýðÔ ÞìHeQB#£ã¶>aÙ˜ÔßüYlÓÃè¦/ÉW–ÅÉX"S«:ÎÓožè-‘bºÁ¦ ¿,©‘’cä•Úr*MÛëä×Ny^z¼#™!Ë—ŽŒ”WY>£°{Š¯bUÊWég#Ê"íÙ!÷Ï õ>ød×X3Rnz~ñ^¥¨Í¿¾¢_¿`]o¶‰–úßµƒ£ê§7HÎÁ¹Ú>§Å•R¢Ù7Äà3Y¡E.ØÂÙ1ô“ëôf½Ù> "=ù°ÖÇÄVcö^ÀŽ²Ê1ŸÀþP[؃}!©"Égd½ãÏš6] §ÁPwÓì«>͈_FçϨ<¯Üà½@’Äaçñ±Þ€)ëÜ>¼P™]¥^?ëxãÎÿ\&½ìA‡®úuøŒ®n£Ïpµ«<¡Ùzb™ñ¾“?~Ò]¹†0¥‰ €Zý>¦K剧²© +)³”ò‰¼âl¢KhN?÷ª'r‹n0ÝTÐ:É6æ‚OÝLâh5dX’p+UŒÜÂý|7_ÉñMõ»¥OköÊÑ­ñZcƒäÐtûÐ…›…±ÞE^VÜ!é=uÅ"‚ MÂÝ5^å8?6àÉ +Ý/ +¸Œn4žŠ›¬kãøÃgÒu½ã%%Oäú/^3GQË]R{ø¢® 4Þ›‚ÍìÁ§ÿIñATÕL¿º†Ù»µY»1J©`–æ_¨—®ÎêûŠè;–ƒ8<ȹGŸÌñî7dÆvÞj¥ÐDO‡ˆ ÎdîO1z S]ÂZ–‘ âAwvÂ[-ö(hA{¦Qjo½2äR¦öD{¦ŠQ)…‡“èN¿7§‘9: %ÔìÑàQ^FúØðEÛm‘8b0s|³æ¿Æ•¬¶¶wøR@ûîw€HÐüM_‰}2ž–¯µç:SÚ¨WFyz$ÌèJ‘½{©ºàï8s[AÑòô]9‚ëµ «`WsTR`cJ#êïãœk´Yª¡èwY?*ráÒTEzþ.“ïÀs9l8ME{ý›Óu@©©k¸ûÖ1ûzv$Iö%.øw?§ñ(% €q]±Ý%ÝýN×`ø}ïú99»†*ÏÕŠ®@lRë¦ôÝ´ö%…ÁˆÝ~7bl­wl wD[‚ì¼ç1ã93É­2F¶*©ÀíÀR#BØIA÷Uº¯ã”¹Š$÷tbwFäÕ…`h…ͼãn_îÆÖ+2±óW©^û!7#Rçá–«Ð!ƒƽYÁKh£)Ò-7MÙPôÉùTÁâfOÍ—rÜ~z!{»µõÙâË^—­÷OÅwÍïâÏòñE¡_ðÌÑðÄ0fÏ"ÏŠû+ãb{,OPéDÉöª0Ûöv¨Å»i¼0K <þšÖJsãwòè”e$é»Ã£‘e +e TOw¼>üÀm +´ôÚ#2u_Hv)æÄ….Èwd/T-íàäâþFoHŸ¬X¬„\"U}^§GÙ³XêÏ4ÎùMEëpÅè´`1ëvïتÜòi önEoÖx½8•X›N”m‡A=XéÕ8}òÓL|*Gˆ)ò¬âè÷÷· ®ÁµZOÑæï:6‹¶1eý=݆¹²Eb¶GCUwÃÖÜðm¥z7Ù9Mvr®ò!iDðÖUWªu=:Áíñ…pJ(ÿ_±ïýúª§¨Ý*ìËÍ*kJ4F£aˆ(¸2a= ªüq·SWêJà´4ù•MIîÍÍÜ°âÕ•tè@«¤¡eRkL.Cg·B'¡¤¨D$<ãÆÍ6¯²”0†ŠŸ"ãYèÕK#×I LÈg>„.ú ˆEúu¾Å§þ*tÃé +í;ù†ÿåþ¦#=5²FTuDõE‹opó€äNašvìFp`_³‹uÏzBRúéÿ˜üdxÙ|ÙîlˆD.¼í«ê6¶5CL'gmzÐmpœ “Ð2osÈ,C›NÜsgìì‡oH4W*ŒpR’ kø¼—?õ.–xjÂ*àZ“OÉ»½QìqöG>†.ø… ίPI¤±€0y%/'OmUtR>&yI$Di©uK¤¸Ð¢J›µEìä„Çñ‡óaÒ’§àíuó¶X(L_Û =×࿺î©c¯7IPÆýÕ5½ßï6ª¼Æü¼çnË ^=CÎZ¿_'Í™ñáåøDøgœœæÂSt¶ƒ…Áƒ¦]¨{í!§ú—þ•˜¢ÂÒ=¢oGX4ücëúüù2t@Vç‰Éi­£²~,Î@æ­ô÷6§ì^=Tà‚ 'ÃÈa„}âkà\D'l­ÿ íûÈKHK_ ïJÕ>6¤ì<öIú(¦{‹„Õ/§Æâx®®èáæ Z¨FˆÉØ5ÓþpéN¦òÃŒú†³ +wíÏ ›~)¤Î'Žq ż;W.†kÏÖ·hVÉ´Ù‰GJTWiÕJI>äúQJÒ!. £iAðÅ…û˜Ï{öõj„Ñ`u$»gk®êŸ–ž'úâ`Tpb-éì…V"<+½å½{á{-ô¾Ÿ_§§bßWÃKúá,k>Ïp^ ®8¨ç'amc#µQBá⃲‚(8•†èäÄ~¤ÂQôñùA"˜&q(°¡6 „ÈV5·#ˆ9·G†1ÆÂàQz&%®2߉mhSÔ‘V©bi»í?mb‚?ŸÖ‚ªÔXsë"Ç–}»ãŽ‘ÙPÄ°+eìÖ\ÁöÏh{âF>øµ ™6›ãn|ɃŸæ{af;jõ‰×¢ö6ÉÏ^ ™öˆ½U|)Ég`Oª›¢êÈï·:嘼v?®Õjõ„»œÅB)Ô±ÒÅo{º––.)êèý×`óÄ»ëÊÍ ˜`¶KúæC“¡çKGC~ ˜1ùÇW[S¤ºÙp] ­ìîAE+Äü:Õ†{@øa3åÉdzažï-FëÚ"ñh°ó…4;èǤ™‚­>‡hšñïq¯s3Ð<ñO¾D¬+Æù¥Ó$"(Ó÷ƒÍѾÒø´¦ÔÆñ¾{aÍí\D¾ð9ùê@n“¿hå¯,c楨å Fb¼ 4¯ûŠÓ<ÿª1UË”z(ê݉°ª¦O—çþ²·{3ù¾dØ+¥ +XÏÆúï„Œ™‘>à]DsÅ{¦`±òÔX&Ò£z*š˜©± yõÆߦÔØÿ«™×’b‹`=ÚÐ* ÑU J•¿ÿŸÕœû·a`•Ï­–œ·ø¼j¤<Ô§Â+uÂBVµQS‹qˆäøYÉÝY™»‚áý{ Ó;0­Ÿ_ +Í ê?(ß ÚÒ”ü>Ÿ?ªu¢¾>y`CD­Ï:µý,Œ|?|ÜÅçÕ9ƒ²9‰­‰ }p™’¾\Áóê‹Ûø5œ6b A0“Hud@ù¤Ý¿–Œz1òæÑHöx'M˜.·4O8ã)EQ‡Z.A`΃ïÄߣ—Ûê/7òxÒ[¥%°ÿYõ*ï|/ùЋ/ÆUýÒ•rb{ „ÚÆîÑ1¨¸.r­ЗyH14N Òç&‹ŠºóíÔÆ}YÞ8F„vò®Zò8yA8ω½w+FB¦ñøR _\õBµX ˜cÉ7 åJWN´­jù× Ždï§Hvš‹!³óz' Kbw9Ç}dÎÍɳ·V N…¥Ì=–3nWáT>!Šp:™^AL~åšì|P¸l -ñÜuÊV抰3ŠÃ¦ÍõRŒäG‹QUX³}.z;qøn»¦=âxN´M*pÇVRp×=p Ê©¹—º£ . +×z ɃsÒ>a>• d…7Fä•ÐõÆÒˆì„ /¹JšËäûóùTDLD°Y# Lþ7Õ¶`mÌcxgvì8A¡ñ§$$ž×8/™¤×õ5éùè“­wÖät\‡ ž%.ÖHÙ â/›ì.,ïzŒÒð©Ë+Ö;mÈÊUp˜›ôH@löW>O]ìÕùØDnƼ^á[ŒH-µÎßö¯…vAFojü51d÷(ÝûˆûE#zeŒ4 š­ãúóR +€ +\Œå‡“pþ´fˆ¦*µ5$x-Ûñ”öDádô#ÖgôDö>~G¤Dà ;Ì´“u½¥în8±@ÎùÁx®òõ%Ÿõ*j‘>!Ä¡[£Ûزvî}쿊󲊟$‹âJÆ%F*ª+Ü÷ÂS~fåÔé³}Eu°êfE3ˆÚ À6ÐN80ýÜ?ž"¯?¨úË–¸[dV^pÓN‹µj4ÂM%"Š°€—SMŒ=£¬˜lçîTZîPƒ +ýf­F“§-ʪœÈëÕÂèqˆ…WÈ€÷.á·s=‹fx~2ÏþxÀS<ŸbA[FqYBëÂí—Ÿ¨öþËËä¤6ïvq{74Ϙê¬?t±º~|mHTÒÁ\àUh1N”éœ\Þ»ãÃ7ËžGyÇâhópŠå»­Êýµ™‘¡ÂÊ/Ÿjk²½ä¤²2Äÿ.þ ¬VtÙ;¥NÚyE,ÝÆ‘=ŒÙå!Ó»:6_µæB¥Wp¶@¸[³gŠs¹ /ÖÜa:öM¼ÙßF¼ÎýYG8$…Ì 3Iº·F|SèÁª'£k¹ ÑÒ1)V =Ę¢D_S(ÀÕrÜOÇGŽsÇgëNWL<ò +»ù„â´ ×3F0Á>ÄJ‚ŠÅ°#D¡nID¼—2††ˆnŒÌó`ë8“¿0”ºû T ¼ï •¹œÕ þÜþ—³Šz\/•X>û-:‹ùŸÊ~e*˜ƒ·€¨¡ì¦,mÚÊ—Õòœ³Ñø¡g÷Èuˆs¨ŸÆÙ‘»àÂ[l]rÄÙ4mm¶~ƒùpfõ§vp[²4èÃÇÅWŠpæO“„Æ 9÷$=áé¡£¬Å”ú–æ"úQª}âŸ2û`ײrf,EH·–¸Dׂ~MrPÑ=‚Þ/¹|ãàM¥«ÿ¸ÞEG*rØ0$4D:@BíxÑïCÔêpÙ0àÌ_+ çh“—×JŠè½/™ò,Rk:¦¿‡»4“`[¯Wð;ðŒlƒz±2ge +iKýk”½œ›ƒ4f¬+xfÍ}'€’ÂÓìúÊàáÚè-RM>e·Ú¼;lëºM\›$ÕˆÁ5vðçééIa¸º;vºyärì]Im ²oߘ[ ®äÏFæ·S u±4ÿ~aÖ••4à +C rº¨dõŸ…’¡‹ß-D…-µ²U®é×Æ5È”ØÖœçÛ–l‡Œ™´ãÁi±‹&… pÕ‘sÆYaH»Sc‹Ño­x(~ üžŽñöpín=³òê"N;¤©›pÎŽ/ÿ­¶i‚çS†ë'ꇋþ–géy6^;öî &ìvIµ`ö®ôg+¼Ôç¨T ‚k^sS$ŠÓµœ%ÆO™†2Û° +‘ þíâNp¬Içÿ$ZmβØb¦ f[Ô?ú͜㽈z¯mFØÀS3¢D,šõœ—d,u”‡Í†¾ ›YEÕ]õj¿¿ñúyUË(`œ`¼™9OœœƒÝÖŽ¹#þs@äßjpÇâÞÒ.Kh¹žµÜ¾Ïµ‹TÒz_î¯ò€¬D HNSDå)†Ýü« …'ƒ¨éĹb^'ôé‚F­óU÷º 8õg]¨—#»Îȳ4ÐUV ÞëØ‚f:œº#‹J™rø%{ºÎiË4<Ód*½Ú4¯[JßÓ5“”qivú'+ÕTÁSÁ¾ÖÖÓ#Ì‹-øB‹bÔ¿ª”ˆb¡TQ\íÆ_´,v•puçc”ikŒ¸_úÍ”^s„Â|bÑF:Žç,¨¥@1a°¹flˆm?˜ëð¿“š• ß )+ÇÚô ÀIXÝpÑmû®o +œÝ +VÿQs +apþã¿pEh% jøm;F\ šÝ¡hrxM†}ðXý‘±Q×bß!ñö¼ÔØ3º1;ÆÓvš»¯5RÁʯ¶à¸/€‹Ù }çèÛ¾Ù~ü¸c=(+F¤žÌöéÄÍÔyý¸Y?î#T>Fäî¤enÈ7]VÅÀ™yAþ°¶û°SÉõäT<‘þrïü§èë†p³H|¦è§z½¶•tˆþƈüî$¿µq9cR4ÂÖ¤]·£ác<1XÑ¢ °·¤6òyMx\Ô‘a81U6®öæÂf666á©+'¼p§>\'Á +¥(º»uÉ#5 …ÜI˜Î. @Å刞O§;"0¾·¹I’ ôäÕgbT =JrÞ¢ÔÌÉâ9ˆÃ”ðÃ{'ÓŤësp›Ÿö½V™ JÔ¤†dJÍ +šu£Í3¦”ºÍq4@×/òG‘³R}÷¢¤=6ésO%d"½[•Þ„| íÏIªÚFìÊYÔgÒ úb8w„Ô¯ú±ÊØïKÉ|”Šì^m¢.ݦÖîŠï÷ÈáÚm*ÌQê´ ˜‘Hk`ˆµiÂ#zs{÷‹ó¦€O µ·KlHo“Y`äXï]óo%xÅ)ɜ쇙ãÍp)¿„jç¾%•w“6qÄ ísžè’_5wJI8¨ø`¿ÑŠ>²Yñ7)ÇÈ ˜›ø÷~µ«n±~¾èœÔŽÓh¼ÃÖÏ8dž©^ÃAò„}æ²nTfÕµ]z%ÿTÍ4ôk]¼ú# óÈðΣèkùŠO$ÌÏÛƒ^æ|ˆ,§WtW? +E~‘ò|b'µŽG¬g߈÷í-#óÔª¾ZVcº,/TÚ¨Oãÿ «C’Ï„%¸kÜÐ öÃUô ÍuÞYô +ia'^×ïQË´ÄzÁÚ`Œë˜Á—¾ö8JÑBöãHÀ‚§Hêý+¨v¦a×ùè\ºžx$øf¨¶—˜l8.¥„œ´‹‰dœ;o¢}ÁAB`"Œÿ¬âþþ“uî9gùê|ŠGwßZÐù ­RÙ¢³cUBdËü»…•!b ’+ðöŸíiÐgâ/cGþö¨¦ ±±]–GÅ’ˆqKÒ=«…BI¡fãqh:È.¨°jÏŒ‚½"üß½½ùñÉ¿œUÀ®ú1r?xGük·Uò×ÅFQö™Í¨Ô…Ís;®«XÊàf’F›øž @Ù¸#”"`Ú€u.ãdÃŽÚZ„eÀ@Ç󿣤¸ÇffcÙò€MAJ™F_”õ±0Éé¾ +\ÇÃBìG+ÙîÇ^r\Å⛺;\` è=­~C6ŠøjhÓEÝT¾Y6íO~þLJã%GÂÁïuƒ ó> GÍeš[Ìa<îÎÇ&¦ïZËVÏ©XÖk]UŒ‘àæIknÆ’_®Q!¥Ïf¥ð¸7Ò~ˆcºÞx̽7Y‚~¬FL9–ºƒ½¥”lÍSMlc”a†NxǬK·Åµ÷§ôq´?é“á1&Þ¶óéR4Ö÷½Wÿ›Òü±#1€¨œ«çLÕ¯Óõ¥`¶æè zÙ+kb¬‡X'zÏçïäÉæýQ’‘®+qzÍYCìuÃû{iM>›¼Í,’%Ý™AýSñ'Ÿ¤A½0øx$p||¿¬”Éý‚D½æ²q§² ‰çëƒþx\p§k#žÑª Œï3Ï ­ö³öµ÷>S×i#~)f`âX[U(ä|8 ¿þfÖ×#êNuBÃO ÏÏ»²×´Ê4©z†”¼ˆiݾÛRó×t¿c‘ÄÉÕŸvý´Ø/3Ed¶ z·õOš’#ì ¤8Çáõž²ü +/ëúMû´¯'&À¨(`põÓÄUjlQr;J^k¯áøM ËÙ¹n0”sféC0¿yÙT}ÐAÝB$1”[¨XÄlÔTî­ýfÆ©]w‚Zv·”¥’¨ÏÕ"Ü,ÉKû›Сk=BÝÖ”,šG ¢]—ciÅ~'ÃÁ^T·Ò±f·ùè©GqOÈe½]SÓ–\ÏKE±;¾N…tŒtNrõœ€þ$©Zye6¶ãQú™=b–@?XŽÎ84Xlj>*7®J Y.¡r0¶öð•„ÅšîZKmôçîhçø>BñŠæÀŠy$†+«áš.!‡Øןƒ÷ñ¹ÜùÍÆè.*ê'Wó +kܦMõÐg¢2BF105ù%Í’ t䨰{'Rm†-fï.9,i&pDéâ„Æ;d: Tº¨3¾ÆðÒI&q˜u–d3¹ûÝp +°¿ñGëÉ>‚}ÔTêŒwo+…¨É°)u¸vÃ7é>êнž†¶h˜™Q|f –¤šž×$ÌD¤ÃÙRïù`+Ê£¬âi êf÷˜á¦ Áÿ/Ãó¹VýoÌê²tö…Ù +õ\¸ä{`óæsÕ%{·<Ý(§éeI¦Œ¾^ïÎ:yÛ{¨#2êè¿Ù8®r×Éwð¨}LÁ þÞ„HWñ» p¢áb*üI „Ou>­x¦ø|ë ÝS£‚xNÓU î~…Â"Âjâª"»ÒEæ£o ÁUÇ1í0ÖÔAªAAöæJh›½‚ˆµöèåi)Z.^ò3…¾9ý'¡YŸo6ÈA‹ºN'c1ß'«´ÿGœÔ×ÚÑ~^E2pT¥òàd˜µ¹6ýÔ¨@%ƒÚ)rð0Ég}áŒLŠjÐîBq„FûLE¼ç{xkI~®k‘îÈ‹M…n(@në2Q¦bô‰ÁUJƒ¤>8 Ò eNÞ6¯QãÞËú””x'YâZzý…˜&Xu+ÔetT‘HòÇqLFF pw;çÝ +-УÂÃOïD:7ó÷Èû÷!ÇTDBÐvKwq”ý:gÑ2,øýšN þ+9õüN¶£„ï-c´±ÊÊìØgTYð<éZ:Ú6§_½«} BÚºK 0§…mj„Vn£‚ ¤"黬ǚ´yzR—ß°°(ó>œ ²sP;íýäíÑçÁjS¼bÔ¶Ñ"*ït2Žü° JÐöÉûèÃ`iRñå¹ÔwpÛˆëø¾Âª_ªÑù €öŸù¹pÕ“h€µ”Fž=^ævþëð‰ém„*6qÇ’F¥Í<ãÌ„œeèªÌî ëØÿ½/­ØŒqjõ~„Ñ_5âlKá…6šâ†ÆȾãÂzô™1ùÕ?ý;AÅàª+,9?éM‹sé ûµJfl,ÅÀ¤#Í}L"L?R±YàÑ;2PõiÓ”;.±7¯Ò6ý ¡éü¤´å£J×…•JÒ+°. +E{N‘™ôƒSì'”Ã#pxðÜÈNg¹õ" `õÌ+ánÚ ¸5úžWæü-6[Á¶·UýÿŸ­Kâ•´a¡"O±³Þª˜V…º×ªà«G¬ +÷AýÂQø´Pîšý¹h`äŽ^ «¿ry{¬ž…bQ»}=°æÑÉú‹—rˆÕ>tD©èa¨HúügDŒC{ãc” +ÕÚàfö¼“pñVÅ2„QL®î½ý:4%L8¨ +¶¿©TÛvzNj €xAµþ?…4VÖ¬O™àx’ŒË+›þú·‘¬\ ¬…šºkß`ŸåÖâ·IÀ]`¬%ç¯^¦¥¦nEtBYYäßûE/†(BâØ~)¸UPÏOÿþw»Çd¿Gm±>†ø‡¼P¯G|¨o1³rÈE]][Gé©ß1J!ÛPˆF*¯>ñ±–ð#«2KdùÀÚÅyP° ÜaÉÈquÏ(«Eê}Îa„Š´¬b=RXÔ¬Ul<² ï-¤,O÷T…÷wJ“šóMeÐðYŠ‡¥vHî¦,K¾€WÇsu'— 6WŸ]Òp0UQ8®*” +/“;Ÿ9y°cßnªéUÊEµ¼m˜ÂßBt |e&ÿÄñžLXO'´î<éMôáM'–ü +/j¥ºB§¿Ül D±!ô °FFaXó÷ù «–+…„“K^,M_Iò|ƒßNJ2÷%µ§wá¡R¢ÃaÕ÷”Œoƒž5Ï ¤Ä¬QkTwRä}ÏÒp'ÃäðE´àÔ¡>I¤“KHâÑZðÞKå– Gð<¡Ð¦oÏOÉe|ë4)Ø)­·û°wÀ*D–"tüœ³c¥è¯Í[H;074iˆ/;IÌйQ»Xvq.æ®×b‹tQ¼¸0$lÔ]Iþ&1ˆñàÁUäYƒáCª×OãˆÕGuð 9ìEKè¡–gà6vÀ[sµ%oª4KÐ9@,iqy|ƒX'Š&m2üâ/³^Á»¥=~"6P°¡y†·ò븙þzX@–ŒtÛ1AËÍlG9¢O’!Ç]ÿÑä@ ß^Ø8ÜàQ¢ÕÇ¥TëhØ(_†ýyÓ´nhý‚m’|OR–C0Z 2qjµ,xûsÇeù…?Ôฒ(ecŒ¾„G|÷x{Ÿ” íÐúŸO¬ªÖ€šüHi̯õ»Îòp ;ìþ +$ ¿Ó$¥ pO¥@ý7ÜÁ[ðük¦sNÆ…^pÆ‹8c½¡Ð/cQÿWë¥pVÃâRƒö‰P‚D¹šö W ¾à¾SßÚ»@æà»Û5…;žÈ^´ªì•4'-7Ý¡äº$NŒ±—ËŽ?ú>ÎŽšØP{üþ0æÂy4j™×Û·z¦aÍ–îy`MXP¬©‘ eiù\ ¤ÃéØ,óX#cS)i8ZÄÌ7PÌ›uxT€@Ìwïý3‚L~Gbu¢ƒýð¨Õ·ÓÇ¡]B2»¹½Âj»Í5dr& ¦™=žÑs±Ä„dåB¡UK¡Ô«òË~ÝâÓzuM²°ÞjõÌo'QÈ9Ô^.åÚZ±¨%üØyZ(ÐOôOÔ&°¶v%°¶‚µ³5èFé=¨æ+*•&K}Òo…1 v—­Âï—§kh9‡ûye™EÏN!Ô[V˜GdEÖV' ŸõJõsüN‚7Csf£øa™aú”ï öŽÍåEC§L¯ùˆÐù‰ íJD±á½ 4œ]õ0|‘à^rgßÿGO™9ª€ÀWí“KÕßPŒ)»ž}ŠßÅH|VË™"U•’H§Möæ$½¢ï@ãC¡ìÖ·Vkä[lôñây®8¨ÎXKÍoÎýl*Š¶ã1¬@kÁã6¸™éêþöžht½i—Gh´]ÇnþœcŠIMàØt¤; ƒž¯ŠÃH¯1Ñ«`>–íÉÖŒ9®K•ZÂmf¤‡Ë$™ëãQ_îd¦’h'EH•£X¾y6 ³-F$~»CÇ–sÀðÿ«AKÄ,n¢èƒ»[ Ê'ñb˜ ÁrÜAÙ;«òûœõ¾bNÔ7àð¥ôµ £Ž×¡KLd­ßíŸcÍu0iþ†rhQ¶²³¬ +]Ò-îlÞŒzmñó“n]I3´ÀüÚ²M…芩ýÎ¥%†Ós[L*Pë”Æñÿ-žÅGÁ'y~4“ºÒèÎä}Òª^½’BT/å \ðZ›G%fO»ÄC !ÿ&MÊ&“×ã|)ÛÚ‡ŽÚÒq XãnØÑÜJ ŒåG-:;tʼ¯ |gè1ùƒCWÈ­ßnP}p¾ºí,Šö½]¹,ü©Wû) 5‰Â´ÀlðU]¾—`^ö(ßWµKàš=yolž+› r×¥UÿÒüŠ V”4‚Çá²ÜÃ-ÊŒÓ +nXqkýšžÆn ®Aršh©ìèœñS^äþùÃñƒidl“»_8NÆMdÔYäg§)Cûš58å6¶9+P¾;Îqͨp3F ýÚŽœ£#~´T—²u»#áÃ Ò ÐÙž~|Jò࿸ßõð]aŒŒ~¤/×;èÊÙ¸õ«›ºúîË•Ö(³ÆŸ+ÁDT¯x?S¢^Á]ÝßÓ¶Ž5°JJciTí]¨««8/wrýF͈Π+O…æ#4sãYM3B´{°¢i_ ƒ§®˜L^ã†c­PPªêÊš9Ö@bðÇî\åäÚ´ë§ëüÔ£nƒŸDžãQÊ„Lh¹• ýùêô˜í  r|ZVz–ó÷¾Î‡-ÄÔñ²Pþ’-7™©QLuˆ¼‚©!9MýN­/€K¶ÿNÈ© q)T +ÜŸ­)C¹457®0ºÒH?nNƒApPÉz”éf*òÝ^X ¦à-­ÄvSUMÆ¢‘·vÖNhµ€ã¼IÒbuBX¬_Is‚ÝÁX¦k .Û/PzeñüNß»0OgŒŸp}§&"˜Ì2¹œ¢Tw×J£ûÓú(¿QüÍIA"ð CƒYH„~¿kï¾xTì‘·jýAA+¥Èù®ÿÌ‚j2/£jÏTþ*ß ö ʽ‡Ir°Ù¤^£{xc¿tZÏ5~Á2äÛÁÑöØ„‰I‰Íà™¼ÞOgÔ¾gXOáÕ³÷Áë ‹¦@…Çï¨Ý€òÝ¿xé¢ï/!<‰·ÇØU|¬”³ÕZ€w@ÒÔy$Ÿ÷Ô¡$)}8šgÜ–{‚¡—&¬Ùî—üêö÷–õÉ)¯Ö]z’à9Yˆ—hwCL‘>Ã"íüÅsD÷ð©–›dä³4£D;ÙPÏ m—ã)a§Í£ùök³4«ÂwÃÃ4{óuŸ kï„ì-™ÒÕU -£õôàÀÿË?øËÓ%‘‘8÷DŽˆ1èW¾‘(FÄ¡_3ý顧¨ZZû'ufäÞàþ²?²²)Aùxè‘è?}³]fgáÿëÝé[xQ#·ÿ¢]§2ÿ s(žjGÊñ‚ü ḩË* äHløÝzË%©«WœÅd] Naæî`HES– ÉæO¨“½½Ú¡% +7îᑉ3¢,eKtöNXÜæœRG½Ëù(PÒôy=²qA9bчüÃѯIMO±Efj áçŠO¡ÙK7iht›’`Õ6yj¥Ç:ÉÞÍI^,ÃVIý×ñ?Ôœd׳rrìÊA`Ù¡MK©»àU?ô®OlgexzþñÒ‚j’ ·”‘ö•BhÑ+ ½xâ@òñJ6"_ÆñÖr³âÎÑVÇÙÅîàu’žòêòl È’JŽïPñocÐùš´¾¥ô²âê¢pÆRV`pj¹®Ò– Û¶!kùË€Bm7r[W±û¨á`´õ¦¿‹3—Çv|ä”›PÕбêIR"QáÞ½ÀèK;d‚,I’×TÖ†þ†õèƒÓz–h3œdÖ1nyßÈ—.‡r ŽÇÑR™Ó]b[¯³a +–< 8©)ð-w0µWë°h㺠QÙÉ3 Ã=)ˆöé!ò>q¦óüº»E;‚­ìœÜ”ÐvMª7©T‘—“ u@k9#ʲXJ¨©¢³A¡;·—{Õ|~ƒQÅãŠ){ ÜÇ[šúïû– Ý°vFáÅm‹ÚgÀM‘kA4yø ÛVØ`F®7`$*‡Ž~݆öôî8‹LÔî•T¶ÏÕ4$x¿Ý®AIPZ>åÑD‚|äëztºw-yá×éÇJÙz«2¤•:ú Xîö§ý?`o¥ÙXÉ'æ‡6ê§õÀ5Ï–üVœÎ’Š(e)}6uÊ?Sü™ò3 à+ªÓ7W—k{öý¥0`Å1VÞ)ŸáÆÑE\ÂÑ̈Ç.¼c ‘™ôzV …$g)QW¢]Ãå‚ÚÝš÷¸.‹êwáI òž¼#€m¹Vu-ö—I1Küºó&´Ýﲬ¨1­?‰(¶;)û‘E©7R7 õÈ?Š*«Ôcä&ƒŸÌâ4<±œÑ &Çw\Ìó\¯«…ÓýáçÀd'Á8–ÃÖ¤çSJPh ™Ês¦Áo…‰]ûqè9Ïic&¡þ†ÃÄVD¹¸Qj „JÊ--I’÷… ˆúN³PIj˜sÐ,Ú“ŠœÊ>T©$µå'ؽM›—Rw’9KG—æbCqܤ0ÚIKV©Ý¹Z +±at½²‡½ò®½í‰ ÞÇ€ŒMs¼¢ÆîÐm«gÚ\hú"fÁ±m½%‡fþ/6ïNÑŽ/K2Ø8G“P¾si)& ¸/„ݯ| +ùž|œÂH¡$oÌW» õùôE]½ö÷|E3î LÉÇ-?7÷˜j¿Œ&§ùÛØsaÉ:Z•uÖPë`Ï1 Óe4Є¨:ÈDf@wSV5ÉÝešòÞv»Fd"ûŒ÷ _ÈaY¦ö90Í\ˆRl@®kк âEƒ -âýÔT¼ÈaÖe2é™Íq±Ï¢‡ru`ð¨ºäÝ£&UÕáÅu¡LÚ„Y“‘ð|z9Ýå‘ÂÚÎzž©Šu‚‰¯DŸN‹ýw‹eªXkJО\øŒH3ÎÞÜ&ʾ½2ù=J+Â7B…^RÙ†óƒ?Ý£^±p‘kì²æ=å"¨5ˆJ¼ …µ¼®”Ép•Ò@ÉÀH,Ö§Ã8Ю`«¦#ªÃŽS˜ïÞðw­8µŠ›mgZ…~žWkpÆT .ŒŒbnOÄTÜ@B×k Äþ¡3·.ó–·Lƒ˜ÀŦ€ÙŒóƘeÐ +&ÚÊ°t·]^ÏÌÃ||úwÒVýÆ®?ˆ9»Öðf—ô@•:§íj#Vþqµ”mÛ +àþK´Ræº÷KàQÐE…ø—/ÚÃd‰ÑÇz&ý‡öë øÜjxÀ·wCl%Ðûè/R«½*öÁï¨t–ÚÛrÌíÏ]ôû6 g\֮Ěe^…KTha¶ŸìÌáQ{:xžý¾zz4ï¢èƒ)GŒ$‹HînDwÕx§ `úM‰]¦"ÑPöÁ¥¦?ý([ÝÕëx5&þÿHµì4Ø°¥t ¦ÆpZà4äìl;Ÿˆ*qX¼räÉ0±­NóœX¼“‚? y9xoš{Ë ‡À¨œnô=L Ë=©å^/ïs/ÅÒ~6 TÙ)„ó]y>\t)Á“ ‚ê +ì*‰¸qÅ´å’í‘CXÐœÿ!K62&÷™õ;#"Uj@ÈÌ3Èú8tëfe¼š_\P7÷`®ß€?R0MH>r?ôˆžV4KÉ•ÔÙ"úÐNÂj=dVÖ W2pé&Å5Ì® ‹ï +x3ØkðñWž²?)cÜì¼ÍF°¥¾>íÇ> +@Á #31¬X×ûá/Z( áW¾Éž‡"Ycùj#uu‰Û²hÀ§‰&4 Pµsÿu%>¯+9Â+P8;IàæÖÞ–ˆ—‹P:ü8дû ÉgËg#Du÷þ•#V(êp¥5!€1¨ÖªeN.zì嶯Éb»lýò¾ØlÈ2)¿Ëþ–Sðù‚H·PpøÚðð·Å€M“{ vv¼°Wû2=åç·g»ÕÔã5d×7;ç¼@U ¶u¹¬Ú°Wòdyã÷á–G @çÕ®þ8`Hé5*ÞSÒÓeL{  KÄæƒ&-odc:Ëpi¯@Ï i¹˜gƒ{èfB5ç‰î8àúQ +Þ co5_‘~  ØÑKYèÉFÛ#¼˜ÆU2Ák\án +ýÞ5^}’÷‰D´‘qFŒBÇŸ_ĺlg”ûàføµœÞa>|èÖú!<ºrTHe` Û‚4P³–ƒ”¡ÚÑyRæAD'Àþ5Ø­`¤£·Ñä`èû鬫Œ³ù aÈ”8¥XÑ)„œ©©À$ýo\¥'j9#åd(%¦'OÝ{YÏÕ|µ-4UêPæ1øz¥~ùÎñ[*>UåLª¦/íåÖЗÄe¹.Ï™ª½ †? ¿¯Ú櫾ÄÞw3÷²·@Ì·ìöyX™îwkÛŸiùmF*yƒÄ¸hk9À`ïåÚ„äÁõl¾¯êýìÿcjX9Q ­ Ä9 +þI7Âþix+´‘°ÅèAB{ÕùE–Wßû½[ï7ëºÔ ‡Ê-ë?·³^B uO[ô( +Œhè Ö”Eî»BÖßÍ´·âjtŠ(MRYmé¡U¶§Š&ÈhC­Øl¶GºÂ Fq>M’‹/&p£}„Ëaºê$†>äz8—Üi‰/8ŸÒðGò”¿×Wµ©Õ±mM¬ª¯´ŒÊ ´VËÃ=B"¾­$¶VTG Q- G$¼GFêx²-<öýlwäÑØ".µØÿ‡ ò”åh%Ì‹±˜ÌÜTÍ5”· vŠå¢ç«o,GW÷kAMÉLÁÔÁbqJ(@:®2ÏþÄŒo§Ô1§LE…“olKø)O„æÿšzTÑ“«5Ç +‘œ§®íZ®Å|ìœG-ãW‘GLŲ3o¹êPˆ´ïç£cÉäÉ'ª9 0ÎÌCŸîö¦çAÅ72MF篵瑚„¨”Žhð)E„r´êµ(2·ÅÚ±LÜ0I0 ½çd°•/#ëÍn”øÓ…-æújëñEš=Œï_Œ”ÔÍ;YJXËœ•Îbª8,yêÉFbr¥!ÀðΰW­6À}÷ØØò¥Ü¸¿lª6µ!;âOä•­2?BñÄX/(³*² f5@XŸèü„e ºvñEí& +Û,Hrü/Á:5$ÁGß¡ù¶’zîòåJ:øÊ%x ˆ¨sïY–t>†¿‘‚–˜x¯-ã*Uò4Z4ýç!à°a¡å¿¿|,1¡°Yžk·pt—•Îœõ‚^eMžÝÙ c¥Ðè§-Ú“Êu‘>ƒ›v™ìI.¨’šYž3ñT¹kH{U¸y‘å_IeG/3t#˜ÖäjÃ=T8ª‰P2}[ÓYŸãNNÕµ'qÆ×™’C£fF+öx‚w×O^òÐ÷ùu«ÅáMK$Ð/ +š»ßþ 6ÉÁXã‘áþ ÍêMù>Ì/Ð9ÎshvøI½íZ»É2é¶>ËŠˆù_&~0œÛ|‹Rºmûȃ­l'_Q:û™   ±ºÝ[v‡âûhAèE5c½ÀIìÆLÑ*ÒmíåÎ!½ÿ"³¥m’€;ßôe@}ÔTùú‘È=ξ Ã&°Êp6T¿¿˜ÖI !1üâ„ûG»éçŒ!L;6¨§³¥‚E^Nœw‡M‹Åݽ RrDQd’çxϹ‰c +%µPÿjŸÓ½!û©_ù´²IÊÖÌ3*Š¤[¡ ê59Ôì¼F·lFÇs“¢¹*À¦q>o³³sÕ†…\i;éÒ%òìuóÍÿkhtœ!T¬ÒËN· õLVq¬x3ݸÚÞحĹ¯¢(ŠÁ¯—«‘-s›ƒÉâ³x÷ÎàdÐM ºo(ºnq÷ë—dM-¬¦7ïñ¿Š˜sÁ5Ç+|äɦŽèª¦ídësêG|ã:üDïk|»ßCaùrTˆ"ü\œûé_ÌwÐË]2›/—f†è‹'/ÄD¤w’"‚ɸpM4Ì•©Õ·¦‚’EõÈàÌ$lp¾ˆÈö´v®’öæÏÓX{¦—×°¶ý5ý†8¡½è’´î²„âú÷«ñ•Ýœ®£âm:RióŠ+ß2iز»ÑÆ(}Š>nÆ’ο2J™q9pZ"kÕZŒšË5]é5ŸH1 €ôªQ“¡ÆN©@Û;€/¿Q;¯ÁÂõ©n°ÝRü>ì[R*Žh†¯Ò!΋`ÕfL5“ÜÏæ1jš·‚M[«ÔÍßÅåÊÓ©ÊŠO’N,±+…€B~Ãpx„U‘ÖÁ +2Mí̸S8¯öõœRÉqñÍ®ÀŸ6~XNÖŸ37nŸGݘTÓçU@0Å¿èE(¿fº9:Šðpðº¿RµÅ¥þ{Þ±¾‰mœn¸K( Á‹%áátæTb“‘Nóó³7<˜†¼N»”t]Î|­ô+™²¡ÓM¶£¶%ýn“†oA¡ó°0¼¬e'Åq–gEʞPru2²F1Öœ$<'¡!¸}±Ð3YÌ›î>YKh.CÆZnjáì®dßJëqeˆ„w±>Cý&«¹èíX8 çØÁòËòµÄ H÷òLÈ8~¡#oj +Χ·ÃôØ› ½dcUzýŽ½[_‘VŽÜòÝFS(ìâ/öéÚ.“’yAù@ÐèìÚÒ(¼ÿ§Qømêœf¤å”Èxf½Û6©i¨_ µ„,Œõ§tªh0‡ŽÝôsÃ/CNFN6¢“ĵØä·¶stztkÿ¦í*ÔÝVí΃ãÂúÎûõ k+¹v¦ F:·€Y%DDZŸ©ßäìk².!ŽÜi®JhbX©ÂO¤WŠ|„€ŠT/âˆ9´.Ñ­ î¤F@&óÎÖïÅ›óƒàÙ©é8 ¢.'b$e¸Æ[4Ì+Èðµ]¬ÃgQðV&¥þJL1d˜Ø»ú–Õºƒ5i{³&t`8 1F@4öXU†l•~J<Î9×ì³»âëQiÓŽœÛ^ëÚãs˜ô’ ª[üXƒý_‡‘ +BÎ-×Ý”2—püýRR¥U“„]«ê'{°1™?ŠWô¥1Ïîј lÖP“k‚ ÇÆìÝ„ëp.œ¯\’Ö™VØA6­G+‡=ã~t_wÒ¥Ÿ =ßà2p¬ yÔG¡„Oo§4ú0axH]‘6ûry¯˜×äI6‡’«ÁfÝy ó-Á0º kúšî™ö +eÒûI;”Zì§ÔA©_ÚˆPî%R`ªoŽŒ\¸sîVù†àQvEšs³›»lW +fh¯Ÿ˜ ‹¨KÙ5¢7r 1=)-ËÙªÏ·ÿLÅŒ³ÁÚOfìæŒ éø|œ›7’¿í€oê…Û¿ŽÝå^4ëZH8Oí>¨9Hf°çõŽë.ËÞ'µ©’¹5V¶SV•dq¸`.×i“亘¿5¦ˆ¾Óê&PI ʳï6ùÕŒVø‹C>å-žÆ2^ø›±8ÖЀӺ½ç½}öÉž»Ê^>0DlÑZ¬ ¡mùΣ@Ó‹¯ˆuÛ|º‡-`ƒÓðÞšA* ÅbÈ©æ“’oÀ„Õ'aw¬T_?xTž€¼£OàbŠÙ•ñ†üpK€¬b¦§O™›#Iuâ-øûÙêí «wÈFöÙ‘1`fÆ…HïDËdðþP­6i4ï!l²ARÌ|eå?a.Á ¸ò•!zËì¡ó3t¤$v%êŒï¢µ¼¶iK‚¤¨lÿ±þ’ÆÎÓn¦ës»­ŠÎ};“Øç"jû±ï)‰"µ ð;¹ÂãˆçSð‰Ëe–z9«: Ë'{sOï§)€ðSg3|•| Çð§òÂB]ÓÛ»8ú=KPuH=o›[ +%‚NÈ“9°‡'˜ð$̸yEÒÊžMûu%ÐG—U­Bìú­ÿ¼¿ý‘Á°×r$¶C‡6Î8N´FP¢Ï 0óšH bvOÄ]Tèñkn.ûk‹"Ù…[Çî1’+rEU°9Ó¼ŸtðUÆd]›x$­k‹H$‚»rÇ<ÓúöÍæտͶã JiÄ-™2ŽŸ=AõCÁég/øÝ·GHhîHúÓœŒ€¹ãn‰*8ŠÓf~ý騥È~œñìýý°M{Ãæ„Ø÷ñæàÅF+žuÌ +fQjœMØÚÁ€Î.Å[füšëZ6 +^ÛÿAä×BÕäüùäQKG\Huh¶ÖŽŽPœ¥\A4é6vàï(fŒØw„-!ƒoå.HÞÔ¸óNëÕ7á¼Äu- â‘e"‘„¼Ú÷>°ÓÚÅm×<—Z#LGaË{rèN ìܽðT{¶þ Dƒ]?c:1à™ Œ íˆà[“ªnŸnŠ¼S”çç¥Ì`ýn X.ºÛ¶üC`R‰”ŒåW&7þtq¡çÌy•÷'}kŒc~Ëo¥~eµX×ú1¤kÓ¥qBÍÕXªK<¸ÇÅéëþòúÌÄJ*!¦§„G¢/ †+d­ÉLÒ¹*g·³ýã„Fxn±\ +¦nâaâ›#n4µ»[º¶:oWúS–ö«§•'6™öѾê+|Uë¡mÊz¿\¹6ï +¦¬x´ò÷÷`¾„A“ügß|€Ê¬Î b³.ñQ8ðûò»EòÚ|ÊH¢Ï{UnÆ )ÜêûðùÔ´â8|K\Íê ®iI·GJ¤‡ ©Îu…;†Åu„°´ŸGÚ$ 2vR—;“š¹ÿ¤ßú½SŠHù2ó¿óBšªÉRñlG‹ÿ‹UáM/¶±0(ƒd†5¤Ö·óñõ7~4ÈÅp£à²ÛCÜâyô‘u +-gåØPWC`io`ÀXýyÔRµÔÛ£ŸÂóìð.çtwV´NêÇ…QÞÝ•œ´Ÿãc䥞7ƃ‡Òkd£3®§|N‚þodŽ¯¬JU®ê4Æ£©Îti,"dbŠR +RNN¢ žRÊÞ<¢:o8 O¾öíÅñkÿÏ®/Ô¹±ýG8áMp`Ž,ÎPD¡ìÕùîŠÇé×ÀZEïÌ€-€ôyõ/‰W5Øù ÊjÎ+¸Æ)Ñe‘‰Ì¯±Fˆ«WqæŠWÎiæt¦˜h#úD/ ³‰¢Ë"*ª{©PÇ“ºÛöƒòÀºÐ¹ƒ10ÒÙgë'@Á`µñj)Û2ãôÖèÒ«ßÎø< ‰ˆð¡ Hf|?¦«rCç›ÚwAYÇ[Y1*ƒ/ó¾4^¯Èñ²*]£)>À†vú­ë,Ö‡‰i°OÛÍÝξ:ô‡þe7@2£‘Çé^7ݱAžêœsÑIqx%¬È`î·Z¶#ëz‘ +wÉý¼û™^)±…;"£6¡ÉîÞz®kgpýDh¶Ã¨HD`6«UG(1·|H•Î×T•>i”Xå†âl9AC IYXÂFV.¹1˜Ê$¥7h—,ú@÷V^O·A JO8ý,ïoT/ËNu_¦5ªŽûˆ{»ŒŽâÚÞÌœ%1ˆš•ñ^V¦Ç$ŽdÜf¹V> NipjuªÇý瘝B£bŸÍ'þ3·ÂE¬•”‘Àí[*læ «Q1G€]B0bE]}fXs²þNJö_y*O Áh+´5ê6‰×<ò@OËq(Y‰Çr ²2{{”Õä?£ªÛì“-h¢Ä¿@ýùCG ½áâï ¢Ÿ…¾Î¡Ï{™lx_æ¿ñ§r8î‚Ôö‰ÊÐÏÂÜùínè)¥¥¡â iJììáC|[¶ã¯Kç»9EœQ5W0lz8¼i·ž'Q»ã;᤮ÞÝY…Ìa½"¯jè–f]ß–áÉh±Ìwœà)ŽËýG¯à\d=´ðµp5½n«þCùÚ§“¿X×´•Å›"È>ó]Õ4@ô÷¬ˆA‹4dh-–vΖ8H“[J'¾ é%…½„·róš,c*Òƒîd£Ò§̇˜êC[=/i›È]æä¾À_&,öÓg÷¨1Y¯,w¦àÛ¾tD€4qîžÚ€ÕåP/S0⡦é%S¢Â0¦øÆAH°U‘MPHÏÚkÅ6÷ª»àI(5úI’ÈøÈßxS +Nƒp}‡&fæÉiTèÞÎãtßs{±y¼„.'ËIQWzÓ[¹·¹lhå×m +)ÏÀ« f)Ñ£­<ì)F-zæ($ÕA7BkÖà›¯ºŠ¢”¸•Þ¡ôèZwÒ[Û¾ÕðuÙWÇéH¼½”9±}0`ýð½4CýÊ:Å âÞMóþ™Gš³×.¬ÚÎ4{î=Æ19"=ìÇg}ጆãÚí±ÅÌP}Qºÿ ß‚Ë>‚!9ýŒÞLékü1—V^ü”4åò !¡uŠ@W +Œf0ÜÝ¥žÁ’.ퟴp’¯[¨eÂ45È@fr²‘ËÒnflÄH}†ö ]õæªKÌ» âÄÑ·Å%\ÕóecçldÁã­×µI©¾ãLRw|€5Ü7ƤoÚoá°yâCr ¥siü—E͸áà ¡ë‚Þ¨ÙK“-@Úïi½šc›"Í—ŒºÈ¸v¥'ùìZMȉù¿â!Ó «;â;…ž¥Mí +¯z®(œ+±D +1oI>ɱ˜ Ü/©ÑBßp¡áËiþPäxŸ‹š÷§¤'à­³ëPÓ›ÖÙ®€` ¡°GaÃ!Ä®ÊSG²˜ DÞþ>!ü`WÇ`F`´„ãV×Ð¥š…ÿD“Äd‹/nÚ’«$¼=*žL}ʳã_€¦‹*1eíB[#g4èCbš_4_,ïz¶–í¥¢VÀ癵òõ=ù-™åœêØ¿”êÊ’‰ŠE'”’£E;&|¹î]×é#Ú^Ë/mv—ûffÔGBí!|J.=¨<u†RÎéB½Ofƒn¶@õnøM”Ùù+x ½òqâ²êóz °zùð-C>¤-AnÑòd+(Ï ©æ+'bÊñM¥‚ÌP¶Øé{ÅP<áüDöÚk¼ƒ$ƇÖ¬ŠÜ÷±˜ë—KKdA‡yj7³^59Ö• Œ§§ÌþsShðžå±¦ÿÒ„Ð{ðï ØI„ošêøÊnQ˜'ݧœÂLñ¿ÍuÀL‡[µ¥é»ez8A'ÑÀ…ÐÈ1á¿$ñÄ)aEŽÌ; ͪ;8#·­7ÂÇj9ý¯?¹¼Ä’âDÈÑ"ooÆ|µÜ²£Ý.î[çÁr⬅'¶ŒFZ¦ôNn׃`Ú·[A½£•)©^X F£zaþ'"S¹9à˜„¶C.k¹¢¤Öà²ABY^ŒÚÌ a˜·Ï6¬ù zEH’x³ÖÍ€Gc\C[e¸X) '«lá®Ù.È3Ò ™ kü¢¯ 㖫ƺñ–fâñ3k…©H1,­7.ø½¯s’É9­ +XüŽ6Q–&åòÑßl)b}uÁ[Φ8"-«I½.{ð&oOå(ñüW¼7X©¾×ªüum~¨„Á§Yóž¨?÷ï7ÍÇÃz›ÂàrÖ#ùó÷¦§ý©ÏìpÝ-Õ÷ 30µûâùê™)Ûu‘ _òg`dx3 ?5¦œ•ÙØ~ùÜûIôÞ…©—qÕÂÕÅ:a7Ÿ¸DØèeÎœW§  ÿìšy êe^²ÄÄÆrGƒ ë Ñ飬ôX âÓ½ö …p—H_·GB/ÿkÑô¿_` B]¾OÖÁîS82ƒÚZ°À†Ð¹™Æóm(›®dZE6³ +êxÈ ‡í¤e*Íüáɶ µ»nκ…§K)Õ ÝáZí9UMæ=d^®Ã”e;LFÙg9þm×ÄÖ¿™å}¥f“hL|xÄ«H» çoŠ³ß§*° 3µúô»µãû%º”G`-w/¿@¶eKš‘›ºZ{*-ZK:hOŒ¥Gq£îüù̯+~9E0‡Ÿö=Ü0&¢f ['ë<ÝÒ&Ù áû#1 Ëg³GyN@&¤U?×NÊþ÷t`B.;v¦Øv¹T=ñ­ã5ý“á±CçŽ"R”rã¥^KVŸ¿‚¡Å€¯¦hSrl¥¿‘C]^ô\! pAÛ¢O¿*xf¸¢¨Ð­Ø:¨ûL³•@.tqOƒþÒyÝfx0·;tò¾o¬Ó¨ùö³£ðñ¡›_*.YµåçxzŽ,Ev{KI5…Þr@’ ÇÚØ`W͈r¨£<ë™°%ú ¥6ƒ¯5búü&‚77¼*+ŠÑ6.zDª!öа³ÀEr •@ÿ¶î&ú測x³¹ºFw-(/•œàÍ!è,ðͪ>¶ÿ=!47¥c¹ç Æ›•aé¶ Ó­w.¦œ+\S£³Ñ˜t-? õêâss¯˜¼³¿Eä'å…F€†å*ò>+Ð}h}ÕH#BAdü}C M€¿qïúq³héÌ%³%×-××ç÷ï¦ ùJá £D¡¬¤œ2FfD˜ÌƒSvÈz‰3©¨ÒþÛX¼å¿õÆÿÇØõõOÖõwawø]ý.]qt•:‡ÁDëIëÿÝŸD¨R b‘ì ZIDÚH½Ø:Рºò¬T—öP9ÎjÅ%÷ìl¼&¿A™oC™eúëÏ»$(å7A; +¬L eßVϺ«CÁ/â{)sœp6~ªé$/2÷²é»Þ†®Òñ$.Ú¶óǬ,U¨AØú:ó¨›!Ø'5BG|Çœ´­aÊ#‰1È]Ú@Êòe§Ý¨þá]‹ùBɪ”¶H"Áb-$åûî°r-¯·ÿ‡æËÅõsiNïÿ÷ÒN<'y/ÿëFº—¯ë± ÇL<°O4šxb[¦}hu–è}q•~Šß'BWH¹chøy†·mtîû¬þ\XãNÏ„L¸¢Ù6[r*À« G=3ã´´S­!­nŒÿûÒvÅÛ&XnÃüÚ5=¶jI4YCT«3¬µ§A¼üHzt&o<Ë»¯p^ËX1ðfr°+6|-ÇåœY9cdnyòX˜Q(‡6ׇ¥¡‚£Ø2À½u¹±ãJã•gâg·uZS“?0ÕÆPd“fù}V(ðg‡¾|ç”%åUp±¨–s h—–Õ£ ߬Wâ+ÊŠ)’‘‡ÅHÅúº1£Þ\š¿çd=«€K±H+\¤“3ÿ7ÑZnjãƒ@žxOG,k~óÌîàŠ¶´‰D +§(S™úÎÃÎDn—Dä×Ëä©<²}<Ýù¿jÒâ+wà»0J‹kôðèýº¨+îS›$šÚ'_ÉçgÌP4ÌðókUìú%Ga±¿ó‰CSÁMÎÊQ†”¤X¼F¦B*DüÜ >¹Q¬ÏvH¿¸·ð“;ºD½³~4ÓÀW9KGwtß-fçe:¹+¨KÙ±;”6m]ð¡÷gaUï=|¼‘è¬ìœµa´ídͦ¨3%–„!C¸…-¢¬b—9Ónl‰¢¹c¨dä4ãꤠÿlRÕ›[¹4 ; (‚LðÓðùÌ$TJb¢Ôb‘ƒ£—MÏ¿jKÁ2ôC`§¶ÌŒ¶¸ÖâÅë¾ñ@ÜÌLJÌ 'úçÕÄ/ \}@–IP6Ìì-¨¯>QZ9€¹Å«læ>&ðÛåɃӲ"°:G&T\ݘçbhi“+´ôje Ž±Éž£Ì¡‘Š QFýµíbU4k?¸W«;”mÑ5˜Ù²gÎS%úúïis4ð?¶šo\…ï©=ÛAÙ*Væ+õâ›éF\¶r)äŠBEMôä~¨1)ö7sˆ6ê Ïè0Î!ö=–]›OÔÙk(}°óü} 3°a2»o}ýµùEÍAé±öOö6¬ȲëÿIÀÚ›-×~ê|ÉLÁÇêX²fŠzæý̓séa¾/ÄLÛ~!1úÏ~€-ÊHP4AWKk'8³#äÀºtÎ'¥Íõ] $Ñ„xôZ=’]”)œ‰ð³z9ö±4âK@ÖŒg{Þ+X–ÁÉóŸîáÚ@Ð)ø«4’DJã²|æ:>‡T/,šòNhÐG’jæ(I[õ51kã¡åc”¾“zSÈDMUóµ"¿ÞƒAq[_AÖ˜ó)f„¥äŽSÕ¸‹¹ãP5Ûƒ)™=c†×Øh+¹PŠYÓgWœcgÁÿë ǹsÝ”.|þ@6‘*´Ëá·†s%Œ¯´|ä ùvÄŽ„rÞ­¥B®Ü¡àˆ§ 8FØSs‹Ëös1ÙâÙž,³ìodjn#q÷Ô^…dá…–ùáàÏŠ âQùßWã‡QŸãˆCí±Pñ'íeø~PÙ}“Û.Ó~þf‚ .ÏmÕ9™‰7Ÿ>^ÝÂÝ"Ó†«V3²§=r&C×ÕwÂøèó2u{š&Ü[Ïs=2-x ^å¸{z˜ö‹ˆ«yÂð–Š8_7)çì#øižÝFD tÚpƒW¦¨‡ÿÓ¢ý[ÙQ9}uZJJmí¯­EÃ…àö×'ßáÉA·v&É,ôuOòi¼ 2 +ˆ@ÙÚ(…ð² RH]ç*óøÂÆ1í³|xà–b.jÔø)Gø“‘!`[nwDDªçÞ´[0z+îzSZ+Ïê¹RÉ5uÞbˆatÆlÃÉõ!s-_x»»i¼0K&|#K×E—–«êtz¤òÙEƒOÄ:T ê­ãv®û‚Ûôì~º± |êi!ÞüC$€ö!ï&¯DIGm¾fý$í¨T¦åuáèÛ2M¨fàŠßHÛ€#˜x<‰Uüº,»˜ÝÖ¨?F£ köº9ÅÈDéM4.a·¶þeù6orGGx7ÏrÔų64*8j|(•ˆZG¯>ÜOdãÐQD•”GÅS‘ÌtKþZs¼Pù]Éó9Ž¬/¨,$Þè,‚â8éºÕŠÜMòzAe½¨–íÚäðŽÀ{¯Nõô¢)âGn¯Ì·¶³Æ›1xi1ÂGGèâ#l\ÙK¨îöƒf]´Fä ­ GtãÆä£n(Îtc`2 Ï[p†•/™H÷ضʓ@¢h[&!Võsdÿþ‚"°¥O³üfþ é‚ÓÌìóŒåÑU?b¦€r +Ò +,oÖ*g¤_þ%ñœGú¿ù¹i`Â-P2Ý”µ‡#­­¾¾aOIK^廈ͼaÜ8^²Áf+Ïý‹3‹§ÿäj“ì]DhåýÅéer[ÉË%v7÷ÄÐ'Ü:ŒL³9żê=äüšTkŸøhºFƒU†VMšsÜ¡×v¿I˜=ÿä;¿‡Ó_ðŸ¸ÚF†*òQ¼××{J+ÄÂ8?p@~ZÒ/±µ—u…ÿ;0*|0jâáaäÊÒ*]Y“¤³øs›Z­?…¨ÏäDîŽ;_x1”eœs< ¤ÌÓ‘–֜һXŸ†+ZÀÓ^î*—ñ–cÿi57MÇO]Ðglì »{vqÕsȺh \hz×7‡ÚÎü`×Å–=Ž²ÖòTáü22æ¤F@Ÿð2f…|4VÑ¥Ú‰ÙtH2’<á˜×K/­z§òWÑ|L^øØÓR_Tu#¢Öå„ Ÿò0±íáñªCB‡Þ¾šôõ¯ ¨W Ë‹.‡ÉçT^b_OÖ ÅÓ Ä/­á{­XÔõܪ¦”*ˆÀNφ …9PÖèF·)3Áâ3ò"aur–ÎrçÁÖÖl%— /*Ë ZŒ$'Ô¤@1…nºŸ Lؘê1þîUÀÛaðëžÕ^ù[<µêÑÿjfzˆ]¨ŒnÙCòÖ°^EJ‘38ÞƒæÞ[àÀg›Qç)˜Múv‚>OBßì/â]Ù°v¥k ã:mL`<=È¢ë¼u/ãì—QîCêä‚2XL€:©ÀäO/4Ø…ÑeÄ¿Èà º>ÿmh·!^LXNÉPÐǽ¤e¶-)³9b-ˆ® +”ê@X™÷DÀ¯‘©R|±_÷qÔt5•(í¼W鈦5‚ÑݳÖ:—wKÝN- NDóª«^&q>qÁ£Öp ÊB9ž[+ý%y:Ï40_þT蘭Þ*šCuõ’š4Ö¸0ÒúÔ{ÖJföÂ[³z‡±Øà¢|‡p×S8öíÖ{ÍqvÔ 1 Õ4‡&‰#?úÓFMºÖë¡Y¾§ÃÕ¡Âõ‹ÊlèýÎ"ØE÷ට¬yè™ëNÐ~Á§-AÝb˜ Kžµk'hölR/«]÷ÿN-RrÌ6$ŽºrÍSšø•…îM'?ý:Oü«õp7IR›€_åUöm†ÓXr“‹äùSj9ðQhCÖ¢›HœË~‡Cèݪð‚­7•.È2´piÁþŸ87¿Öˆ ñô^ˆ…"=XêÄìíõy;Y +üp¾¸ÿXiBqÑ ñ­Ö¢Ï\?8Œ[ÊÙÒòßØ9[–åcôüÔ·ýW þãÍUKŒÿÔuÄaóK´®fÐÁ&û\ŠW\ÎЮämOZ·ö{üª”x‹Šž H_Ë»±ZK¨²Ù@ÐÁf Gv÷ÑE\˜×”,Ô8&Dûf#½o˜:íçožW×ɯã%f=òÒ[§ÈsfžYñmw(úT–--D^ÉÔlx’#C…5ÏwÞ~Vì!Û—~Ï‘ü,ÜÙM£¨ S SÌЬ¢ØÂ;°JÑH3³à2Ež’ù‡ ¼À·X–‘‘‚õŸºÚ¤Ÿ­ÔΙ­ï¾ÓúŒÕ] ²“µ**X%]™ó#%tßííë­ø•!Ì‚lÎü+?×Q–Z`Š.1›_C juá>ïøÉjâEßx©¸j.wø8obp|˜@éy#ÞT÷%þ]™÷¶ go›í².ñ–@Ák«ë™^…K-Tè<Åb[U Qý ÑTÇ”²&2L.F‚û3K÷˜¥ø©Ÿ1ª@d”Ì#æ¼X?ΰeÈð¤´WôÒQñZž5c¾‚Í©…¦ï\=Û¨çîS|³yÚüàJ2 L×J¤M•É¼qÅ®0UàïV§jc]þòYñÓ1Ë…Êè=wÙ£è•bæÊTºb;Ü›ð!QseŠ½f\N2Ô¯D÷L +]§°]/%ƒ[*Iç³½kÖ@î{–Áv;[ü”=M¿ÀÁ:d½R%Q«`êAù«ò­W‘Ã+= ö-ó¨ Ò²^¼ aÏÜ‚Ju/xh_êãL“ëgÏ‚GÄûÀÄZ=!Á°Ž|Çö);ÖOFô ‘@N‡UÓ<Œp¨'8[ˆ‘¥ð"Òìïž¾ªìŠ)ÜóîuãÛ /Ýg›ƒ.+µUŸßíwÞ¿]¿Dàè«[2£è)Ó_­äîæJ¿ ‡Sö!Úˆ[{ÛyÙ¦3¶‹p \òç‹Ü¡¡ŽÓµŽ[W¯H[? 5 9©Á®oK¶uŠ¾2.TºöËeHÎw¤â›Ãè*Ê®F2ùï:ÁBG‰D>ÚîE­¨ «¤17—\Š_§›P“/ÇG}±—·å{ŸCXK!àØ%Œ1¢¥WvBš1 ßºìŒsç “ªéÈìî/àr³áTÞi5ç곌¦'“µKøäqÝ! ÈF.ÁÉ\DË©]—š²±_Rù‘~Ô”>Ï-xß’lA_;h$û*¢ ÙúN!U^Ï3yš‘÷¤Íé/±?²ååp¬ðÍëË^wÂùNæ#V[¸+·¹Õî*Ž„Ô©–Os¨ñ"Rz‹+VO2\W}_1Æቖ”Ò¯¿«÷ysžr“Ÿ'ð¹r§ ö1réq"žÐ.‚ÆÍÔÙcЙ -ûöþ3gq%÷ÕÑÕß¾rø¥`Œ[n³cÇ…ìÜ%Ê…Ê„dŠÄŠ× +"BŸâA 7P7‰Æ²EzXq †¿¶ûìmô†øÑ3#Ñbp%]¾ÌlgÅÁœ+G!;ÒÄöÓáös9,"ai,1;Tõðéé)¾ ˆ*E´™­ÐÁû-‹üÜØW«-žpÌývl²v86m©ÅÙ{Ì9Ð +BKrc¡·¿–8q2ÚŽi­»`ðX)9çö‡Ü†•+HÙ‚F:ðòL%w5ÓýœTN–“ˆY4EökAf‹eÕk ;E) x3F#ýóDa_z§¡»œ¸ÊŽ0 ò–ÑÌæ3½ßŸÛZ"«þZ_C‚«Ø`ùò>ßÀ5°òß<• +5òi>Š&¬¤/›BLÌl— ];øx–%+÷?"kûÚ-t¥ÁŠ„ðÑÂjêàŒ:÷dg"p×4¢Òl;RœÕìUø­.e# èBèaŠxé;Xz ISmDÂs• Öÿ%m"&4¹=Ù(£ÌW„áQ^·D +l$–¼„ê]‘FCqA¤fW£ÈPšç¡™¢zÀwKfcºÔvc5‹ uå$™¶fQI:e¶;À´·9‡0Q¥r: R„±‚Â[l3í±”®±è•ž@\ e©$: çhT®§µ?êÄÚ tõ¹¿tƒ¾ôä0ÿÜ,ëzÞ(€çƒ5ÚrF ¯Y„¥‚ô@áTÝ%Сß% lxƒAnÐÞã^X`NÃüov÷Îë”gEº{zÛv;ê=]¼]g8µ·kŒ-¡åƒ§ùlÜ6HJã5Ûx·6Ãpõåå>:§øL5©~{šq½sp[ 6ê‹kZ¨=Dr`(–`Ó´G‡£8M7hÏèíLÐ)1ù‰:û™¶** ©PChÉnèÌÉÄWþo\KRµêýdæí=iƈÀ¦K£Woò’Œidh¤ÚRýN} \âWßö«#óãìüõŠD'¥Þqaå—ß0yó@­Ên +®…?#ÊìfÃÐyè¼{;€‡UfþäfåÕ í&<çàæM¼o~™СלvéÜÄAÞUÁü‚ɾŠ?(ÿd 2IñQþKa aZü5$ªém@þ@ +Ìþžs×]aì‰lQ7Q^'<–=>µ‹KR‘+‚n4IÈ¢6åšþP*ô¤±2bª-$u2Mü”L4Ù`ÝÖr×aY:ê¡2,Øå5“ü„!v‘ÀP±©„'C©¸í/2Æ_‚}‚¿_øpV@mP;H=[€Ûcq5ɳH[9H“̾גRÁ ٘ȸ<ôúu~²Ü(˜¯V Òè³ p÷WQ¶€|ÿ/°Â ónâ70îƒå²šèÀnºì8P—wμÖB~*¡“X z½›UºôDºéµ ì4£ÏikÔ€iÐ)Û®àá,¼¦36„l2°ÕX:+ÊrX\V + +l¡8ËË⭤ŷM`+Ê.QñÀ 4ÊT±qφB› +|B…ÅÎOÖ¬Ãp5ÒyÕê{¿»^·³µÄ¡éE¥ `„ >—û¡gÅÀö˘4;¿¯éŒoŸûö‰´[Áè!Ȳ8p6GI§ja¾áy½Ü¦Ò·Ö¦¿Œ¢aL82IÜ!‹Ò4*Ù–ù¼üªenb‘2 ¯¼$HD! +ôªñžBîºv9„Îó=ýr)9çUÍü,aÅ[EҥΥ¹1™rí5"׉ƒ÷ÔO½{©•Bª¸HB}I_ ¹ô{^*Ï  þ†÷8÷5‹þÒV£Q¥1È­ºq§}α׉֩îz¯jMúæ-ü^ c)$ÿ81 +¸Ô‘ÑCxÖÈ|lJqdD¿Í„¹@û¡›„—Ìkøsmœ‚±¥,îÑA©ª®ä=zIûV¸I«O´ö¢…PMÑ€ Âcˆ™ZƒÂ»ÊÌ[à ‰]SÊ6¸–¿+ 7,&Ðœ +뛂Énòè(QyÇ4¨dˆ¹—uÝ´m”±&ªÜ5²[¶èŸ6ïõÞMWÙäø‰ë0^¨•Kf…€càÙΨxæLiiÿ`.T®›yI:]hÎYŸx*±³7¾Šn`¢$ŸêÖ&"Š©œo3ýüȼ£_UŽ6 +¹9WÍŽ ø¢Õ\¶»À®i´{ÑêëÌ›&m\+ñ®_.ÊÁãÃ?©/Ê.X^?jÜ÷ñzŽpzÒ†mnkçn¯¶ª½ûr¸Ø_¡|HסˆÐÉÃäÔ¥}ÌŠr4Çj¤ð}çvzÇ|'$:ÇFPʳœCÆtÓ•»°­4ÈÎanlÓ^ïXˆ Ðn;?Í&(›‰™})§ÜÙÑ(ðWó½î)92œò©Ê|Ô-#­ö7r&§ú×ÆÆEקˆWõç`ˆÑÜ1¡Õ±’¡·lØÙ’¸t¸¸B5¡“愤ê{üÏDÚ Ç§ÌΓ­´3˜ûZ yàz³ED<¤t~gôñYÐËûâ>×ngÙn”h…ÃK.t1þ&‡Ã‚óžBqy—¢ßâè7Øq•\U¡XÄø“£6x†oj¼ˆaÂ…¥ DuùCžˆP»«?•2šþ“‡ÑÖk/X“‘º€·ó’È NÉÄ÷³ø1Ë9’RÐãuú)ˆÌ€‡Ò¡P¯Že¤*wM×ÊÅAÔ!T¾IæâÌsíf¯–O¯ÖŽ ðkvâÞV%ÜÅ£§*T¦*ØjÌ1§}µi¬z”*h×´(“§oÌ€.#‚K(?”0/+óÎ8Xßçœ ªf£‘EÙéÔ‰òǦH=ó·³”AyQüÄ!Ÿ _M‰4r.<ÿ1þ¯bÕÉßE©ëû ô¬l Þ™?f 6{Ú¨³#ž¼97>ÞÈVIgë>µˆÝ®ò" F\<Ɖ·ÿE+´'ÐíGÿX»q­\¢pThdDp›OÝxeÏz؈®ë +î%"ÊË}¬[L7øàäN»×©6ÿé« þ©JÆŒEoU>µÕh¡úÌ;½¬×îpg•W90®Ð¿L þ Âj[y¡¢ÍP`‡ Ý0üBó0nñ|âŽ1ª,kåíiƒ0€¬u': SN—Ú|Ed<­Nõ>óŸÏJÓË'änVö‡SÔVÓM¬ +“y‹ +`Å߯*uïî‘tùH +“EóÃÓß #¼$b­ òj ÈÒ¤Òh¸ë‘Š¡ÈÄ?€½3 cY$_Hx.¼PÆûZQN¾¦æ[jÿÍ6¨¥*å¿éN-tß„mÅ(žaV÷ØEHím +·wX7k…Ͻ–£hFÓ»“á‰Ö‚<£óP7Ï$ܳ "¼çKO]À)1ø—0¼T$¯. p*)»y| L]¯6kdfǪíÝðc€çr\&¤½øP¦¦ ˜B9Ë°ü*QVõ"æHBÂZ ÷G´tlÒº—ªµ®È s‹Kd﬿ŠY4Ææ-½Ô>V³îuM›‹Â½îæsô½„gG|âîáÀ +›Ñm!}e-«£é™ji™tÒ`'èÚ¢ÛÚ›l¤‰H±d0õRZ8 +x)‹õgȨʪ’YTõ_g !IÚš ¦Vw{Õh¦p«Ï(§‰8&p¶ =Z§üùj6A¼­0ËåÓí™Ùd6õˆÞK~Ž%“»gALø´± +C):4FFØqîCX¦.‹TþA=í5ì‰Âfóø¶œ&Šn&y\AÙwÞàyJ|·þE·W úß²ª‚AèAnÛQÏñû±´*4ƒ ôû­³¼/l—¬šfÖòå$†T˜n1dä*FcÅ9(4ò”Ø“ZÇX$i2ÅÓŽl‹+ʷѶ EÀÅ;ÁfÉ Mi¦!$m#-˜C®o yOŽ³öèñà‚þnåRJ[N§9+²áàÕìlž²lsêÿ‰VãWœg;þÄCÚظ×Ô 73ò‚©œ±Y^É ’1ÍJɺžÂ³¶ÛT—¾£Ü°ÿº5­®=8Q®aÎë¾×pU7ÓᡘŸÒ“D%ëêø ¢FûY㥜ãÌRe†•¦5„ ÷VŽUa RóŸºÒdu6*wÄF#ñ]2…ωŒT´=ÇŒ#yÊ›'R:‡-t4u§c¶h°/-áüSô¼/O°C=D63à8qÕ–Y át( ôœ©ÛfK/™0º#_ËÌ1Ý`Éå$‹ò)†H‡ô·8¢ˆuB´¢ƒóáñvÌõàxòNBe§âúB †“I·¸»Þû£I™>e•‡ÎÊM®§‘íÔBÅñ©$Ke¶›nfúá:ÜG*‚;ý¥ä®Ò`ÝE–Í’+Ô4¼ Omjo¯6Xš­@‹ruÉÞ( ȺcŒ“zã7±²À·VMÖ¡§[¹æoªÏ ëvB|]gÁîxq ‘Ãß’æã†ô +MXÈ%ŽW~VWƒ|·Úr‹ãžd«cB­] ûÅÎýXä˜j-T‰`.ÍN +-e]zÔØíƒB˜à u!*ãþOÝís£½4w@QU‹ÿ{ŠK;üõ¼­Ç×àÇ0Àý—Ð1Úù1³»ÁBªzˆ ŽøP _¾ìOÑWóœ³õ¤Î‚Vq—†M Ú +D¹ó™>ËcVø/“¹ì=ê^ÔŠœg}¾ždÞÇõ ¼©òÇŸtD,ßiÜUåÆ_Þ;ù"/ÓhšÛºû}TûˆO ‚gŠhnÆ‹Þ™/—eߎä²á"ò6÷¢äß2l.°@„ï`€aŸì.ö«Êóå&ööÌáwÙ‘ý‹bW:¨Dqا€I¤$Ž M•^)B¹ŽMrC¯' Q“Ø®)U}OÌ„{Ni’; ›íUQĆ‘°“XÊ´+‡†—SqVÞÔ>ÓÖÕqÌmб MSbIæó±ÍUíqñR3‰.Å€‡èvúÔdƒ'Wbj°¬Hýá‹<š‘Hó'‹;'Ë´R˜&Ê>½¶ÕU ²Z ‹Ïß·þ¥r቉A#%ŒOrôØY°é0O¦R!ëYÄ5pë°å4K»ÈeÝÄÓ{ªÒîÏ+CµL0`Û—Ùeî€jrîÜvÿ¨yåbkêuÜCÎCŽŒª˜s«8˜(›4ÿîT!ë1°ö{GØæÇó‚“^jiBRÄ“ +­ÓÃ"¤®\ ÃcÕ ;AÏÃJ쬟;–S€A¸êÞŽ÷ %wèVGž i¬VgU°5 0ÛÚÓ‚6TÜ—”Œ›¬m¾"RDúRb±Åô_]7ú>dܘb~o“‚w•'Øý »Ò†öÙQÆ+¨}Š›çIþ4£mU6|Äk–1M+³^ ‚F—j“ªb¦=ô˜ïBSŸenB*ðX`¡ðÔé!eIÂ2ÑA`ºV æ¾ÐI$o[z”¢Únð‚Ãz”MÞÉŒ¸8Ä©šë¶ÛÙž*Ôص¡¹àó¼A ÁñSI)VAˆô˜zç'Þ…B¹Œ?óÐW;EÛ½jbQá’ôa!ùõE…R“Ëéå¿›К¹ÿ&6DŒb@°wuó}&M‰‚&E23|E +ì­ïÖ IïXo¢œ²‚Ÿž<,7êvl葼 Ù¬ùúTyÔµ"û³<€V°ð°žÍž#à9ÿlT–ëú®.B˜ïÅ +ÀˆÑØ1qk_dn|žš1hß,{îÔ»Ë%G9·æâEöÚç4ÆbÞz­Aßõ´]ßgã\…®^Ñ¥ C]°0æ†XIÃöºM{|${l.2¯9½Wuœž?(hTáY-!nl^\̪°iMµLɨ{WÈS¨Sö-Ä}XžZx:Sõº &ÚIrhå-æ&uÙ©½S»Âë›ÄÃâ…ÇAèô@ÿy.ó$³’çŠÒ„¦BÍ1q:Œ8b.ÔŸÈÄáö λ/¥ j°ŠÄKle7’@ÈØ} +QÝI'{?çX¿ úl[?›V ’‘¼,áô®°€Ö[ÓÉ)5Gc‹Æ ¨½zT×E­›Ëd²šì¯N>©ŠH ùšƒ²nÿ—Gs×I}yhHn•óë-¿û}Ê^pRÌYþFÁÙ‚1(3Q|¯æ©•)"Q ï€×Eƒ#Æx­Šp}M ¡×- ÎíÝ2á&ƒeV‹Ëùâç|Ųê^ÊI’eˆö$„«à?ɪ%.¬Ãu59]ùùÚO³týòQ5ÛuZrî>[ÖØ2B6xvJîˆ×¶}mJ&áðâwU5Ϙo\wïÄfäØÇ'Ñ)ƒpY>OYZ×æÖ ÁŽº„)X¾Œ–6©éý”O© î.2û lìåp)T„#Åðô +„MìfÆ rž<üÔEœÊö$‚Óüš +wŒ,f+¶G×|´:V}ê~'T °ëÃv zZ÷Hg9½yý´c¹ïðþ’2î%JÑEQ[ƒSàS`é]Ê®"`¯Mv"¢dÄÁXÒ]ã¤ðd5É_£ƒxÒÚò]‰†‘E+ Ó'§JÑž³…·:(qßIq`7DÉñonÏ[#Ö òJ¨6Ç)Û`^»$;½õ³í¸C5àiJxöà]ò«òL€(_W,²Zdy°j.è¨&oxõ1‹é³b8s<^ ÔÞx´:yt0ç>ê,ùçU“ûùŶÑÄæ«[ÕAŸ8«Ïs>¥êIMfMÊóùÇÔOéÅšµÆÔÇXä,Ó}QɯºQnßÄ9ûÔVjÒX¡´ ‹2$•A·‹—n|ÊéÖ‡•œÅQÓéØ*N[ +J÷3˜ÆµŽÓ0œ°ÞŠ¯Á=¢Òßß®[oÂÿµQEñ­E[ù8H#$*„fü€¾pGÎôÝ"XùÁ4æÏp»Z%Žgù̽sΧõ—i©uJ vFÜù€gr^ƒßä]CJÀ°PI.m ¡™fu¬Oàš\Q^!‚YIIe¬ñ™~PO*Rr¢ˆ¥©´‚'ÃÎq×T?]ÂÚéŽã°•{ MŠò< ÆB•"\•/ö[@’R%ë ¼7øäŠÂpâ9Çç¶)F‚qൢOn%~ËA@#³–(‰QšqÐyû«ƒ e¼²É±¸ìßY¨¿›R«¼P–/Ä\p`„NìC·„ÜMä5g[üðÆZ@]O›E°?ETJó¥cI&6c©ßm9—Ã8 ®{2Š‡ŽÛ8Çå+©¨kÔ²R ’dû3©EƒÕVAvíÉRÖÚs/èwöœkä›RîÔ ÙC™Êu©Eu +ðr±žB¥UfÁ×:Ö‘-ÐPNÝg•9x9˜)”˜ãѱªÆºÒ·‡‡ÙlpRÁQÍ7áç^e¡2-Ì|aŒ 뺃X;_œa¹HZhðÄñ®&yK8u9èYº«;-¦fnC¿ïÕAYÎËËã’h1ÚÉw~‚ÙÑÑ6àHŽ/ÊA¢fŠ‚š!œ‘“ŒV¢1§z‰3˜ b(˜E¾»MLÝQh ¨nQ©óåŽ×k¬Û÷0Z\Æx¿jŠ 㙜Է7<Ša÷*Hfæ#æ.¿uUÉ °ŸOéKëa]ó(‹¢˜TëÈöŒØfùR±5N5ªä4|F®ûÂ[€ß2èã$ ëó(ýÿô~Çtô®·`ùÁ+cÙf8µ3åkÔ9ÿùc?‰0'_)ÅÙ±Ÿ)¼çQ\.ÜühUq¢çYX+[ËÐk[oô^|™ëqhÞÁÓ%Y´l´ÃÌkü8TëkNJ°HÛ¤(‹žg!LŒ<±zÖ!žÝ†ØךÌiVÈ=B†DÍöô¡#£ÏÏ:*‘4t‹0j"A(ëÝßötÄJ=¿O~` +˜ÌóôpJN?oøû·d¶Ù«)©7h™&;‡îð¦îÔ\&„¯¥ÌNóV¼Y G€î]þÿ€•¨Š¸¾ìß¹y2È%}ÀÒ¿—q;ÎEHEÁ—¤Ðvª“ßÜ¿<_ãªZÊÙ¾òúo8ûÐd%¬¢dD®ÇÛ Jalè6’ðíÑù'Äs^eí8nR¶ž5½0] )Åú:6cþýÆÆ‚^ Ù†#VJœ]£‹ÖùÒ9½»ax_`lR†Ø o¾«ÚÎìüXϬú¥¼OZl„I8$J”ëgûJößeN‹mz1èÍ6œz?›è)å­ÐÈ Q³È o/ïpÈJz/!»sHÌéÀïªüf zðZoÀ¨âÖ’@YÛvLy—“bD3óÑûT§Qlª˜Œ:Å¥oM,«sÆÞ¤ £ñ«øïFüµõN7¥ÑŽh$âg +ô†$f \W$®¤:¢Æµ¨¦mj§B“pùAR*=²‚È1´•_Ô—“Å×gØD&üÖ¦S¡ÍÆ•Œ"ÉTL;®ŽŒóøÊ»C³°EMQ–lR«Ö®ÜÀL&]öÀG¨åÚ¯Ò>¢&£ G ³c/:ô¨¨)°rÁ¢$½3, çt­Ôlö®ßïž÷Íu>˜Úê©€÷>ÞMšm¬?Q5‘ÀŠê‡ +UÈfä!¼ñ}·"Žôu¢ÔÍŽÿa4ãÐĶYzîzdiŸJŽÕ›Æ'CR@[°wË5 Ñiˆâøù~·Ž£©‘²ièXEJ0¯´–@±”•D»SN€ôp×ò?™Âktå<^]—!o€Mñýµ×Ú²°#”'åÔa_¸ªKV™iŸ’ún§‹'Ì$t‡Ý–šõäŠøÚJz%Ši­?"1®ž×Çl‹A'É"9Lì…ˆæk+³2Qnï–IÓ•ªØâDLÿd8ëFò4Fÿåçþ¾n5zd¢_“C¹iŽøÇï7øŸÓ¹¡B}ÅŒŒñLhôHaW¤–·Á73u +¶½Â•;ïZÍCaÄáù®jmvÒÙÏ#SäÎåÕÔÉo·ÊGgSØ[{ò!£«Ë Ýœ½¾ƒ¥ï¡$=æ”4ÅíC96q®/G«Ž§†Iå¹YYàAÜ—ÐJÜó„ 5kx´'–*˜=œeÎΙib„¤ìý[:¯ŒRÑ»¸ó]§¤¨‹'ÒG"λŠ6BiÀO ¯]æ¾ú3+Ä9Êf1M)·˜áåô³¿ÔJžp§_Ñ»²ÐŽ&L¨ÈÝ|xáS‡<“˜ü®ö§ñù㇦8œ©‰§C*Wó$PWøu +†½q¬ºúü.pVÜ‘ìbmˆ5wÔ¢@ví|âðÓ„,ï¾f¡!Ü9öŠ‰±<¡ºãÁ«Óç̲‹^¹cý¡´mìÖ{[Å‘òw%VîúÇeD2í¯0áˆÂ¨³û­Þò49.U«ì÷4Íb9mà®ç£TÎÞwMyu;g\ w!v3ÝJ{ÿƒÞ¤SV±úÉä¤q쥽m‚ ŽÉúƒ¦E]õ7 ~ÝÛŽPX2:±ßÈ'?êÏÌhÏRY=!FæH°È +æ„å-b³E•‰I½B‡2í£K-üüü¾¸³U^Eð§Õ¸šã¹Ä¯þ_']5Z˜#B¸ÙϦÕéØnˆoŸæPb  éEè|BÁ&9’$-šñk]V6XcÖêÄЄˆ _>s{»“Øb57?ƒq)vœ‘otÞ©]*Ž:} ô$AhëÒ :nÍZ‘+Z–Ç0Ûa«È]^ឺI™Äæs—×Zàâ/ƺú +(Z½Àÿs~P`¡Ão>rÍt”Ô™ŸumŽJëTÄ“\í=>UŸ`OëBÐN¾ÙkÉ$P’ùšh«2鋪L2-¨Ê«õ”wr/'QzÝ#{ZdZËw +ÞþHu雥i “>­ ®_?QáÐË°ÿ"¾ õr¼¶  ~q¡³äE ÞV•·Œ¬]ó7¢{Kk¬y1óAÏÛÌù›ïY¡yÙèo 7Z9;ª©0L©z“w%›Cn×^ŸNZÊêÞŒDJ–ëM­ï—åµäY&Åh%\4ßÄ¥ýOk á¡€’ÎO3ˆM^uˆV"ŽLÒ‰Ÿ«[ éÆ{žœ šÍå¹BWš‰0ƒ•³’}æk?@NxbrÓw/›u¾¼’ß–šùs +¹ï²bŸLªét}ò2B@¡KŠt!²1Ê´m-IG0Á;íRÂ4tú˜Ô×Z?4¹æ‹•Þ1"S°¹¸AEµ™‰Ÿw¼><…;wle +0¹€€æ ÂÏvPîÄl~á9ÕíHþ$8ˆëñΠ¤­x†þCN`0;·ªíS©-èUŒ’ 2Ø(Óo{~‡šg¤3uh®LÊ\FÚÞ·z݆Xl<îÙëðÙŠ¡™Ê5FL4¯Zoî³.x›;9¹4Ï€rDBjK‰ávÐ +š¹è”¶Cauñ +£!"I[º \çô²®‡­‹,íýÂX}G@Q Ç÷åÕû ¿$ë´ûÓµrªåÞád]ç¿ÀkÚ’ — ñüYó’Ø&õ¶c—-54-q ‹b(œ1=üóÙ;§äŽ~!‡ÉÚµ‰»AŒÌœäý¹…§¾¼x1ýE7§ðí©g;³š^#óAÎÀUÎ?˜Ä~ÿÆâ(; [ËÈÕ—_´5ÂãsFÝu¦7n9§’§L‹E©Îrr/-¶Ø²xWy—1¥Â}%pËû»Ž¥ë£·<­ëŽ!ÒôÃLG™ÂpÄGiŽm†¸?O(SGL“ÌØ&"ó¿ÙÇg˜]/<ÜI$¾P~ëÐâ:Éw9 ¾¯Î@ËR¦Uãh#U2–p¸›]šá@€Že ¼Q(›óÖÛÕKì鳧¬¢7ÕÏùR, š¾Ë,`€Ïþÿ2òb›ˆ1pIÛÍ„¢æ³ybµ)¦T +$àAÔ¢Hÿ¯§»‡œoÇorh= ­“·+Ø ¹øë2÷Ê^-L0‹U­«+Ä¢öÚé Ê Ð12 ³ì+ ìvJî$[mN¾îCf=ì=¿ƒh· stõ½æ@KgÒV_EöV…”h‘T`‚"÷ ¾5°±*øßBŽWÒdÎ`ã^Ž[!Þ£~ÿÑ÷F¶Jäp†w³¨Ø¢$Ätô¸˜ècÕõŸ×ˆx°9Ç?[Ï?‰Û“(’pcÜ9ïlhýÝxí}à‚ÍUbјa°®¼n¨‘ßôÿ_#|Ò¢Âm€3ÝÏyqé!Îæ´+*ߟ9DÎ'ÊЋøúÜ2=ìEIß/žJ'«#¤Z(!ŒZÔ—!}êØdÓW§L¬ž‡7Žß¤øø•¯o‡ø*U¸ÇjÔƒG€™BÓ›ím€Uaj ­ž-š/¼.Kr×l…sô;›,ƒ IPA +•‰sîUýœç%Â\åwåØ+Ó´˜_Î 8çÉöMg[Ú ë“ÅÅ™ÿ¹³é?äÄ+»Äñ6{$:E\—œÜÕ¢ø˜~ðÎR—6P#&°P.W1¤Å¬˜•É!ÒçGV÷‹9P}ó]@[uTÉc+·*Â?\ò¢xÇOª^ÓK3ø˜‡H‘¬t†sðc02€EG…¤)r¿õ0?s-©ÛIùjøíàŽôx²òiŒÀæA¾Ú³I2D9Ñž×`t¼=剖zÉVC¯¬Ú¬½ðþĨ³LáeûÀP<·*\#| +ä,ÝžîÂÂ8U»%v GoįÃÈ›ÿÀ¶Û yxƹ'^)Tãšã®Ð—äFÞòÂmf{þTûƒ3ØußRƒ2ÌÖ©A‹€ngݬpj”=z¨%õšŽï-‡úº¿„Ùˆ‡}‡œÌk‰l‰î ›fn–°óV|Í]úϳ¿›k±Y˜°(·O”´ÅÊ$»gÙ‚äFHÐ yjªN)ÜryLÎÎÝFÌ\]:Ð +ûÛRô•l3ÿ$\'…1r@Oü)„ŽQ‰veä,æƒE:_oÛ`7ê5(ž%lpD3w<Ê^9™"…zÁäŬPú7V4ÇÊ…€—6Žo)•#:O]æ¤Éó/ñ7`ºúŸ™k8ýH3ë¯vNWŒò‡xÉ­˜ï<Ï!þ´—X„ó:°ñúŒŒ«Wl}^Äå³[Hv·2›lhhq;?›Ã=E}6nñ3Ô›ÎrHçµ÷çÏÜ,2Ò^/{ªdg8Aè'¨KÁcJiqÕw(À?>߬qô„üQVõø£QîÒó(/ z CåÄõ¨]ã¢ñªÓøZŸpßϲEaÿxÿµh'ÑA#çQä© +=Ä”XgÔ{›±Z°®î@üMÐ_Èþ9åMsçpò3¤§¿ì{.³èm½WÔ >oÙÔ:[þFzoGŒE‘gž:¼¦Ì¿ä2a‚¦Ümòp€0¤>y„ŠÃ¹½EãÔ¤¾Ž É;ôÁÛéÑTbZÍŠ››WIò™n2:½÷<—á)¿ú|WÉþ‚Þ¿=¼©òh~J…Zïq ìndb-S»¶â4Ág[Èsw(TòØÎ +'ʉ'ׄ`ýnÕB¡Pƒ™ìâ4†ù„"²=X‚ü&øø.䱧Щ¯ÂŸAÖ]ǧ÷²˜ZÎZC´Óżø ±2ÜCçðgFöë‘m4«92¨¯/÷cØf?`z¨–¥ë^Ú^¤góAÀ¿öÞ›p7ˆ“iN;fÌ’2ëáõ5u ñ¤¹Ý=`§çÚªl®šwã²êœ·bâר/Õ­™?ÌOyç ›'Í+¥\ÿõýU2ê9!ñBÎ_0½ !7ž1á¼-ì÷À¯o8O\Û85úÝËÑ|zßJJÔn@«+Ì°ª)øb + ×Mo'÷…-H%¯ºLˆé–*Uª¡ÕÍï/ÛÙÞ8@†½\ ¥SÕÙìõ‚Ý6fþ[ûŠÇ'Fxg8B,ü4ž‹èû_0K Ní¶Ÿ:L/œŸ +øR±.¯6hV:x”«‰Ø9Ë‘Epb_ÄÖlºìLçiˆ‘b0)¹°R©íAhÉwŽèrYèK¹w 0r‘C4Á.vú‰JiKÑ_ÑËN=‘§ã¯•t¼ˆnIUJà¡û­H R˜6 ^~ë±eó(j³(  êfšfêÅ€P?E`ÒÞ<ñBÑ°+Š$[º¿¹b;àLøbz:Ãm$éªHQyã|r$åFÏA‚&b‘ª›Œ:®#ÅR¯FË»D¬½§ $;¼è`o>œ¾lwBOÃ'ØÿÞ ,Ÿ²…IJ2»@3ÖÌy¥‡ì¦É‰°ŒÊÿ• wµ%/ЯD#ÐäóÉczÈj°•tMÝ°Ó—­·ÖŒ² ùDf ÉƒI¤2®^ÿÀ¨ÆšfúŒ)¹‹`“TO\L;:¤kÕØ°m™f(âx`?”*(søñQ¾óõ&ª‰/ú;¦ñòyô´ÞL‹A\çlrW[ oc·'L¡ ‡µÌ:P½ÏÓ•CpßZ•ᾆÂíG€)5äýÕÁVЕEŠ×£–ÙžaÉMÞ.MÆÙûÑ«Õˆùûg’ÂkÏ{¹O 9Ç4åŽAŽÜ„É9²sÙš%Få’®înÊë"Ẽâ*’‘y;Å´ÆwŒ’[119À숸í²]ƒ’ÌO«á…:o0pµ’¥ºVIçR›˜à¦bü6›—¿ŒÄÙó÷»/Ž¥8§[\é¶"@°Mxž™zD #’Ò”¢+ã“-Ç»8 Y´zйè/ÕyåÅ/²Ì +ˆ<ñ‚ˆ6G­¨€â”Tq ÞÁÓTf>¹°+<É 6M)· ¬„r¢ VO˦— wŽ_Ñš÷Jéà‡ïéæø7v,yšL4Õ\Êí1ÛÉvÆ,n\qôÅ¡¾,foH2R0<¼ä`§A8¬ÜHm2œv˜VgËùíæöÙunº O 3v§þýL­n3“>±˜ë-(ÍCªX#`„ÎK…1=O€YÞ˜ä¬Ma‹ô{›ú!W@ÏÑñZšk>MŠ ×,Çl5¡#Üv ‘>\d(æxrHÍ +?rŽ„˜EËPÔörxóºâQÉ1IɪÌQµèÉ°a }l°…½(åk.8(¤eÉÀrâÄɳÄDºO¹ÍL®M™±ýðg2>M|ïÀD¤Â{1!>ód{u"¦ ÄSå±hZW2ð€»@#&wÖýÛë¹›RíØ7m¦XAjÿwÌB:’ô¿´ÔʽÐ[»TpÜ–Éöª8d©‚/LÀPÑìzÉûbK%`†w”§3áñ±@Ûqær¯Ô:Û˜Ÿöe NæÚŸÖ(XksKAeû‡{×òÅ2Ù]¢Æɹ®žº]r©¿õNseê‚ñuíƒV³µZòE9åƒiц[GÇP:€mF×·÷þµ Ǿ:—±œ!ò¥Á}á¶ÿèò»¾ö£ö—uíc¯í€õ:taîu¿ž&RäÛéø²çqŸ¥|ggSfÕ¨»Äbt a0€Iã÷U)è·ÐáÇsp†ñXy9h$Õ&ÿÊöeHfšaÅ$±lN¼KU +YyÚ(ó·åcÎïf3Å­¯é_>’¶:©hsÏ ØÁe‘v;ûÁ( ¾¯ Áïµ»oÕü<ÑG„Û¡ +&ò²Áx*¨Ë˜œwâ‹a +ñ…ü•Ç‹;Ã#C¤ÿmýøÛ¡Þ®éhíØTÀàÅ>nBõ1”9ºÆÈÑw2x\­õóÞwê½ ïnL6›þR´ÿE>2O´¢Hm6äbð€Ò á2ë¸ë˜þjGÌÆœï¼ÆM“á©ò?ˆw›¿›(m–N‹ˆ­ÉˆY`W3ºÒ“ˆßÕfÕb›x …a?Ôè¢ý4I'hœÏo‹ŽfWT{!²õ>f+¢.¥È¦Çƒ+’}Ϭû"??´sê¿ -9TÍížô}Ú‰‘С/OůƒÌS´3>·L tŒâ¥ã µ¤ÿ â+¦g"§°„úç5~S'Ú™¡ö‡ìL»MÓ®ã‘í€4 »ÍP’7Ûýó55­«á2Þ›jøˆﳆâšÜB„opIÈŸdù^S`û(¯Ð6hˆ48ôuŒ/oŸCPx1;ÈÖ…YlªèâÇì’½¥5›äì¢Äÿ7}‡,z Ÿðøº!ÀÎØåÜ(SØ_Ó¡6¡žÅ žãø’A +qøÇØ=ðBU<ô~àÛôË0YPçz9¥x`!G¤Ì°àSŽÆ P•oÔ周arrξ €ÎHt[Êö«Ýe1òöº +)WX1N$‚Ò*DïÿÃGWSGR+îø ì ŸQ¼œØç°B‚à³ÐjûÌ)åp)Š}³åÙŸŒ¸ 5£ ì‘eýG¨b º‹>æ™Ðk&39Ým¶”nPÞÚ’W ˆ+`.¥‚NC˜(BcŠ²ì^Ôgÿýå:ÇRc|¶Õ"GÙH¸b·/¥|À‰é\KSªYó(¦Å­þH n@âG³˜\l¯b\&$vþ“Ç…ÒaØLJJ®aS:¿ØÜä™JsÎ-ËÄ‘rW"¿ÄÒ6ÝÂO/† S˨€:#ÿ@Là6:¢Ñ¦Ú®¬Àù=¦K¹$¡¡g_Ç9ÏÜ^ä4WqnenÚ÷å÷+gÙÊ8ZœáäãÆÎ"Ø +Þ+vA -RÙ'ð4Ç8ƒV…`“dR+ ¸Ù¶U:k‘ÓCˆnXžµÅ!å’a7u+¿3Ó‡4™Û&.h¤ÅúÃú³8P®©îÏl. +2þÅ +4v±aßç)±›ûϤir| Ÿ€Æo¾+²Ûs;\£k½¨ü9Ë[sÚ€ÝHh81[Y WN©ET¤‡€< +>¡÷í£¥ÂS.ˆQ ìè!;ƒ +ÅÁÔ×ຠýs)¤7ðƤ÷ ’9êÍL%šäáQÿº}' +:|sAÅâcõËÔ«a’£ _hj« ±k7[ÂïŸÙÝò]8 +Wvä@ÿrîÃðŒMŸš9E4ø!ýã[J4iô\ϸ:©ïtP”@ËúOY«’ÌJ|ZË£*]DÍùWbÀUp;gfD¬¿ªí{Ý>ZJƒ‡²¢J$ÓÂ+}e´V×p·iåÂaµƒ9ëFq ®ŒÙŠéŽ®n9ÆQ.2Ǩ²ÓÙÏú&T™ªÉ©r:Ý#0/ŒsÛ› +av'•C5ZNÒ[¿¶#š <âÖhŠ¯#´NoDɵm¼Þ¿—É«í n`ªòžjFs|ÇÕsÙà×'×é|+’³—uWH'YP ± ¡³ÓTË÷ÞH`G²Êi‡¡fñ¤‰ëQ€2Ü”Ät&9…·uÒe/xNº†Ëò”%¹ÊHë°7xW½™Z‘.*øæpUO¡êÈúôqFÙ¬+P ¤„ñÆÊ{0Ïý˜xÆ-ÈÊ ¾y-¢Ã ‡ i:SëÜý÷"™BØXÛµW§@¨rg'2­¤KZ3ôhα& +y\nAR}òc‡ËÛÂ=àÅ6 +Ÿ`ï€å‰þT®·Ê?=è#ß2ɸ8þ¯¢tŒvúÇ“«/‹ÀæqïÍ÷¬SfÏž;'iFãÈ•¤iDj@'ˆ­z/,íâ$xìU EäZ‹Ê6 ÷ƒwf)«LÈr8Y9mKîBX9ãóIbÃA)9oÓ4 ö+»šÉ*J}ŒÀø“äSâŒdÿ¦›Œ ÷Ãä™ÇﯚWÿiEµ¥¤á1YΑ¢ÃÐaÒV¹û&G +× +*ëkpäË.ÞÏÁÓ Ö„äù•Öóy¶q˜¦0AÚÙÐ_KÏp*£Î¼ÿ°wûêŽL(Ò”Î+?µXp©Ùû· ê-âlIÃsBk!#3lÃ3Bn¾òŠ(9ý}”1×ó¶aò+´U2©k»B]fø( û¨¥:zá)gUÉ› Ëè‡&ܪG‚ÞäëïøÝú÷- 2÷äýEû£ך¦Ÿ¶­AS€&åb€BO”wq5òõ„cî¤GuÑTCÄ,jzQdÕ~!yúu¶×ÏIý­ñªÚÚÜáPÕù§É¯ +Cy{(›•º‚Â:â5ÒL-¸}PUÉ“ â‚lê·‘G²AÛ}JôÙxõŠµ&(9ËtDãìbª|™î¶žÝ=ÞJbr§Übb.ùuñ’ΤâÊ›Ýî‡0ê÷Þ7´6Ç÷•'…kº ƒñ›Ž„‚CÇïÓ¡Òè’ôÐÍtK縢¶_»QwVÛ¦€”Lžhr 7 -£ñš³|Ÿ`f5ŸüŽøç¤ñ»²ëŠh&Ä +÷Hê÷ô•DÈTþ¦zt=PWþdrÛ3"›šÿÑQè pŽ:ƒyŠj¾{í$â¼ZîÏé»~bÞ}ÑC 'ˆ@¤:Ljoc8.‰Žëf0[fW‹„Û8I5ÕH·«8Íå_åصw1 ™YÕý)±PtÖ†ñÀÈf³®­Ÿ‡ôÑ‘+·_½™èU$)^wöè¯4ï/³ák™¨¸1P¶4Ïye ®Á­ù]™ÕbßS{š c3'ŸéœœœC©r²ÓI÷JrìÈ[Ì—R t\©þ•Ðèo«m¡x·â½×¿tN»»wòÂÈJñ:ëú"‚Iý³y ~Àm÷Ð[ó¹f7b‚Ò:¦g|<AR6Æù@OUêTØ«Lý¢¿ZÊ£Š +TrðÐœà)MŸ“[ijµIŽ»æœðµHFLKäm™¾½OTR¾„´K nð›vÁ¯¿öhwî(þ\ßÑ\õ‹øêR®~àØ{©)b™^Pˆx&^ ðË_vŒ#wŒ–W›IÜ¡––a„Zš)€gÝv×P ñ3Ó¨\dÜîþ‹ŽæýI7šÐ§q 3 ,ˆœ\X®ÀÛÃírØ͉èÚÓH!­ú=Ó vý=4†UsÚˆÓ¢M1LÝýrŠæUÄÙäØ`¢Í©~ÜQ¾@Q.4`•sC¡æ×¢#¶iÐ'{Ú”Ocy*¿a`•î%_Oº®yâ[‚a,øÂíp~Öÿ•Ï¬}î7ƒÊÿ©3jRÒü’!=Œ[&}èwŒõh‡èI5D¯Ëy4럪FZZuŒXÇCoÿ½Ô€Aw¨ùÌš”s¼“É Œ$÷²âgKOóè^^[­Þžá¨*¼Âp¹Ð™ Ên`ËlWåÿè–! QÑ8ÆÍKš î›d³;wè¸)›ô°cp¢±ßhœÞCžà”§€Iø/]RÀ§í-ü‰‡ƒ:MúãÙ×%Ý«¸-¸´¶Ñ}ŠÞ©Q ±©s`ªÀ‡§¾´â¾ Nw¦G±éS\þÇÚ®˜£«¨;o"îÛ¯ëžúþV»ù1ƒ¾Ñ0ÝŸ‡}8+~4”+²øÄ´ä?yº÷QŒ;Ћ +Ìò~%&v' iÑþ«îY$êƒhÕø0L?GèaºPœáe>=6ß!9sÚ<%Òýë$T_s»gÑm»ñä¤`›ï§B#@5—_@Íeðž Bâî>i;!vöÍ9¦³¦Éz÷ƒÄl”¡”(Aç9\,ï\[%ÒF€M¥iåÑ@ä‹¡{DaË’³GsªûÛÑïhdÄÇÅ®¨Çžc]ùgÖøl ¤œáDä$ÜÌ’)¢?„ò˜Zwèh$¿N`Ô5¡3ÎßÊq»ÅdînìLp¸¤sí à¶j¢ÜË1© [Ýèn ¼ãs,ø"/4¸„íΟÁ$g™¥lÊÕ’Ü­’«¯’uú"Õ‰§V„àÔ)“àfƒŒÍ«ª«ér<ÕÙ—¨Å#·hß^’ª73P S‹ÏdÝwvsWKrÖ¾.’Í@­yÖ»­ É&j\gà"½Á¦»®eÕ:s´8Û™¤Æ-ý¡}eE ñ©>z1ĽIt+¼¸xC¤&]fìC`9ºZÛêEë›Ó¢Pó þ|Àš4I½ûiß&׳¾Qײ‰B™ë¥F0¬™¨¤ŒÓÑ÷„±QÔsˆùuÏ[I…á®ZF>ënãMEœÏ›ÿñI#”¾d…Ü>LìÙAU&˜;"ÊÛ!ŸNWÇ‘ŸÙàØ”}×ýŽÙ²ž.¡± ¾ÊÜZrÇF £Ø$·žMg7RûRw¦»FVŽ;PçH1N©p¶ÂcÈ*‘TšƒuFÉ|™Ô‰tüG„YÛø£‡M ¯YðÌá.c4ñNcžMgˆmΛH3Š‹Tâ Ö}bô ˜¢3c­ÞÏtÖ¨?‡ºìäM{y×l€ƒš.ý ’„öÈÉœ¦uÚìê3±»lzi9)M%)›h~2ófTé…úÔkâ†3Êo™œ¹D›¯™Ìì¡#¨(×¾¹Í!õúáb¶Ì4hn¸9¥b­­|ü.­Tž™.IB@L%¿Ú,›\’ÒEûsÎÅ­áÒzȹ=³å‚¢µb®^³—7‘“€ )“|¡¦Ò4¤ˆ3ÇMq.bÕ ÿßæ½Cd!mé®ù3Aé\aýGí”âê~HTUO¡qR%Ø28^Uçp3â¢dˆÊR(O~U‹æb‰6?oðÚ´¥ÝÈP‘Êô« º˜¬39«*±B)^çi™ÿ®bQË A¢lÊRì9é”ÚÓò„­äbÄ«XŸ+¸ºFÑäô)R$òŒæccâ"d¤7:ºsjBïòïÇd9…x÷'TyV…F†“=?Í’Ê©ˆ¸Û5 B Zõ õ•nðæâÜà$ró±ŠÜð=·£¼ö׈=mŽAÚV[çº2‚ïqºŒº& ÜZËáƒzT[M—¥¸úÓ«7Ý}e\x¶Ÿ‹¥L”¦Ú¦ûñUÜáºx& }!Øoò­º?ØyàøDlŸG©9‰>þxøÿÁ.ŲjÍ ±—ìɵÐnŽ_2 %–wÚÐsQùì%•‹«MS¦}üU´ã®!¶Ç +OÒcŒxê:†GŒV;‘:T9jj"„mï΂æ|gÍÜ¿fûž  Fó†1Ö*#—ÃäØÌڕ˵©r¨7Âë×Þ×ó7jÅõ¥8rí¢y ‚5ì›–gd¿ï_µlôIo8 ++LóøK6̸ìÞüò_Jé‚h¾°ŒGk#ÉÓ°](ÒdÒ×`HGj#ǯÖådÔÈ¡Þ6’‡}D$Ò©÷p“duá=®§ì<ˆÇ†ÙtÂ<"o…—ø«Üc›œ)bX¹à7ª~JëíA\¯b8ÖÄ’.£Z$["ë\ z["nôJ$›ðTÇ* ø¡œ…++'ô ÝBÅG#Ÿ¾‚ĶŒZdõž‡E!Ô4½ÏÒþ cH"åÞ7èx –Wkns‘Õä¿,‰šXxXå8žX.îįFË`gö…ÝÊ2®í}Äxή.…{È[†h-´2•Ñö¤Û¤ûϸ)¢É8òÓUk.RÏÈ€öBãj ­3èýíÖ’ÿ\y½`îUÑí Ü;+óMâCžTóHÜÝwLSÒǹiÙËœ÷ ø^ZÕ¹Ûìéãºïðµ£I3pÊ™ÍnDʶElŽîJ‹¹ÓÄh‚1ÃV^f3œlí®½ÀBÕoó/ɇÑóí 9s8×ä”z#Ô]ùž‡¯Óþ^ŠX¾|åzÚõþš)+ÅâKãø3 OÉÎ>$WðèÇtû‡=›½„Sý§‡]5Š—1˜£Üj€ÏW€Ã^»M®r¼ÝêÑ#y@Ü ;6{nœÚ‡íÄö“п%dà®sAPQ‚dª‰§"û›¤ª »¶u›Íßsµ:vÚ *¾¥$0Þý‘ØQAp®t„TiÑ&]“û‚ÄI%pC?l9~p•”þ©€JÃ(”Ó­ó_©™ì»Ïm®:)ì3¸LEºsþ–9€I¹áDºép[Þág}§Å¢ 0{¶Ø[¢ÕBÆ]™ìDòð†oZvH¶{µ¾7/P(q=›hRØÚç¶O÷^¼•¶èÈ–£PCPËÑ +g í}B-b ÿcá=z ósþ![mwi„1Dõ¸¡é-RNo‚ß~šÆá KG`8)ëfëryzé?ݱiUÁ•!N- ói°zkçË‚jÏYÞa›·Èìè+©ZjJ,‡Ö`ò†Ôáuïù²>H Oó?ŽÌ.g’úÊ .ý\<˜iÂvjíϘÆsFñÂé6<’%G»Æô'tj௟tq…ÕC~Øÿ6ÆIŒ)3‚@fD²æåž~q `F½I¥oÞ0«ðÈ[hë°~Fù¿Ý]1OµhNëèQ¡—z£±€…œˆr¶S{4™í¢sGnFÊÃÒ-¿#Èêö»¤¯/̾ׯ¢+æÚFt‹ÃÝEÎ%Ð6îq2ð_«ïpÇI€We·Àw¥ù\8º˜•á ÿ{ˆwÍŽÂÑm¢0§¡Xtƒ>ƒJô™M÷ÜÞ¢e³‰hȺ‡iDŠFêMddp[AFºt¸oO¸,|¦˜f€+a0ïhFüQP²Á ŽÆoϲ‰ÝÌôiÊŠA–J1Ö± ê"‡Wé f1„Í—NÚÚ=Ü·KTE!‚iC„iÌ¥ïãfGÖh÷*¿û{– ¸2UôõzÞ¦{_INíÀ5ã¿À^4ïÁ{ñK«‘¹ý¼$m™-4€w¿ ÛOçO[É°0ìX½ðF³fÝcNŒ»AfŒqçDi5бcK}WB±.4#ÓŸ®0>\„‚ÍP“Ê2>òñ·€Œ\}vØЊo7^|œïÄÿâí<¹­ƒŽ½ÝB‰)3J¾Š­ÂOŠÔ$¬ºwÇW’ø9ƒë?+Žx„ zaA: + Idä¹Ö ¿Œ”ŸýˆD/ôóÊY +ª3‰¡ÿR1‚ x­v?Úi…˘’í”Lت¡apœñKŽ·€W©ÃtáÄË ‡|+6//•'7­j¢:LìcpÕ‘Á•†Èäû¸Ç‰39ÒÛpß™gUmø®faµlÅîr˜«$ŠÎ€a»Ë«‹ãhÊ«‹+*sè#*)V`vÔ)bhjþªÌ,ÕrýsK™Ø“ëøÖxÞ˜ºÆ·ö÷,IS`R€T’ý~]ž± ¦+Aý +GÛ˱lT+ÄßÆø ½l&4^)†¤s^û;¡ÚRŽ«Ò»ˆýY»+éÌ› _)¶>µ†\‹Þp€#Ú—@ž5ÛÇ<ût¤ï¼Ý³z8*]!H¾»§5dàú‰—‡Q¤ie*¬/òò¯}/òs‡Bó˜.äÓ(BÅ”Ïе!bjˆã<è2­Tï>˜bœLt—Š›²=>ÀÕ‘ŽäC¿=8è6)c!5XÏÌW®¦Y€Ê|u=-*$^B‚K<úa{'î!(WãÒ+IýŠw¼x/¿å]Òà3rf®èp¨qá¾c‰ šÅuõEE°7¿)m²@/êI$å>Ñ@‰'˜•?"yõxbBU$?à •eà²e@èຳ0áØUˆ3îÅã™ ÎlûKS]õîÛÐì\!þ-LMƒ»›à¢ûâéc žŽ¯ 'kÑ¿oO„òGIJð!—,èŸáùNÕ& +qÇH+mÊ(¯ ^µ,âWǯÜú4Ìß-¢\±â>Å„4ó]¼ ¦¯Vµ,útaÀ×ÐÏ~¾,} €ãÂû¸äaÌq¾önþ5"ª“Ÿ¤lù‰±Tùcc®b·+û&c´Åô¡cY?é|Õ“ö)©b¨ì©"›ž©ÓCt\ :òãÍ„wsS¾&w¯ùÉ!vÎ캹—ÕžíÈËêõMóþßZ€(t˜¼-ƒ£ø}*A=öý’ýc¥‡ÊaáœÓÓMÃé¬Ý•í¾OÈ­ |Ù³´™ ìSYãlEÉÿdänZeYµ™ìQ‘a9o1š=Yæ´ÄUò/m·xÑK¿ÅšO›…ãÊÿ¹¡ÜÚð†(Uü{âjfzˆIÃCÓ«¯ÇVdŽ¦„P½_àï‡ä¾ðåyùkAúBtÐiå,Ø]Ú‡¥ïŸ ÚûÈ@7 ¥NÆÝÁg\C"{¥ÁŠ.7$´{‘G×Î(ò¸ñi­ÜðÆý¾ÓÖ´Öv)>1lGwIoÿ\ùD>ÅÄ/x¢ï¦7˜ÎrS Öq÷ßT5<@úy­Ïƒ9k=ìÏÁK¼†d0Ø"ª¦™ífê³qP)Óî­Ô cP ø6ÚüK8´Kbµ‘ÿwTs‘ßXgºVQ£'ŽÂ[ðÛcì?ãѽËØ©Réh Qw  +lB¥š´ž6L¡²Ø£Wô:7¬£† ¨˜Ý&'¤Ñ´p¹ï˜&FV/cfòô[T´Z½A_™•>ÈôßÓ :ò?^Cܼ@ºùÇîy½Wä»b·x¹ +Ìô/Jnô}½Z’œ÷*\µ·…Òi~–Ái™¥¶ r$¾–ø`?!î.ªDÑ̈ŸÑqÛÜ7l¥}ÐIEK'0Ê&e§þ¢â9T7‹š…,oV<ÃæÛ0 ®lrgþ±Û;9fuÉ@ó™0”k* +»-ü¦¡Â“|ŽçwüePÁu"(‹7™½•9u¡ËT_x0 +ëJ䜥áí{?:ë%ÚKhÑtàúý½µò ]­¤†ÓÝé/n½$¹@ü¢A±äL»lž°³wRôØ;3ÊÆë3œHŠx1,BŸ0Ÿô¥ÒìHþ›[”"!pFEhAÆnÇ.ý}ç;ÄœÆNÆq¶$3)Ž½xæO-qNœÆ¢MWC ÈX“»&lrê¬2æÉQÚÒEóœ-]é™12²–Rç¿ 0v,7ˆT´»ìå˜Ê'ÒQ´ÂufŠZTg»A¹Ý°ÞyÙTkF»8IÊ@¾¢ûC»¥¶þâéÛ0R§ÔOžŠï¦Ö-bÀDÛ0¨ÊµŒ©uQƒØ‰›Â]x¬ŒØºÏ,„ÀLU<…ͬꇗ"2æŠC˜–FYp¤Û*®¹3çxâFZ ˆ)ŒSð³ †«Œ¢ŒZ·Áð˜©ïÞ·’o‘“„ãiú†i}Ï–láßTnlÚ%ÀÉ´}§`ßqQøô<¯Ž“„v%¤…³¬™?ñG‰HðôÈõa;%vþ_ÑÂL¼4FÐ6oäÖ¼2í+{Ž‚ŽU|EFcÙ5Áë*0¡YÔ±eß®óÏIóçä÷œÉ”ÒÂJCq{/¤žŒ´Õ|*†Çâ¦"’hª i +—ö~/Nc›îà1ßí]èóAY¯MÖûLÏ"@S˜•úà¬xh¨L–þQ!B_,nź!iVe6LzÇ%2ÞZ‹C"ípòX…Å.þäŒyMsÐ ÄšWÇÕDâšãKCÙ41~ãÕ@,(°ÃC§ÿ4Ü®æûòù÷Eí?¥7@}Mó¦yÅñϯ©6 Ð1š2ƒexUBŠfÑûÙ{Û/áé6½3‹É}e0—â’ZPý¤á>ʧECƒ†¨øA^‡!6";|Òi*Bo-¶RعÐs._( êì«¢ÿi¼ùºyþê>BÔbÞæÓ‡°¯3ŽüҬ腎rZMkÙàF}¬Q¶ a# @ëß~#¥6íõ2¹€Ì ·Ÿµ|hýŽ ¿h5¾ýC0BÝmQ—•ÿ¤F%´©·qQ±bÿ¹8IøÆE¥háŽUs6Y ¶:ÜÖsUütØÄCG#Bħ¢Z&ãõqÿ*R¬Þ[çX‚@SŸ„s(S<è}0¸ÚÚ’!Q[‘ ]#+‡ä&= ]Ÿs’øž÷æÙ ™v!ôÄ4Ö¡? ðß¿YìRSái/ðÐÕk=)t¿‚Ú·:‡M`trs' ÔᇬêÁ(±†FhË°wKW·Â¢¡·gÓX%óÓëvÊESÒ)PKa‹çCJnXáaävôNÓ6åFû?JÔû4FÔ‘ 6ˆÈÐø´*s»ÊýPœ_(·š¾e®_ÌoÏ€´Mm›7}P,½ëõc»òJÒF¾_CŠ\IPÓ#¸ü¬Y iÏ<Ì(ž¥ÖFŠ+Cx ëJÒ`Þf~ÏÓ,âÐûzc…o²*}AG/«¨Úãc< ¢§ ç ?ÕÕ^ÇãO€ ?Ûa´¦ÙŸŸŽ¬à >Û]ªQ"•”>ÀYѵ¥…Ž¾g+…ô*Rý¾# +Ú@$ë$Q{/Sç¶p©!ˆÎ,Jÿö×…cðu º{8ÜœrbÂIZ:?X2ÜeXf~…oB~PWJ%9¬pÀOˆvWhj):ù«ñÍ›%ѾD45zRnÇWà3l)"QXo¸ªyeíw— µ/QlF$]õ¬¼ØbUžˆÔ™ÒØ+ýËCëh]µ»‚+ß^ˆýèÁÕ-  ™ Ê;`¡ Év+uä¦çÿȘÏUêbšwåÙܲ/k-K× B([ðZc’ø;8¹æáY{û¬æËp3ë +AË‹,¿’_>‹¨Ä°þ/Bûé¢|«¥r¸Þ—™ÀnnJ\å·u¢ +G8g¬{¯&˜µÜ¥RªKáx2ŠÜì72Z7%Ÿ±s£™ß ’M·uÕh¯ªWÿB˽箬ǘó G¸½ýÎDµ|ßu›…‹óãyßû¬ìÑ<*š_c Ø-ùpŠ W0"*!ýº&H–yNb)F¬ŒÀZè+Ȥ€uOZOs‰SíMÍ‘ªÐñŒ!ËÚ)ïs•ñ þm½z¤€‰å9¢sFQÚÓÖD;-V4ì&šÞ›Akq$Ûèë05ç¡í^„Pc©øøJ#Ý`׬CÙâ%GOFPúÞnÇAx[JilìWŽ”ö`\;¶^\ef*Q ÷éÝDµC<ýj‹Ä–þ£ÇÃK¤¬ˆ»äIJÀJu s–HçöúâÑ.*|dIÛe…k<3?¨8lXŸ£~Ô¦Éø¿¥F‹*£gÉœYäHôosÐÃ;„~òc3*‡Q6›ãVœGbµma“²þõÿÞFíõÐñÉôL¨œˆÈ_bl„q›='‚TfãÿÙ/SM‹÷•ŸÏ×ל¼ŸRÏEâ;2¯©+ÞXþšÒGzñ4Ø[äÈ=WD}Hˆ}PUÉ“ â‚l—§šRB‚€xÇKç´\RÍ„{…Õâ9Ë%8²’Ö ÌgæXȬ|À„IWD¼DõŸâ3nµõ@æ]Y“Ú…Ò·J´©qéà+Ñ& ú)ƒá—(üÊ¡N6Ž ¼æ­sú£)WÒÞéS;Bú®“±+`3åþMA|žt»_¼kK«èAròòîM¿›ZîöÀùÒtp÷Y{êœf7û×å}Š K0à> Aâÿn¤À¼'ÒhO„W šr­˜¹ªu )ž…ŠCEšg„$·}e»;–Çw)¾Ì"TÚC?ÛԻTqŒ4vsΉõúWO‰‘b„ø˜\˜Nnðœ€bìKPš³ÉR¹vÖ·j0§YÁzìyÅÿ%Ç8JÛ1+1ñ‚ ›:;™„é_Gû „¡'ahžðjºz¥7¦|ãÈ_ÛÖÿoÐ&™Ú½Úñ« íʃ¶”Ÿ«sÆ +|ÓœÓÐ+îÌÞ÷ˆYE½ZM˜;cÊ°€§’ø£gሺuï½¾Ò›¿–c¤0çios[0¦Ÿ+œ3„Ó>#()EÇ~ÐÆw`I´Â&lŠÂ¬©¢ -{z«/g8SMÏE@)•@¬ +-\²êf|haÆ5q ÕÛ¸ +¥'膄ÝРчO­oÓÞE¦§ýšD$CdÇô) YŸI'Ì&äc² EË~{2BE&œR∹É6,ˆá;M¾œr…6°î—æºgL]±÷alõ}›>rUíÿ so‹ÚD`óÍÍEy¶àÂêÛiÛÜû ´C›Ê‚§ZÄ6‡9Ź¯HKÝРM~ËkŠ×ížþ>þÓûSõR”CúøNH‘gSm|ó;0Ív@Wé"û}°;Žf!YXÅQ6ë Vø)o±…|¤DꊼŽtÄàÃì=^Ú¶‰.>iÒ+ëÅÚ:õ¿ t£ q`bÜg=ÒL#±¹x_ +Œ‡}ñÖÑ¡¿zgžTË5ßjø vˆ%6yñ²6õö”ì…¸;°±ø⡪yrOj ñX;"Ú?šqý»Flô¾ªÁÀÖ0¡È<Œõà>DA®é,-ïC6•tŠ\̲z”«‡•J”TÀÀ!y¤Î¿R¢nŽ”¾çonš.| +ŸA[äl"eèÏ Y´qPÝ 1b!û¤ÿ'ãäzàŒaQ_«6­N?˜K$–^H£¿áïµ)ÙKo£¼Ã-&ÈïÜE_7nþi‚x‘8TZGPÝC ¬¾î°ó¢ƒ?„Ï«Ýkc)>3ˆùÏ ™†¹!`]I7I%›P®RZ˜NÓãi?N–¤xÛÄ×£y«ø°Z7ý±ãØ›ÄÔ >sV=œC”¿e}¥@Ke(+¾à.YN](*íco^gb#ÐX¤†ÙÞíA‰½jQ/‰˜2­wÈcê/WØÂÀ‹SËî·«,5 1w¹$éÊÀðÁ6t@C`ꇭMÜL5 ʻ金 Çã <º)þÿä@rE•:ÜÂ/Õ€ÌHe“š=ð”sð¸E³ñLÀæÿ×ç[ÁEÒ{bËJQ…Ñ×δ?™#—Á`³Uwyõ"wý¬@¾7N€©Ïh›ÏgPzV['mô«@½2¼¦u²|oGÔA +<å­¸§ëJ¦ùQDSÀ-­Ó€a1Ý‘îÜÓ%a|×^Ÿ/<8âêt1fæª.ô¢T£‚9‰ü¹Œ“M{yo¦Q|ÆìpØ K| ?]ÿ¸Ÿ]Läu½Íp1Oè|–UÝZŠ G2|§ê‚´E„?¦s˜‹ ©OSæLû0\hJ¡A…ó"çê22x”# ôš-ªøªÂ ÚöUÒçús`Ÿte»å¸ã_ Øøl#ž{$Í€V¿Gú $1Ñâ“MØ"%?ͪ–ƒÓ9íÅ~Á©¤5«ˆÃCR_”9ÔU×»LxÈ–çHPµðæÝèÃ74NYĵե¼·ê5«ÝH*Ì–¸øá›Pè™êEjjúD˜ü Vsï`«îð[fvè†4ò[›5Üwé¬7yxŠJ|\Q)½ìJ.Õ±.ו)KzClU¬±’®žü•hÿ“q5†„¸¬Î{Ǻr aŸ/Èe+¡¿eeŽ:¹ôÒîù|£ä´>¶Èבf"õrŠÁËk|‹XžÍʼn—LtCÐS~S™C +QÏc®ä׿ñŸæW${0[™®qͱÛÚ†Ó×_€´8; ìi›­ëi £åQœÎuüÑ3¹î7hv ÷ݯ¦–HE²®E²ËƒùE·~«Ö°Øÿe(¥†ÎŽÖÎ,mñ¸4H~7ݪ1yº…Rßuˆ“3±%Bâ Ž@ut³ùgòtH›·ë;Ãå–Ü˸VïàÓvØæ O]I>Nwr¯aÇlÈĀѤ»ÙC‘Í?ç„'11Æ«HGNͦp×â>kÚVŒ0Ó(O¿êÔKú°=OW¶ ÃÚéf3Ï£ùö ‘ææ´;ö’¢“¤ˆÅ­‘‚†¿ÊQË+3>ˆ–ž0•ÝÛÇàg~ +ÛTÃÔtRóçc8Ø#¤Wã #¬o.7»Kß’ eQ/L‹ +£NÆí“ Ü{q0¸ÑÍ}?3O®~[ #aSª2ÃÜá¼zèÕClZj‰+÷;íS=]שX¹#­ Ö#9™øÀ:á‡9i`sñÎ1?äĺ&O;Sš•Ü€€ÚÑ™ü‰¾÷xnC¶ÄÛA™}ÕÏ÷ °]xzïÓ°øöÔ¹¬ _Þe™Æüéw;[È× ƒ9†!¬ã³j …¼pr[™Í9UëUµÿ^6T®Æ£ûb“çi°ü‡hŠmÊùšŸM{b¹íM4¥±§~±¤ÆÖ¿bôüJ &pA8â1£™çæH¨gS}Ö“m‰þbЪÀim@>»ž§TÞöN’8!¡ÿïŸÂ…!à#v¤ªq0XGW~ýGöB³V«»ú•|‡hðÄvX@Ò†¤gm€Çv®u ZôóKžU|¾¨hÑÉ.í3 O2šq+»|ó›ÁnÍÓœzÇ=M¥°yCÚOL™Æ&ϸ|…§qâô»=_ 3)¸¾Å/Íþ­ñ'˜¸×9î{düM*tÜ饌…eªwy&6—`)$R'¾uƒi4zæãÄ3Ö™–Y¤TÃ_4I[Jt}”ÒÊðÁ•†¾—‡m ¦Ni¡=°Î$9îsÆ¡ÆGÒ[îI ²gäÛâÎÑ@6KiÚêÀêÆeL˜ÇL–‘’ࢉ™¼j´|n³ä  Y[Ì‘Dåò™ËOJkaÊ!šÙ–É”L—ìLMŠ¿‚G~ÊC¥ŽvL‡ªÒÃ^ +ˆ9ΕKp‡LwZ”¥žcü£Öø°)´0xS>#q/4C%Mî².ˆ…X»QÒz»$9"4ógÕG#½×°ù ÔH~‹‘W;¥’V¬šÍ¤(d‰wÕ6©h{Ug™r^Å™©Þ~éò/*?Û{k y—‘ƒ¾Zleã?hɇµM…«˜ªÑnÙŒ¤Üaߥ7ÕFdR; ´ ´4¾°ÜÈø‚/ÏU@¸â6jÓÛØcã#æìô»» »Û¹ÇXø€±›‹u¦X®Ëˆ&ŠþqQÝ\RZÉPÆÖjM/‚ýÁŸØÀ,ä>Eè(|Ø3ÇéZQ®‘£Ôá©éwÍžyèüy»'?b‘7óì¥2¥Ùæ·º¬¯§;%à"žËÀ«ýÏÃáÙ°ˆ¶•³ŸúŠíÑ…ÖUõÖ®;`†¯*§ÌHÔûr²Zj,j± Éæj¾ Rç±{1zñ7€²uÅ넼ý"£WÆ Ð7™bhï$³e·^t⺠·óª®h6ÿÊ„…)uì@¬ìE•=ÎLÌŠ(,3”Þ=ÂQfSŒ?ùP[ÓŒQåâûž&0¹£áÄ7ÿÂfìò¨í ›gÆñŒþÙL=%[ÐS%¸ácý³c¡Í™*óywcÁåâWõnªô¾“2tÒ÷/oR2¥Zè§Ç™H“BðÒ}X/fAÁ¦ÍÝé9Âa¤}Õâ‹ý_Š ñ'ü`NûÙ­ôדµ‡MÇ ‘ß‘)óKÍÙfOÄÑ#Ìu­œTû5O\Žüf90SÊVå‹ÿcA=÷•9¢§!h=ªÍ°œÌ +8øoþ––Ê‹w8È=¶DRæë2&v9«¬ùŸÃVR쳨_ˆi7ƒ…¼×‡×ܾÆ–ùúO<5Fƒå;æÆ%›’lƒT{Ã(߸}ŸU +ÞúÂßânÍÕýÇÔèødnÀ*›è´Šþö{dpNÆY!RúEמe„}™x2¼IóÎb=w{­° ý³—­¦:‰÷Î ¢ ƒtê«F<™~O-{d¶áêãBá[.Í~‰®XñÞ°7÷@î‡eP=¡¦i¹jæ¸RÊùlzW–}ÀIÊtÑV*Õ^Nìû[ ­`¨í&÷8ɈԹöV2¿íjðåNÑuÕÿ_Ç—k_­•;+¬aUUù(<Ò' çU­rþΗêºÅrÃ)±öE"ÐÁe©ÀÙÞU2ÁîhýƒszOuiˆ»XtõÄÏ3OŠzWËh3d‹æ€ô³©‘ nn襉:.ß"¤òd­½ÉróÆ:%fÊNω¿Q1ÖG÷ë yñ‡¯ÙÍ_F_ßT›­™”ÿ%¤Ë4··{„Qñ+ä="ºæ¸ˆ“drgnXù˜å÷»ãìzá?»v&ÃÙp/ñ· BÜÄÒ‰„T¼òȧòCÑck¡Šjà|›ôÃR;¬öé‚J3$Ë,ªXª«»œ$‚Yëd~@]Â’ÚSOá^iï)Ûòܾ·¥žxÕñð‘ê€|õt‘¬}„ÕÞ~ ÐE;'-â/ÔÐè¥x^7㙪 J@|z=:Ö²0ÌI³Ê¹¾ v\<ñKžS=¡Ü3¿´tDÓì=SÀH°¥ÞÉ6Š +8v|Áp sÑòÑöØp©Û‹V+U«£ ªp+{GkÉ–•À¼ø7h?C=UÅŠo|ÕŽ/uô ‹„H‡ >káÐ @XôÓžB%εWÝÙeIƒzƒn=/¹uüåÀÊkZ+%­ÃF®Ë©K%¡ä1}ªo›¨"z9S$,ÇA%ÀmdÀ²jy˜6m-üL%±8•˜]ä6äÛ‘ü„_ͦے†&æhˆ8"®¾U}·®—ÇâçÔÖŠ‚M»¤@gÝ9â’ŠQß=Ž{BÐÏ1J¤WÖró a¾úVM>&™M©Dïjihq Ù­û"ÇI^Ïœ1–õɸvb\ÃüvÁÍ(ZkôË ÏýSr,h‰sÎN|¶œÒ¢+²W²g§%[‹¶êU de-=·LP¦{§´wò´&Sk^qÖmë”æ,ø"ÈãR:_!œjÅ`~8ûð +nÓa-,`wót{Xc¼õY­ãÜ+jÛƒh:hB¢¯=2ÔHÖ2™q¯òKï@Ë—1£ÐtÞÌdÍÁ•¡¢6å×ò©QœßÐ7Ñf¬(áù3gÕ³BýÃ[þ‚§ÀqæJl¾µÖ¨xmѵqAýšgïCz³Äåíwrªc¬¥ óMÐ œÚdVKP¡{PÐkvà ’ÍÊeüÂ;a€¶`«Í}.Xe-•Q‡#¤ÍŠ9¥ØrüéÀµsÞåméÇN€¡Õt”åØèFZ Æ%Æ"T(âmÕ…íˆÈë,ŸW›¨ÎBÛEy÷Kr£ÜZžû΃ájG-ãc·ÜpíFÂ+ª>ÚºýÏ:Ï2ç¤ Ú=œøe+«ŽËBcSÖ ©å°UÎ"òg™ BáX~ŒÀªÒa\¡üØÖ»¼ óËi󥩀·¶òdüù°Þi†g’øˆeäsë¸bŸY#ÏÉF‘* w>f»i^Œ¸yø`Å´Qph±^K\6–˜77ïL׈,¸û «-sºHε~IJuä·—9ùÏ—¾‚ÞI*WÓ U«ÞžÀjìXÇm|ÇcdG1ì–³.¤NÛ³ž¬Ì¾zŠÙËåcè +P<|½—e¹«1«)ƒÌÂÊ“¬ hñrù ÊÙøÍKwÔÌ Empì˜ú~»0„°’‘ûz¤¬Ë5€ ñèPfΨCÿÔ‰B4gz¿ZþžzIEç#˜e&·±BXö#Á6á6:0ë’Ãó\zF'3‰í t$™ƒuÀ/©P"–8¼JéÀC Jëq![[öÉXMˆ$#à&ŒT:€Å6­M§·¡F[¶Œ¯º'•E˜û‘Ït—jä:ƒ2Ñ“)Z¬×©óëÓÏD“²4qÒFƒ£Æ'sI,ûI:Aw ‰Å0a $ªËªjk,öŸÙ8©ù×M¿qÒ¿Š·… ú0UÙ¡b£\Üô]SeŒÈjåè';G|J¡Ùæýäæ ïµÖgšÉ[ø1–L‹ýÍ —Ü°Œ+ ÝÀć†"˜fQÆÜE‘ÍbŽL¤7"yàô8\XoNÇ“Tȯ §Q!mäÔX—¯slZÕ_m¹¶oS´k‹ø*¤Ùr#•üÒ»¹ —s–Jr¼KuÛaG{h& äP+}àJdN +ô~Í®àãö\OBcî&UX}ü4¯ ¿ºvzƈÖzUã›Ù‹Û$$I’*"˜ÝR8LF oƒZ‡UÉÞúŽ”×¥”2t™Zº z+¬ +ç |ëΆ¶¥ÙWb“Ñàøo¹¾ dGgúpfë…VŽëjÙÄ+OïJTbÀû«‡(¨Þ'+8Ff×Lºû4M¾¢£Bãì„qÿ†ÅxS6Ù C¥\7‹âYÙR­L’¸hqó×À¥Æ#ò.K…àV±¶óT•K¾î8èÖŠÓÞ&ìµÁð•+Õ&0ö¼[ô„E’¹Íé¹Ñ™‘-Ý£oñ€Èó¶1/¬qþ ŽB´ˆ¤·G‹MˆKHH$îEhÇg‰µ›ì”€‘ðd÷߸<÷Ç“ƒ—úKpÌL;#ð½ø ÿ²w¢ç$úáDùÙ$¸òÇ”­L ôSªÄØçì”ÄbÇw·'œ•²ºÒÎ;›M[Øç¸òüX!.b‹§Í8§Ë+ASèQma¬Õ¬1ˈºÇ&Ⱦbin@˜¬²3#Ë;¿Fá¡Ÿój¹ ÒHÑúq"éyTTŽ^ãïÙÜŽ¨XÉÐ;/@c-H2Ì +LħW·d[ªÙ€;ký ê^,Uÿhö9§Õ|0Y¬_±V#å$ñ‘|8È!E·AKw7¹ºÇÚ£·èb+5¶Êy±ß?د¬ÜÇ2Ú0o6è§hÒ1P£`ç_z—}Ñœnu¤Ä#¶ÊÀ¯>ŒŠN†5¯¨­W]RZÎ^AM(Gz®ñÄëV9–)}–¤é£»ýGXæF ÃëÔá¥] Ï.Þ»â¯ÐùtoúŸV¡T‰Ñ ™H1A Ë1Øo6+ÎP$†w™#,y,ÎRHú2󽺬ØV˜u¾†±Ã²½)N*ð,®¤…+BòDŒ¹ñ[ž¼W ŒÝmPÓ³ƒ«ÝpµQ9[f£I¼êlplRK½ké‚Øc™%\ågIî¶[hÆ^[x ôÁTn™Žv’Kº€t¥šw¨óùÎ)ÞL`Ç'Ä’2L¿ûœ°í@l„i>X¨Z…±?bQÄ|$šÕÎrµä;°\X?È+¸–0‡JܾúÃwÐa{÷x#º¦¬‰™»¿‚JðÚÏR2 3d÷„2\ 0¸ÌQ+MiÙ‡à(£ÙƒD¤k½èo@lS奣惌ê©•¾Ï2"ù 䦔ªÇ ˜À~ ׶Ñ8³¡•õ4ÌPÿN 0#¨¡i L{Ee5{Ù¡ý¶íñÁ?¥NyCã¬üYô! —F"â’îŠõûÐí·±.µáÎ¥WÑö.ä1í0{ÂÀGŒD9äDµãkêya((¯@6ù—!Ý{|—y‰p¦kH1­âÀ5ªËÂC·Ž²ÒhÎæõ\€œ¿àžöBÝ aˆ¯3¢æ‘d+B%ŠÐ×~Ù˜ïLå;_Ò\Ù¬Þ0U¾2z³~»&mk‘ÿ,¼Pm¶‰.’8úiÇa…×[Ÿ?ÜB‡©wð7@F€]´‚#qˈZòþ‰Yõk„˜[‡2°gEâÉ0$khÎʦؒ®’*š‚{¼Ý·\È”ŽªX˜¦Jåþ!Í!/Ò¿#¤˜o)?àT '†ÚÁ½/$ù $²Ü¹ +$ë^3°h]ñ´ÚÏ> Ú’ aZö“·¦:Å ‰…M 3(ÞL–¬TÞd¡Ï%¶úƒIé f?I£l(è/%Ròï2Až'Ò´‘ìºÂ^*÷Š“t&¾¥ž1P¥b¦–)þ«Ò „ë©8ZR2I1{,¡“¥·„3Æ4ŽZXC¼B¢óÏ«ùÊäÊô[—ÌÐ7»’Œ‘›^ôx|I[ã nÍL#[d±¢á [r3GS( Êk}+_‹<áH2½#u Ž¡lÛü†ö ÌÝEVö´¸R½æ÷]¨ÿ,¹z¸\á¬ôµN\2G“ëu›Jžâ¤`¥OŸcŽ—f¡-ˆë]44f6ÄMVÄÚ·JUDz+Ü+§ +"‹¢Žá¼M†í¥ÒÓ±ç^ÓMÓdï:W@¯ ·ÐDEÜ\ Àÿâp]²Ð‹/ðl7ÌÖ,_`OØí:RÌtgæaa–YŒ˜?@ôvÚšè2‡iï†ZòÀJ#º×­»^uo9§0ž•²VåÞïZ¤í+ +^ìy \Ýü¯íP´™vŸ^&UþÁ‚ëAèaDÞ+³ðñOX,ÔZqúˆsóÜʵ ì“2bÛ«ä+¿Æªëίêª×Ik±É¢žOåûl>Š íx+ßç‡&g@qJPwCú7uHhfObM¾I,5Œ>÷!ÌíÇ°L"]ˆÑ–÷Üq«RE¼Ôï=LxP'åpA#5'M< žucÄï¤7° 5‡ £ -¶™j…HEŽ…5æÇ̪º© ŽƒŽ¤¡ŽÂk£s–ù ™›£XÀD^IÖ<*À?ÚA«1ÏpÂÍÙ­Òÿ<Úà`GÀÅI€¹„lËÔÑ/V¤¤Á£TD#âÚ„%Úð¥ŸKVoõÔ\¼íà²BJúËèûégø0ËãËDb¢xcfMç€4†Üôº®iûu¢›ß ê,RÕÁ[ßÌG`äÝöÁVLúŠ!÷ZjW:3¢Ví0T3³`û~ô)t0çú›³ø%€",ha²d¤Û“ÛVcñ»ã˜Vg¬p]‡˜{²ãQ§Wªòôá…¢°;6—Ú!Õo™¬u¨kÀÍ©Å’£}3[Ê;rG0žÐÎÁÑt>Âj×O·ùù*š²jMÿÚªWÑB„u[)WMrÜÎâû/øÁÏt^Zì§>]eŒz®)6†äÿ£2ht½)—šù"b{eÁ]×oÀTz·nÏÈo¸€ÖNzÜRjPtô2äêü—ˆ LçpbÏüš?—RyÞ.ãýìójé|/ºèsÚžoÓ^^u¤fjó:§ÿÿ­ ó­ýÿp +ŸÛsò(u}8i@òYµ—D3ª•¯n>LžÄb±shÍB'R^pKÚEÜŒž æ3òÞÇE,ëI>*'´¢²ˆª!®4ƒ'êK^í&Á{KÙ1ã:ðQyn‡Ç­têˆû^üMó‹L¡øEõ~{O‰Ð3n…Àz`>Kïri0u%·ûÃÃkcÆÞ=,ÏxŒ­ûáã}LRÖZ¿ÆO«núÄ[Á{£MJ– qhO¶¦bøÊAV'Oé­˜‹¯ˆ.þ瘬<5\bJ=Á¥NAÄ!¬Ué6^ÔÑM^Îä$ûÕWœf*wúËŽhžK”Ge;ÿ®Í;: Š&T_qÒê°å è=Š‚Γì=¨Úïy¨A}4™V–ŸŒZ(*¯êq¥P±‚ïpÛÇŒ‰¬Þz¢64“Vx#!å=¨í©}«žg/Eê m¨B‘˜^Ê nuºÒüõõ.y8ÁJ¢™EN»  çþ +m³:G¤ +ƒ&-Φ‘^ge íöÄäþ*~ù7û¯a¦@Âml`¥U,÷¸ö_ÙvT( è o§õ@’S0`¾¬ˆÛköî5ïI5õhÍ8xgi‡>z1êŠ[Pt¤cºt¢kíK0t²úfÌÕl˜•—õß;ßrl>F¹ôu­ˆÊÄMùŸð]‰Ìoâ oà H¬¤ÏRDø$:tQ¹MÆ .#O °e ÷’þµ»d‹è/®Þû ÀäÉ † +n,4ô àkP×7!²Å˜`7ÓâSfs/ö*©7¼n–óD3/‹ ¾Þó0–Úì‚ü‘å'Eò´‚Ò¯øÖ¬É-î Ý©6–†¸ÔÛÇÑÄÈÈ.á· dþ•“Åý˜à[½•üž5e¥|cc¦ŠËòLqŽhR¶øŠfFZ@‚¯²Kz;ºržÊÓÿ5ÃÀUžÊ}!Ĉáå ™ËÈ·×ÖêSh,$<;™Åßã-Do08b’ŒxRon +×ïVìŽ{»CœƒI©ë‘câb<ÊÛûPvâ¹nÌï!®+"*kóUÎ$Õw +Sù©ä†$+G–™e‰$¸ã’Xãàù‚TH7ÿK"DË!$õ¸©÷ßäCi”»ˆq??BÔrˆÝO5ûÑ…<(»ç µ‰PÑu‡š‹9AþH´Àrv^~cµ±|w•möÛQØæŽÏÜj̸~×í¬”µa€¬Ó‰€î׸ªÓìvc +™‰¾üpYš•Ê¦ù÷óæ¸%¨áÖ¿F¼öF¿×2ÙØžìWŽFC0¬JükWë' îbO&’J=cUq‰ßO/“Jã^øYÃD=رq'fg.G6y8íÄDB_áÆø¾®ë;k/|Ä+]Û"ªÝÝT¦¾ƒwñîÒ/4}s‚Զ͹çÝ7)‚ukg gRžyÝÕ¬%{¶BŠ˜Çc&2û5töÙCЊ³ˆ±áüJVØ›Ðײ´Ñ=ð_ˆÏëݪ_”ÿ–óµP^øX®xßiž0µŽ³ +o‹QŸÀ’{ÖÜùÖNF8¤‰Àd'Em à½7+/`Ñãzü*芮¹%öt%fd§ðÝÕÿ‚E±­zŽìָݡAz=-uú%ëûiH¥à‰_è ÖŽ ºU1ÌAn” +J#™ŠB1† ÷©i üôG§ …U vÔ!µ@ÜÙ€dHú ýÙ*AbŽšV÷™Eð|SWZoqƒÔ¶f—O„j‰­ùžùƒ4¨y:µ0û'­Åüo*iŒ©Äv¯_rYŽ;täs…áÓ$iZåÊu'ÞPâ6ü칄™ –êüà\8i< ?£i6ñc#§ö®ÎÈf»fjÜ ¾56?€®sÿ"ö!ê~ä8VÇc·¤ÉJZô›[òÕMqWþÿí'9ÿX0î@ií ôú¾el«êQíÁ#î+pºÅ]c‘ñ‚ϲ8­71³ÅMÔ=ûªs„z“íÝN¥„[Ú‡"õe Ó¡‰×š¦ãaµäþ ñê.ÛýØ"Iͯ[4ºx,k’øàì "豶߹£ïy‹ÏkG€HD;éJQšnA¼’ì}+š’V®…FF€>}&*h#‹Žà›¤¢Ã''x³›Ä`‰à·S.Ê06IôŠ·dÜIÝ^!‘o´dWí]È,¯¯¨*>r ásÞVÜr^KÄœêç|ÖddrVC™?ùd.G‡‡È‡Ó ãx^c­t%¬ÈM«¢ó:ôãïtNÁª‰Ê =ä…™œ‹°/%¾ËUœ‹°wH6¼U°ø(þÇMûŽvc8ä A´t0ê?©°Žÿ–~.óò›‚û…W®Åˆßë˜î +Ó)ÞÝŠëëÌ×FÇ·î€c€®3=Ni+ŽKgôúܘÂÙ ^olÃâm29,|S¹N(/y¿;4kNlSã>àk_…€Àn—ø‰Oj^ea!w3³™ƒR]^=r8sýµ²· yé£Öª©ŽÏ°’Z¥ÞV$¸CZ¹Ë®.1Bš¨®Ü¿)ú‡Ü_%Â!#ÁRÝs¸>ˆxº~È*€ÄvÜ$‘«ü+:Ù !+ +x†ÓÐæ‚œ\W0Û#LhÁƒ¸ ÁG˜<ßË~›H,ÁV9ûÿ¸çxd~ä:/PÂʉ)/¼ã åŸIònâKª~ª^¹ Óÿfü‹0n5—¶Ÿæò¥»Ò·!¶$Õ#5’Ÿe*T‚X.f_1YÂ$.ñ÷ifì—¦O?BÀïÇ6J”K£ê°Ùq!Ó_Šägæ£ZªÒ<àø·—ê7Fòfùt?[þË|’ÐN9f÷|ÉÛN’€&‚f&4Îd¢q™!ê+M}]ÕrÓ ¹©3õ×­?áûÇû1 /Üìÿ¹~ãeâS˜Èn¯¹¡#IÁ£Ãšq'wÔS \C_„à{´YÚƒóÖ¦Š 4.NÄ2öÖ© +”ˆfFY~ÍŒ¾ xÇ>§ïÃnúŽäŒ`okÄÑá ñ]HôÏ¢cIiËæ)g'úžœ¤7•™‡¶§ a¼O¨w§e[’¬B\ÓŸÚžµ¾ )O~#ÏLµ™öm½øNòÂ$(ôO]£„øY‰hÜDÁ¸°[#eª>¨Ý©é­{m¶¡Ã°ã~Ð~[÷8ê]˜<è²U`-¬Ey¥®Éñý2˜°K(ô +SM’ùœ·†£ÕYWåf"غ ¹Óòø¹è´ (ä$3×.|1wG…Û„Õœ¶ssÌ`1tȽS×ÿ˜ I=Ã…¯š–œ¨î- VNŒr|õß™xý”Ï¥®Y<êª;ƒÛ¾¯€"â»å¬—©¯p‹|ñ¦Ïãý®3[½1®h¡é4®…Þ%Ü”"öæò…¤¡ÂãKá„ +Ëmà~,H˜+BS'Wt† TOPòû‚ððÔÛ¾qróãÅØÒößO²R4Š€ÓqLZµŠä`÷¢qZ'¯,̃K¶G¶¶èâÓâµk@é'¾3J‡tKñý pâ4û%ìﮞJÜðe ½‘7üvƒ°ðJ!ðFçCÙñÿ¦ +Cf¾îö­ÚVs_º®ô+$¹PUò?å'*ö€á/óÎTÖÛ÷“µ÷yìž4ñÉ{.L$8!A¤‚LÛ¶ŸT©äéY:ÖuÛRaÓêØÓQbù/ÑBëÝ +îÿM:NüÉW/kñ#K@svE¾Kïý⑵×Mžc˜—¦‡ôƒ¤ÉT„åiùšj‡Š§Ø÷b` JV0ŒKR¯i™ ;F¶Ìž +Î`ö‘á aÊŒ¶8©’›Ô;Ö¥&¡@Ò¹åïkô­„—ÿ£*…l‡ïªöŸÆöpjQËãÿu”€£Ù]×j‹¢í¡ø²ˆ ËâÏêÖou•T)gËŒ‡ba};ô‡çFLq¡°S@@H½i —’.útÛžÒаè]-^*r l×â"/ìü@‹xýð¾–M•™We+ÿjxŽ$ðT`P¯"S‡Ík!w–8ØkŸ+íC4Š•tmÚõ%3ÿØ|âkˆaÈy(¯Â¢óžádëëÉœ`v€˜Å±ûnô/ý_ ,kÄŸ¦{o‡ª’29©¨Ó%Þaü 3ƒ‡FÉ£x9>¯g0$•/§…19¹þ +Q®n0ó1^ÒG¸”x»lw¯K*aÈàKeÅooy˜_ÄȤ5_fäʨÚÿ‚غ˜ +ÒÜ;Ç#MÆ®+üo¬ 2QÐeM…f«„Ç«^í­—‘³MÅ©‡â8Ÿ)ØQŠœãü‡ö˜7\àµí>›†{¸ª»ÇS¡Xÿ9ã“ Öš™_˜’Vº‘ú‚„K“V©*…Ij¶®ó´²kV!‡C,­§eËG‘/ãS9Àdh:U5 ˜À¶ž§tÁlZ©¤rHÁÇD}‰TðŠr‰«=b;È÷³~ÀGðÇOœ¡ÞœjU‘-ÚÃyËLì—ö kUñ ×8PQî×0¹YæŸ"o° + }ñf*·Y=æäu§TìC1·›´ _ƒðG0*ݺLd<²2\å,ýj]øßÛX…Ûƒ¨©zbÑ ÷K‹”ß;+9íü`¯1ã$CÕJýž8ůj®ž%U75FH}]¶aïtÛ1ç/…½xú¤Ó,ôÀÜ#$sâÀ8Q/É´ a7…æø«È|rÃU¬¥jÆx¼ÏZG†ââ.$ +Ã.ñ·u./èa~í9ß?¢é°9aG!p¨ÊVì)I nø1¤"+¥ôÿƒdI\ð±>[U—y¾à¡ê,²ÄèôïßY‡¥yP©òqEtPåXŠŽ^Å€jÃÉñzë ô}ßYp…5¨ ˜ê9ü²Ó öÓ+™ƒÆñ¯s<;ò=¿?A>("¤~y‹p›Ü)%V¬WF )¢¡×»³E— ÞvdKª`Δì×vÔñÚ¹ÓØÛl­AöøŸyŒÒjo +IÓ-Z=È')Wõ¹d!q¹½«£LÙg¥J1›c}FÀ<”Šà@ñœ¹i¿³Ï#MMµTºQöŸX”ˆSÓßdÜR¦oÊRð¾csËÔOÑ+ß'F˜¡!fÜyš"wÑŠ¬=]la<AéWÚ'\zF?ët¼hÚQFB[²¾2ÛÔÑ(I0þ„«W:…¹fˆÙo–ž:ë^ûõÒ˜'ÐÑý^67³½ÖÚF$A†@(Ÿ.vÙçㆀ~dìÓp*‰íÃì$‹âeFÊGâvËT6+ë%2…†1ªËaÜsI«5/¿õ˜RSqH—JÑ߬ +„4\S13cp¹6ŒàŽl#6Ò—´íÑ%yø¦h†§^¸) ÒüÓ\²ë[Ô’²ÐÔ•£=ÒÍ/2Y¯Åµ5“S)iq;Ofi±¿þ®´5öo÷qüq3Ò£Šº®šUUAhÏB5v.»’Ók’ýgEO}Û”1Þþ¸¤ÓDõ£~ÓÄ0¦!ÞÄw€8*M¸zЩëY¯žúàÍKŠ^mGÔô;¨»=i|²?8±_‹ºÿðEÙ #:p“¥š„T,ìCÃÛooÀrsƒ‡›l-¸ò²ùRåý:\ïmØðnz¬ÃêÐoÀ ´•PÂ×è<”s½r°¦,¥puX#¡çÌ BBî–¤EäAƒZ§ff^ +Âîj¤SÍÿÊPªš?ÉÞà~xägsæ‘Øsqô†ýMï“ w($›¢·Ð>œPùÜá Ž=Ö.¢¨WT›„äÌ$%é÷=„ൊÿF}tx½l¯þJzm¹`nÏYÖcÉ·[—ÇÇc°õ ¹=!‘¾µ TuùzLuIo9ïïr9«9rfeº7‘ð3ã½L~}Z¯öóÄ-iÑÑêø£¶â㉯¨rzC¢›Ó£xɪ¾~vÕçÇ€¶ëó8»uo$¹ÆÆD†$å6­EÓµÕ–ó*ýÛEÇγ‡cGw@nRé5ý†ÈÀZ*Ççú8ŒGç©©¦ÑÛŒngÞŽg|,Lß{Õ7,Ÿ¢e‚ìùÍ[“1NoF‡†-/ß6»z:ˆÍVU>îÖ·”`x}W;-¡ñ„Ôë~ƒl.ÐÌ&ÑaÄ=âu‚¯8D—r¶Øòü9®äëZ†©dg†w%pƒ=4—~¸ø­-]RŠ´ÒÆn Ê7xB±6mÅÎÜ‚Ö9 ð9¼tjÁPXw숰ãwÒõÒ°+T\k=¡€›ýÿk×>¶ãËÝ;ò¬>ÍOk2 s¶1cÜ0>sv7¹ŽòU`G{ ¾:¥dKЯ&x¾Ì‰[N€q‰r«'¯þñåå°•…^¬‡BøU–ç"¿Ìð.ÖðL¸C ‡Xg‹JýN±|«=,ˆÞô9 ô°pï{À…–9.°)"DÐgØ‹¾ú¼` ,ð˜õÒêLà·ÆQx$¬ïû™ß\ájŠ´-}óîJò kÇ0A%gë¥ldkóÆ ì…Ÿæ¨Š…™n…Ð2Ôü’>÷6._ `­¦³ÙÖO:$vБùk’'{\8wÀc•„Ïÿaÿ5'do•uáI M‹š±Ϧx–+‰^8”¦Ø]Ï®B0d…£Çæ+¨¶ôŽWò)7ܹ˜:—£‡PLâÿ}œo„t[X.|ÐJL ”5>¤Ë¥ejIÊ@7bQý¤ï>µ¤‚h¿ LG/éŽ2Úó6¹ž1áðÛ—ýÀжC&àüVe¸Jœ'×±£ú7òùÑîr y{×\:$<ÿ&$MbÇ®ÁžNÝ4ÿÔ@uËD#®=&ôÑ•h “Ä{œ(_©Nê‰Àê¼-xút ÜM)ö°É¤Y–ô2±ݱ=écǬPœpò†uø¿bÜãé*øÒÜÀwû +²®ÖÛµÍ27g’ÓdŽf¬î‚NÅdWr‡Ñmt™N-_i¹ôÕÚÉ{"ƒ;½:>`¶‰jpÑCêsöÛ–AµÀ|ÕJ§£Wð³ôºà~øq×4ÝúˆÚ¯ˆ8ß0>ì{—mžvå°½‘P`·šŸÙÿc} É8uÏ1¡È‹õ6¥›KÅέ•èšŒ‘hx/¼Þ«P¹<ý +"ÈÞþº;J¬†‡¿“ék+¥ Ô³üÿ’íÎ@}–ÜÉöiØhh>ÉÌ%4™!«2‡G0”y7öå¾^ó=¼°NÞþ0©dñÐ’é­ãÉѼͿµÝn3»8œ¹bÏ«‡GŠw‚ÎdÈ&Ïþï,ò|ízwv¾a?ŸSÜäz>¬X±Ó x +éT!ﵡR¾*ˆi}gJîैI^‰“Ëh*Û芗=43j>’ä¼£k(Þ{暣±0BŒ}¹`ØaݸZ€sóJ„IÚzzµ›‚™P¼ o¡;ë#ïd +ù]C© ¸»N‚¯1ÞvÀŒÈé”Q=jÿÿî ¤·Ç h3µQ^ïkSÍDW‰úì ˆ:îŒÀ‰¯žÛ¬TžóªPÍÕVU¾ ¢n%ÕÚ²9Ý×£^ûÿŸô,D£¤¾¸)®ù™D0óKXÌa`¦’‡É%=æÐã§8ßš#(5©†ÕL8\~œT¨ãˆ)ÜÙÛ&OÜ覷·ª½ÅÍÆí•Ó¿¬‚’ufå©sG×xuëX» l).aV&.ÿs=ó`.˜«æ 8€üR—œëe¸Ngâ»F±YÀEµ¸Ô탼+5Ë4®÷ÖT¥ÀÉ lÔ´¥·æÕ€á~°™ Þ7…tÈÃgZ,¬›èÇpˆr/˜Z·+Á»/ÝÉy׊ëòÕ%3GX“y•»m›Ìz¸‰*0'vóD°}g¦OŽóz“¾W>²á $0ÈéKêŒôäxu”€´÷@ÍÈ Ê[Oà «l~ûÁÈŸ…=Ñò-†l,zl²Òûgã~óvy„)«‘æÑ5¡é´‰tòÆ…y ×ä§)4íÔçrJÿØ©«šÒgþ /+Ü;ζ·_ù÷îäoÔ„ÔÞ¢‹åx1ƒ×X-)zÒ}ø™“À'm—i»¸Å!j YAjÆ¥¥þM¯L$ˆ>dPÝ/ jÀûß¡vº£täôlzÅ<1_7éYGËy4ß‹¼íS‹”0#æ‚ÐF üF©h﵂eò¬GË0PÁúT:D¸N-8híX۱ι#;žù-ŸuËÈóC·™gÜ㘵]š+È ©Ü–=¹­êo‘àqûY"fÃÍ)ñxO”æŒUÊ¥D{’®É(S›€¥i®S1ÖörÂÇÈ0¹²‡\*káÁ…{ΑÜ%)q’B£~^Ÿ'´“HÚ Ñ9`[¸ìbbþŠLÁçÂ}½KÕñžGvµ3Cg[‚~ðSañ1ýM´Cypã;綞D .—ç ܈ ŸÒ¨PGúÈ@‡¨­]§ØH8¤ÈÏýF€[h­p6n§éïƒdyýþNć~qœk#Çv° «^±9趮;‰#îögõÂÇjÕxà¿lWl;èÛ}”æ}"â'È~ÿá˜çÑ1’?(ð‹Ï²+ì‚Gœ¢Ž'‡Ú~Ýúæ¢=C.iò ø¥8[Rj5~>c¼Ó¼€¶Æò®aF§Ejó»°âQð»}[ê,©ø¼åYÄ}Qó¤lí¯¹â¥m_ÈêK[X“ uC¿Çc)/[}|aÅg–ÅQLÑ·´…«L³Á‘¯à~#ðô{|JA9ü#«d%°û¯ýÿk-2ÑGðAW‹Xï¿U™J]Ø¿bÁª½Làðªo}X°Ç›K'¡¸`ò‰å#NÀÀ·Ÿ©¾ +¦ÂLÙýpóÔ˜)¦,zEzáxÖì¨ÎÊ8ATÉÆŠw[KÓ +˜¨^øUM«í0KsÒãÇHN@}‡£›qóEY›g÷/ÓÝz*üç+»:Á ~“¸ÞWTÌ\¯@@«å5]µ´¥óÊ¾î† w`À«…­r‚9þ±u§GÔ2Iê±)‹(—Ì +Q“+xÐÃHlY­.| ªul©\RØ¿=Qô íêàS7Ÿn´ÿ%iäc}NˆÒ›\v©š+5 Ī þSåÖÆèJz穼\#[°ì Ô£'Àì|™þ5Ù*n6ôÿ5„ § +Œ³Òq§*wèuëÿ[´ã«™²g¸ÀÓi%r¬ç_O:Ó0n% Bnq¿G¿jï¤Øo  «@ÿ÷\UIŠ÷é7¼qV¬R²Ìº‘œœÞÊ31IÌȃ=*O~ÊgÚ‰•Œ‘?ó_&‹".œì,½„H¹Na4…sa¾Ýì ?$×Ið UÓ;un ’Å!ç0óÁ®&ӃȢ̺âñè‘“Uj~ã´’Îgãx7[R0u9 ýö`t†VÁÌÍû=…9ŽbðU@NáR0©ŒwF©@¹,+È[4»Y¨ èLWtÛKÉž"—FØCŸ½o/w\%=›óf …uþfRÛ>è÷\7“™Ù‹9ñ•‡>²<ßÉNñ?<!+—º Q©eÐ|žU?ÕçÖ\©8>:Õ$ɪáHáîÔ&++¶\¸úr‰V¹êIù5h¡×<ùcL"4¥ æiyì"u²é2í (Qsºý8ÛǨïhJ\WÿÖU^QOnÎÍ0¡aYüiƒ}6…ÐPŽgµdÐ +,'?ø!š² FyS=Jµ®€v(d<ÈX|Ûí˜m +÷ȵu gISÔÝQŠžÞ² ÚÕ§é»S. +”æÓÓ=Ad.ç–Š3+zq¯îœKH¦Êh›{äN$%?Ø—6Ÿ¾„‘ïï8å÷{!éz±˜×TvaF¢ ãí^_€ÉbOøIKQÀZùìÕ¬ä…i¹5$BɶpÓGÕºÛü5”r”‡W&á5ñ€&BŒ)xÛ\1mmÖ9ƒ¸×çxö´¯Õ†ƒx›†Z2ʣǑ*ºF1X¦ñÓ6·Ÿ¬j›ø!lÏ­{$lµ‹á_"ž|?ƒÖ¹dôðë‘£¡îåhÿ/ê€>„1Î}Í&„š(7sí÷yPv•Dn&yê2´Cóð¾m‚¹ Ôƒ·Öܲ-¯ª2­ø¸Òþgi/³ÐÄ †$ö’²Dò^§U#—÷b!çãü…B½ÚÒgò•@Ÿ#€‚/ÛP+ÛÊ–@òñ™¡}(pF\Æ'ðP(Õ•¬âäì\Ì~ù ´ßž$þ&éÕ°¹`‹6z:Doe  +‡FÚ–/¬33-@+sÛò ÉN~¹õ¿“+áF¬*ÚT+x|Û.˜£ÓMM؇ô#…›‚È‹‘ŸÐJç£B?ÆÎTŒC{á›.‡‚ûXb6bÔúÖk=;¾("]gMí<ªËÎéa€°¿ÑNsʯ4-+˜ Þ-v¬+ð ƒá(w|c-:Àqb²? Ç]Í {5^ÿúžðh’žÙp™9+—‰ÙÇ¡ÃNŸFÒÊâþ›€vN/wÙÖ›N94ð-öö åÕ7Ølöÿ&Uí>È|btÂèNBIðåšdã\| Ü€„XVŸVƒšŸi#B_0áM·u¶Yˆo¸¶ ¹oïaŸ}<|Ší~u˜§—èÓS©BE0ßI­;q°Ã?ð”ÍTˆÈ°j€Mé²Þ趯?ù]ÿì>ÃÐ|Çc,ŽÂHPߤŒ¶–ÕZq¡Ú³Sÿ +}µÝ÷gAkp÷Ö¶ ÕK¿Ó¨x•àØk±LYíuöÉS§þ7 ŠŸT—)n¸®<=eÑ~ñF\Ž6DzpŠ@Ù*À6É›½ŸH”qè~8o²öÆTNă)o[Áb;Q$íqÞ€µPNrÜc¶7Lmj@ÆöÇÑ#Ý9RŠS¦±²ËuA5$ºˆÛ›ŒwV$³âKpše_ê™Ýó*¤{ Õ+§±7Ã==:“ô’Ùœ³¸M\ú\°zf.g÷­ÄåyzK‰¥qk\>ÁÚ¸ÚS3þ9•Fd”ˆv°;7ûœ…ní”Æ ÀÅzæ¹ztÖ1€~Xó“4-ÆEäÓ€›Û¥óyÍHSšß ý7Lϲ×f?Üéö´„>98vøÅP_¿ [-¿W·m7> j±XDâØÔåkD¥~Ø¢½ ‰@÷Q/ú¼°ãCNüBìÜ>™¯áìÒâj‘L“‹„¶£Ú´7g·Cêgj÷µâ¢\je{—ãÍŸlŠ4|¬ªöÓj•‹]Œî®8ܧ·5ôd¼ª§?«Î\®`ªà•P2O©[¡ÿê.Þ_È34›{ u]hø¶Ãê1±]‰î4‡øV#\ÒT…îóÅr­²#8”aø,ÝêaÍú-òÁP¢®ÏÜØU„ æ¨c?Z†å6Ljd€–°íÁ6)‘r>rödÈmá«OàÂÉ…\¬S’tšf‡èësáe=^]v +ÁkpAÈ0?¤’Ž08¢¨E‚nC’Èé¨U‚Ãêé å¸î«‰y@cJĶÑÃWiéÁšG“,(6—Ò”¨~“íHï·Ú…šëF2{ϱìÅ5©p*N´û+5lâj9pøEž!¾(gÆ«Í põ€ &H5‘)¨;.’âX5/0ª\”îôÅýÂÆgdŽ…%2‘ö7ðCµ%¦J×öc`J¿_= Àó¢ÖrÅžôïr±ö¯ +üh™à9ú!ÚÓ”=Ò”üµ•¦T؆b¡@ôÚå@‚(ÛÂmøˆ Ÿ„SŒ`]´…‹•C°è--‘Õy͆éú·bKUdÄ/äsˆxµªU]÷bv¸-šFp«l ÆÒZ ùÿž4FèÏåC ûIé”Ý6¸¼M˜3 ­°ûl«Þ®ÍõÇï}©4»g*h__Žñ§¦&Áñ +±¶å¨­¤‡?»rÜB« +¾VÕH´óigÑH|U1ÄY=ü·VðÑ Ý›)IðaÈ +Õ¢c<Øž`…º$¡´8³¸õ,à­~{DÞf×ÀT r˜"¶Þšæ„”þ)è¢xÇ„O‘\t¢O˜ úT\c|@hhB¾‹†Ùµ*1¢Ø;ÝàŒ÷K‚6S%É’ƒ„|pK`Û†zòý×L ˆ•vqн笜!É/¬>ÈVÂHWß+—¹à<5;·uÊtDÂåÄšµÉÖ䲎®'ÞH%“å N&ÿ}Pì 3à õêa£0;eE¿ÏŒGQŠüw;„«- v‘‡à÷èÎx"Ô 2+7g‚¤YÒÁšVìîúb²1Ž2ÿÅ-ð>fš9Wh}n!t\‹IðmÇ4°Aw1 +¿Ï?3þÔ¡EÅgþòÉŽä@騎²ÂÖÖʤo¬š„_EŠðꯆÙV^g~™ú0ù` C<bàìêª |€° 3U[‚Ö¼ ™õMVÆß·„íÀ¾¥SÉý°^ázËT\@¹z,õèƒ*ÇvžM±õ4ÏYàÞ8–X é2ÆO >{«öC¯´ëžƒezHï9øõ§©Î‘[á_i³™Ö ÝvE\À€TC%özs¶ÏÀ¦ßÊÛîãÄãòK æ ¶ô¬j}tv +W]{§í¨áÀÒˆ÷"ÃŽìWLá<Λ•œµ[âîÔß!ò®§q¤ÈÝLtd®ØUg¢R¡¨*Œ=p†…ݦ¾xûÈ»À§‹ÈUV—">ŒÖ½^v’,³+šhZL;lÚœ)ot¹!${ÛôQ½uZ¶LabÆwahë¾¼̺dZËY‡Ä‰û’‰3T#hÿ¼œb>©¦â·ÔR4Ãfng9£ãúŸ¡«ï.¥bx‰ÆÍ;ò-ë°KOóV£Ò£ë1+*ïJ<=#ì +ôS~¼^ÚÒ/Ø´1œÌ <$5ç|JÏvp 1R8:Z‡:"ѧ±]‹ Çc(ÃAëQf÷j¸š¦¯ÌiWÔg(k2i‘ÓC¨Îx$ÇËCcM”Ë-mù¥‡ÕnˆD #ûu»CSË÷îiAßÀ’T1N‘@kxh™¿™bÈ3X¹SŠ/´W"uTõr4䆧 T* +‡ƒ4à¤É +ŠZ@JÙy˜þh7ì’5rP“lÜüãé¿c”„5Èz#³BƒK8mâÄÊlŠUì$©ç€‰7jpI˜¨ÍqZ=Yª30 ?k蹘›'mR,F¼ÅU\;ø®ÈBÚ3“°¯Nø™—êyŸ¤jð{«j +»“äw@æÑ0Ä'h‚>lÁ“ƒ)Aó2XÉË@Å]+ݨý0ÿþ8£…IP¤;?å/ªN°)±x8/çýé³Â$w(‹Ì¤ö4Œ‘¿ÆÙá™üSo 0à±LÃœ9,ãYˆp`¡<ö{³€øKU$WL5;~ &ÂѼÚÓØ9K¤s¿Ò¢êG}inkf(sŠ«Bg–ñQ¸Š’ E¾ãÂÞ˜š©w.¯ƒÎ$ý c~<ô§ZSZÙY»‚uj…"õÐîŸkª_áû_b·ÖŸÁ|ŸzÂ@~G&@´¿" o'3±^rHåì-¼üõƒ*]}t²ß|¬Éb&³64Á$+4æέ–Šxé̪³¼!pÚ§mxš·ææ?r:!cÆ1 _"qé‡òÿ]ÜŒxEnú4sÒ#&ãç]Ñ''$mÿ2;s¦f9¤‘­µem|¶ßºtŠÙýd^†òˆÚZd·Ël\£ãªý #¦¹V‡Úª…uOtߺòBôbª9[éèn¸îw*[F‚Ú'«´V½~ògTh)ÅÙ0¸WG=š‹6Áxº,a4Ž`¤Ïl^b3Ý4ViOÿ –õ–z@ë^ø¨!} Ïíæl•ma‘±ûLhj-'¿aÃI«Eáe™ì@¤¨–hc(‰Sòý?w;f‹^ Í•ÅÃíñÑïpGóóÎî‹ë4MP. „oo ÈúÉÄ.Œcá>‘ù+€ûÖc¤_·î«±ÅáøÇ0´çôßñx¬"¼§Ý +%šøh8ƘÍØSÉX²Rà„T3G#Ø_Ü)×ÛOÐÄB^h«˜†j:Á5"Þ3‰l¬®D£1ÒÂ4©¢v›fFÍ›©ï‡¿†¯êÞÚvÍ÷À¸ÚÙ¹ܽ‰w„†ú³;ìõüN7ÛäÏ0KÛ&Ú¯þ Yܼ²88~±ãºQt¹”áPQãL<¼â´B“‘‡_b»1í/ÁuTÔ°wzkim·§je3€¹‡(ÉuË‹_åäÙwÂz(8Ñ<£Ü•ýš(9*”8¯&ѫφËM41Úº©ˆ7ðÂltS‘ð€vcúçé꺄jƒš ݱ?ëÍÝÕ"†›Í¼ü黎TyvI ãâà¡Ì‚Ç ‹ÿb’¥#ºßq¡¦^<5;QæÕìâosò¿M⧢`Óò¥SQY,ãw÷,Ê™‡ìƒ?Q²âö²Æ¥ßÄ Ò ˜I×Ì|Úó»‡ÛM…l–ÀÇEu“DQ`Ã’V9;fžJQO)7ò„.º‡cÌß¾æ`Æ8ªÛÅmÐ|V‘²¾W‘‡§Qüg¢•ðâoùahùãcy¡ûprá+MÖåOÇ)æ-`–LƒY7#9x¤±âD«‡¥F­ÜO÷¹uù´¿‡†ZéÛ6œRc¼PùÍmƒÜY7èLpÖ­>ùSfÓRŽÚÒ5+h¶kr…xÈ,fsúÄ‹Y £"%*EqeåÖ½v8>¡Nuv×GZ–’í–Êù´åÁÑ ɉÜOð¥0ŒäyçA®¼wäiH.´W«¶6;”˜*Ëô|ëÛgTEåÓºUTÛ›)纸%y˜~È-ˆ¾?uµOÄtãz¦UÔI;aYï"ÔlTÌÖ‹Q W¶õ!Å$Pb{AŒwþèîÔÙŒN¡^ISµŽÙ·?4÷úMÎÄ3p,ÏO¸ÒGAz7€îõñ«û¿pc9uÓ¢¡2! 8DÑVÝßM.ƒJk äÄWe:ms’b~îÙšåÇ'ö¹ k°}E>µ_*È`7…~¡®›žˆû` _a¢rìY?¢|s=óY,­²9üQ¾à ¾˜-¢ñ:—HèìºtÑE£ `Ìë£ÙdÕ#„œñIÄé&cªkð¶ïdY‚ü‚ú,n4Tbˆ9HŸ÷_ÍA¸QŸArc_0ZÉŠa"Ëé÷ìkÌ»K\ì’èöØ´#å´‹vñ^ß;þ§‡7ÂkDºÇ•@0˜\ˆÓ{õ£îè¶+!>¤6ª ôê˜ ç¬Qd‚‡D:Ö8xlÉ]¼i}™H‡iŠlÎ*g¶²ØýbòÒkJ43.Õ“*•uúù¤˜ýÐMF‰üÕwgSa›åÁ-ªtÓ˜²®_ãΆQ"½'Ú@èÈpR~d¢£Ž©ª2]£ï‘„#fAZ¾Ôýxшð®{l Ñfòp㮓f…Í—6Lè¬Ç’ˆâ1uû6CˆÚ‹ºLº@~,¢±YeWÖ›Š¢¥ªP´Lœ€ðÛ º›}ؘ] ¦`´ŠÉ¨ÃpÒ(œÉáíNöžx]*µa7/é ¸Ôî&QáÐiz  lžX«ylèUépgfàƒKÑ"äe :ÉŒ·È?;¿Š]øaã| ‚DŒgT!ö÷!ÇÇ?„™(’r úë‚:s­]pÖJÆ_-kÇLVmšRº´öÀØ90ÙF1ɇï2’㨵~™`[p§ á»àÌïÌt6© ûÏ8—FÐíä˜AM}6˜Öéi—‡‚´]˜ý»£#âœó‡½Û¶÷ü"é+úrŠ!¸ÉÉZáÛÚäÃßc¥\—‚ðy¾f¦rFôIÊK¤m ¦zÐ,f.y(7½Ö“×HÉ$À>JСg@ÂÔ¢ïU‚*ðŒ¸"n,AÊì|®ó«¾x]+üèãq\Š½ƒXa8U…6`›Uiï”.ý¶kÔC.¨|!èæ¤Ú7¿úŒ1Q"çÁ€XÐQr3 +±~¸\ÚÐR¨…g, wQàc0›OyMlGŠU™AAÅb ìŽÒûMsm€žà¨'qH»~B®v#Še¡˜’¹ˆÀ€[­ oòþÿŒÄ§ÆêI=Î6ì…ü^²öøVz§”òÇÄؼ. %µ5Ù…BB}3¯rÙ6¶Ë)¤ûó>·òqŠÎ˜´»á;‘!AZÎR}IÕýñQhº Ü!„.>ÈÁDÐÌm‹W3ä¬Z€Ùz¼æšÒѲ{þý ÅÒÁ²ìá«ÍULœp™^·tûžØ€†ɤo‹ï²U*çðs‚š)Œ,©ÖuP抪›3@–¹l`G'\ýyù«ÙøD-€ü&(‚Uöèž”d´[e—Õÿ¥<È}ÄŠ)) Їó<äB*®;ö£ Õ{w6ùvý–¦]ɪ«ìØ®¥6ÎmÀ‡% °LH³ÈU ìbìû®‹ÞäRû3cg¾}Ù$öLÖèŠ&ü)/=í†C$OÁQ•Ø溤̋¸ ™¨(2?Á¯wIÈù‘ÛßàÑy°¡ÜìUE±laŒš~ÄaÖK .8Dˆ‚ªÁ Ðu&ÔZÚtÄZÆ9#{x¥âv,v>XVLª’DOw€®M“0¶þ½Ùè@ì…€†ú<%y¬×—-FüÔIý àn¿( x¥úfÿr$ßÎó|òÛŒû¼gTÏNQ:“ ÑŽ¤j_ßâïB0Â×ÁÀ+ò@÷)ôTT~JÜ/‚QçuS› ²…—4Ež¼þqÈ-MÂð¦ð’?.ÆEzøª€}Tµ˜ÚÆèJF qúût\öfüšö'U—¢(·op¥éêîâÉ=…<÷TNïØ­EËÊöó¶÷>¥t… Æ~ÅM `O°ÛÉE  +Õ‚S›1I¸€^ 2è\÷»Ã[±G¶×Á‡I0A#µY(Åw± «÷¾Î;ÏÜ[žÌCV9ÚÌ¥_v9õ÷,Â3“ ysGßpÕ½~|îQÁlV€œvÙ¨3ä#š—3|F’oõÕ%,”BÒá¬ÿÀ—ÁŒ¥8áÇ”&aÛÔŠ‘'Zhcgà ÛfPÌHÜŒTPØ×£Ù°´|Ýe’=×!Ò€\¤£aÛ$›¨‰¬Ë”€¯Mª3ÈÒlq†!dÓÅÏ9 ?ÃNXøx=z‰¨ºæQÀHAm*¨Šf¾qÒ Et/Ð<}–ãä„ÉóîÞF—h`Õ}4¸[Œ¶¯ÒXøú˜yE½ˆëZq)ge §³P9üú#‰bÑ…ëŽ0xÉÍÄ%ø×Ç07-•ŒHktÓùWa. +¦ OÊ­zÝ ÃopmC™™Ù\žÔöy +lýñ¯°GüŽX?1g¸htœ\6ÒOÑ¿>‘õsñ¸õØý÷JÆWˆúYXÆqtùsz\ ÊîŒ%†ÙöªŒ+7e¤`¼i%#"j²*“ÿœëö§Àg‚·OJÚRŸñïG‹´5"ŠX‹‡hŠmÊù›ù娄Â,S2,=±¾øñúz±­ V£úÊSbl‘j8d_ü”6lô\®‹1’£>~K??K•iÎð=üB4ŽMðì$sµ2X+ 8Ë<×yZZì½’Û_  +ù>ºÔ,¼`ÍnÙ‰Šü¤ªøìÎQ0Ìÿ%—}|˜¯¤þ-è  »˜#ݨay+$|?ºð’¬sö„ñx cáiÿ"#š|Û¸á›Oa…­IÝ+{B÷áÞñùEðb1KɘųU<À29©=A¢™6í ÷Þ 3ͪ‡@8?Á¥ù©æ×:P´‘uDhϧÿ0@S‡F‚z=az«½²Xxªµq[S+¼0úcš”› Ôœ–½*TC[à˜µ“šß[ß×ÌFö {úâåHꙊm1Vˆ¹…!Ýl’ŸÂ\Æ¥ç)V2¹`r¶„ãð¡ù9w‚ –þ–Ïør(¿M¸¦ty¥É\ƒeÂô1QŒ¼ò;d£DÂíÝ‘94ªÆÛš²œþH¯mÁÃ×Ùq@˜1*õí¿*>Ö9o¸)n>Y^´ K…¼šËúCWí££¦ßÕÌ3²¤ÍË ht$^2\ Á6Lu]ç}úOŸ ¤%1êãˆè¢Í¶<†êÚQãLðfÅú‘±óOÊŸÝ2ÿ=Iıäö¡^÷6×€—Õ.ÁÅ4Bâ-Þ¦ËJ6l=÷Ñ?dGåì˜2¦FÓ÷²û4`Mß™iœ)¸¸}¯ø»ö¿ûFÚê°Ü6’þürÈpC 9Íb”‚ìš Ž’ùünÎQ¥+- üI +ø¹÷)º’s¦Þf8Oco¼n´Ñæ‘ë…Žb“(Ήr¶7WMÁѼ©zémç¹]S`–2^`÷ ¢Ï¯Áœê¯”õß䦓_¸- ÑfJÍØÆ€B.çû=1—Lfc[·§ó.À‹ï¶[ÊUÝ6X9¡q˜°ƒ{ý2‡pž»Rõ:0ñSI9+œ&HÇW´á¼c|V_#ÅÊ­”­ +˜#J†m¯—&»+ÄN²Ä^³Jt.Ã_7‘´§ÈgÞD‰À[]¨˜6•ÿÌú}îoÉçÌëk#ð]%>òuB_zŒ'´ãÔŸÐ'VËÜSÿr¶ŒdΣm¡Û1+ª}Âj¤ÊV¹¼E‡óèíÇǢ÷ɇN/5ïç{²H&èÕë˜ïö â£F|òÓYMxþÐkúõÌË8/AoQ&*`ÂYrýkQ5Û`ý´zä‰ 6ƒLûßC']¨fŸ‡†\¯1ëJÀ11–?•jŽ¯˜% Z5‚§gˆO},Ó)ÍËhÎ[ä`ï»:nH‘±R+ŒáááŒñgMa+žóËsKšwesx{£ÞÉ\¼Hª_·aÀ³`%•Ï±(|Ý÷ÿ´Y`†ÊB¤j´KÚ»9FàÇcëAæ{Ç8V5ÂxYm*QJ HYfƒ1”ÓÆ¿ñæB€. žÂJŸ‚¸ÍÉ1Š0»ÿ[Ã`U¬B±4C"ü­bT1ÄìùPÀ®ƒã‰ \?cÍ|s169bˆÉªn*&sYÂÿ¾B šïŸ9ŸúpŒ§¡ÚváûbóeÉÇJܽ³á* Œ½u®Ž*,;rU®L^v¬›½Î’ÚÁÝ¿ÊÀ;Z¹õ1·ž(>Ž–tƒMÂíÍ »šÀÝÈÀq2³[q(O½ƒÎ¶¨É9@O•”­2PÌ|ùäƒOH ¥Åߦå^Ñc›Ši–:BªÜ³™–^Vòýî/"©Øæê4ÆT%ôâ%ÅUg¾D£žU…¼:%ì½Mow}¯ºÇ烼,¨Æ³Ï†U¡ºþ½áKuõû}ÕÕ”“â§9Odƒ¨ó3YtØ +3¾ øƒöËö I + RñZ24Û¤HÔµ£ºŠ­ËP rÕ3C8AÚ—ßWÌC&Æ¢ÑÏñ;l–óœúÔ} DZz ÙB7B?çè¬]mwíÜná ðdJÛçÅ +«6z#lû¤Ò“Ì?-ÀÖn" FÀ1'0Í+ì`z<®ÇÔý€tH l,·ø”wb˜çP“̃ªg+’y¾Lˆç­wEÍsHetsY@cöK¾rAT(©æËB_C& LlãÁ‹†§¿œH'Ê‘óNاùÔ¿mAŠ$6ŸiËUç’Ú!ýÔÎ1ô/°ƒ¾Ü—Ò4ÅIù"¾Ã‡áÒY¨³áÞÄ:_îñ£ò]¡é›Õ½Oú©ÓD(NwS?*wÁ“×+äàæÒíÜu¹qPáЦ„‡ð,é÷œÉ­øÉm!Ù+¨È|H%qö8X^ Y™¬".-7²ñY¨0V~ua-o„Zmeg²’TæöÒ˜z–á\‰g–i/jѨ,Dõà@U¯ WY2WÞ,8;HÎùôö‘vÙrN=ïfîòÛ ù©t+ €‚Û{¤Âô4kD¶of˦ÜSLÚ‰:,*˜ +Êr€ß3¬0 éçX-倷ðýŒf‚ Yo⧳µèO^dé8|ÑaúÜ´d– “7¸Ýž¡·¡÷zÃñrôÍ[3›~†AÊóA÷ÉŽ"h|õÖÔùÆUgDo:EõÙÍ_Òj‘©òtfäiØ]oÂ_–"wú1tÈ,ª÷ô rPeƒç=ó.|ohd}D$Éõú V·Fµã¾mL£À|‰Êã–ø[ÁpÂaõrÖz|0Uoo19†p¯ë±vðXð'¡ÂïSà é Ö;[nﺸPH^ò`ЈßǼh¬¨_KŸ²ÈâUϘöåhk»Z!RíÿQÉV½é î0ÂkDÝT7Áñï ]G%ÈšqãV3»®ºLÊßò T•bsS EøOÞŶ/ˆ³|ÍÈÇ,œ_èÃdßìxÏq†lÖ#ú1àJ¹é‘ÀäiŽC “UŸg\¾í¾¦R/Ên;[ÜA¿YN_¨'…Bó:1cëȦt)oÔ*wµÑU _¸LamIàD‹_9h1…šSŒ4ψõÖÉÔź,.Ç@'Ñ[N…÷Ú{dñ˜k†žŠïë¿Žór ~þóõD_÷üÎï€Ü@—¯ÌdÝ¡5JâNòŠ¤‹wôK«OvÝî^aPè|¡;ñ_ŸºÄçà*)V.ú¼}T%Y324IYº®‡¿îØ8=x†þwý{VÇ)u&;m%ç×»è4±~MnBLJ_va&Ì,@:VþÃ`û|;=ƒ§åpªö'¢"H^*ˆÔ+ÍQ|ò)”r—Û7\kÎ4JÀ³û-ÌÇÜá–·à Á%±=‡K Y»I®ˆ[ç•'(óú¬ÁþÒWÒ)aøѾ›#@¯>$ `LNæò yR°›Æ=‘ƒÛ`Œcr[-/š \e(øj4GN5­)êµ€ ³!ð<燬û¼Á¾Ê«9¶‹|Þ–ö6Òä£"ÆäàÆU&®šÀ\õ‰ü·t 'e{v…Y"7<1»É_¿‡€pº:}.kV¤‡¯_<`a¸µYÁ©x_—S`"þ综fÊNïìþ´‡·ú ëW8È ³É+,Þä1)œûv±mæG*nÇ,Á®Èn?91•,ôH* ›jëÐî¬2GÚû` +ÆÇgœ:!mÝÙP˜_á[(÷wü›[F—ïd„SÅE <;Â"ûåx[Xƒ@ÙÐ;ÎU¾L&Ý.Þ‡U¤^¾æFâV9Ÿæ\FrÿdX(ˆ*d–HÿP²"% + GªoN%Õ´sÏT:!õèÓ÷adÃ!˜Ã aàš3ì/V:_Nã‘ð+wÿ¹ÇØkWAŒ3½î!²N®ÌãÇÖ;aª„F"zò â¯ë"B40ÅâàÊ¿ý æmÌ°˜`‰f\³¯É»Ð¨¦›opS«>¸—b–è³0aƒ86M„¼¼!ñuøÑ•Aö»u…⥿™Äg¹Æê=Ø6UþG\ò¶¤›ïY/¡ç˜>Þó³ïW¢€:mÜù•ˆŸÄà¾Ô×”Žr7é›1ŠÇË ’¦Øû©‘Ç›BK™³šYœ‡w«×f]È;ÑŠ'3+´h¨{¶¯í×FÀâKí‹ÓyU”äi2.Ò£³›|½Ó­ é4~Û—e¤«AØ äÿÊ:‚¶~83œ@ .rƒåï¶ôUËz7WŽ#°$%ûÍΤP²Zù:‘T:x;1êTì&MÑx½Ll{AµñƒmÌ-\ÝZ­Àrƒe]œÝöSàýë,ÞZ%H¿ûílì, +P+fñµ—tßKBã…÷ßÜ ±¾û\ ;^~’œfö§uRŒ­Úú~þtĈ:$.&ÐQ²}±œÁýfE>€PGð!¦ù©Ëi¢JÆ’a6o-™–_$z¥Õ°tŽ|²Ú¸V-V«¾(¦­‚¤ +IÜ!C?q²ˆ´¡AX÷Iàü•i^¿–Âo¤›ú˜m`$O.cø Ð,€Ø¯¾ÊçÞ@è ‹T Ý×úþ +&n½ˆÔb”ò†Äoù29â: ûTF2€ +݃g¾[ÇÓ“×ØŒAOuÿYÁ|UNÁ>•°|?&Uø}J ™ô +M´ ®„&{0ªÞÎ`¶öYøcêZX˪Ɋ-Ê~=ÇÝ+þ l¥šÛ+Kåå`YÐÞõé#}©ðà‚Š—’ÊÝ +Ri}¸ÙÈ–AMOmÇ5Õz¦q8á6¨î§ZÓÑ@Z*zäc®ê¸ï­%ìl*4“ìpˉÛúßÊæì„R¯²ÚõðØÍqWp—J*ø5Ï÷Ÿšî+ÜY@ò… ½`µ‰<6¦“:w ›Èõ˜üT׫\›ÅžÌøn¢ïPD«]¤qIMÙDZ¤µ hØÑBn÷mz-µVö^+ŠÈn©«j«@z††HS°hú~ä0©æ! ÷E±»x¬4Píèg_æcæu‹çg‡Í®¸®ñà áÎQ°¸ÂËYÓžÿ—ju¤eœºÂ£“o?!âDóœ +äÖ]Ì÷ù31ѪB'’Wÿÿ "‹jGn‘½µ`ïçíû·¬jla5jöj¥ÿ0y«ã¼uHŠCþ”“þŽWfËÁî)Ž–‚Âæåbˆn´iL'oã+ éBáYUO†ÊÒb!X)T¾|"Óüì½,YPá~#ÄÍ&üÄÖ³oPTÀK¹·1ªºêm­•hÍ#3“¤Äd‰×šNýe…‡úCoÂ¥šbÈ—zŸˆ_±WE‡ Ó1ÕfB±G—†BtŒ]"œÎÐçÝÓ I­U噋èÿ“1uvÅP%¹÷Zöºúmâšþ\—x^Ma«¦ÜE£í?ïŸ6 ~ÙÆ”¾ˆ Wë½í2Çøa¿R`Fq²§ì14>Eü•ô÷‚{zö3´¤ÄÒMdìদW ó]ZÛ†_æ}£'˜¸†èr†Ÿ1MuÝ7Ôܳ“-åña4â`ݽï®×œ~¬?µ[ÚCG“ˆsùfº,\¤{Û!LUrú–÷—'¸ªŒ>€W†È3†êmÿ:0ÁŒ',ð.;\–÷B'ñö&ç®BOQø„9 +æù…ÐϦÏÖãÖ¬/ÍB±ü¿ôÇ]•Gú/˜òôÊJ*g<Ì«Aœ[Q"¨T~U?™ÿ!à ï¨w¬Hô2²MfP5+ ò1oÊÓ\HtŸ’ÝQ*–­Jdà¹EÕÒô=ÂãÞ× E7\ס‚@aãt´ãÛõÄh|]AšÇFÏðøU~@z–˜)®YÈMK„ÚïA²ÒhOS¿,Ç‘–+<+÷ì€P?E`Æeï+^K<…ÕÍÔ9Iࣽ³«ÅŲ gµŸ\yˆÑ-Žüwœ¢ñÝXȬ§ùU)w˜¥®*³.ýùù°Ìhðl=¶Ý@1+Ez6"ÃTK 1Á/Ú˜Ü9Id{] +´í` +47öµj¶otk£—jo¯VA˜drêLqøÉQÔ«ô¤ž@˜ˆÂy—Ì3Žƒk‘£«ªxžáo5ËÕÆee¢}ËK‰Ýi¦yžã*¢?ï‘›óÝ 'Æb¹]{Å3#ù‡#ÍË®Öçj˜ÂàÅGÏnÒ£Ãnlxò,ÃÔåǬd`ºu¶ªÑjS½éfð3²íÃîû(ñââ;U¬gÏJ´ô€:þª»¾b<2AÅ1Å;ÙûPmm—•ð‘º¢T5CI;£$ +›µ8 7à|­ÈLóL˨ˆu±"û„5ÎSÚÒ¦3,dÔ‘8æ)š‰i”4ÛRä5.(B_†ò´­5Ùôì¯ÙV7P*WX+1Y‘jF„Ï@8×»‡ØDhõ† VµÇÕ•‘¶¸9óC‘°‡:Éפ”¯=ÀšS”ÔŽ§?‡ôVùªIÚ]÷€=qjPëìŒæßÓÝî5°d­¦™C%%’%^•3Þ¢« Ofí›oGz>ÕyÂ@ŸwÙ=SiMŠ ý>¹áS„ý€KŠðæ2¶ÁŸ¤¿–Áˆkoã +mDE·vÝ­aɾ6gâL‰ŒÍT½^†3©‡ë ¥øÔìÄ°3Æu¸¿¥¢ä°0,²Ž;À?sƒN®‹Ï¼Š%àÅó&Œ­²?û)x»V"Ùzè’Ù~ÕžF*°®ü¯`Ò +^QhTÌ;–Q¶Èàä8Þ{Úãô8Ý s-6õº&PCÉCªMèÔëx4¸¿3´°ÀøxÕ £îj·eH߉d³™¡#†iHU£7ñ~°±.ýÏÝøn·a‰¡Ýu}ægdÔÍ& iìè›R(×؃ýW> %T²Q¾[ÁQn¯‡¬ÜBÃhvIC%ÆÇPãMÄ€€»mýбáª(M@¿úO˜ÿsLaí¢â¤à“;!=r[Œõd®^‹lW‚ǕムΪég ሶØU~´|L¸>‡²«ÄY ‡û•|gÉAd˜\À|c¤3ƒjw×…P3Àá¦UîrÖÖcºj°­ÃYÎñëRƒ-˜qÙ‰I§µÊË(˜U<ÃvdC˜ïà›¿÷ÍÁZÁܨl` h…hÓ‹ãɶ®’%«åï·[ê¤Ýg ¨¿m³`rÕ¯]­«d5_röK•@Ž + ç’âvD'Uq§ºÖÖÒˆ_ßlbp?Ÿøö„ËVW‹TŸ±¶AÐ ·-—÷;4ó&|;çÔô«-bÐß„ò =+Ú¢¢>Õ=5õ?Ô¯›æ¢îÒçÝ ¬†C*ñÞ¡¦Ã;i¿©9;Ù8no²Ì2daêX¢ÇÍD2Òí†ØØCw>â–ªýÑ4B~¼LáDfAøþä(> ÂF–ÇUh“†Ù2¬ŽÎÍ#3FÔYO!4•É¼˜âíØýùÑP¨ÒÆg}ÿI¿_o?—nOópü4ËîìîÐ4d¼,ã¯ð<ÁÇúÎqó¨ꎡ.Ògvëm[Ÿéû!늻H€µ’´0Ý c§¿ÙTÓ«©Iߘð'-°2®ÞõœÌíŠa?ª°¥%=¸“ÞH©$˜CÖ¡Û¶x¤ +Ö#`ï°sÍFñ9ôS#~tœw‚ìÛÔgüÎÓ ôúlS‰‘ µ?Eµ×ä{ ô3²a –­Ù¶ïoˆ¯ãc/­Ÿý¡pkáˆT&Öa%·©ð'Óöz´‚€ƒû¬q=ï³Ï¢ÅÓ÷]:¾š·…‡o"»û“xb! gNÍŒ„ôuQR^ÛØpjNc“kÄ/@9Ç 9¦êï{çë¾²3weµ÷ìóô}¯t$œ“Ü›/©9¢ÆkcÝà=æä§ÞäÏóéÚìO%Ñd÷¢À>?'¯äŠxzpž-·ÌšÁ°âhÿÀ|üÔÈí>yöMõeÒNáG›Ï³#ò$‚Ô£Û ý„žê¡Dîò¼›Á‚n*ˆµ«ÂgC8³NnåáÛ>¶'*õÏGÑœ’¢EÇÕ=7¥Û‘ofG9'gRüÒTY9’öƒÍcI­ ÛSØ# 1]Ó©yª_éáöê8‘ MÙHwfÐïÔš‚½;ätBfØ”jŒH?½¢YŒ Vä +"Á›ÜÓŠ{öM1B£æ–/~^VÄ3·k­™v,æB‰“uOsSñAg"Êp»‚}By¹š®¨BlßvÈv/_ Fµe/ÀçõïôÛ ¸Á9„ÆTË?Ó/éQ©1ë$0ñT´¢—« ÕÉÄ5Ó¸GžŒ²ª6Ò;jÌZ+¸ìÝÝ$+—¬>ò#»LÇð[êÛ0¼ŠŒy—0oYénï ~·V½1á ´‡qd§¡Í¾œzÕ+zÁˆ²ê§‡»¥L¼qhQâô|ã-.`ŽEô,¦Þ’zW/HÛeò^Ù?Ƀúogh¶E3ûJí×›‹xeoǶ!¥“ûŒ’:âï@E“ôprmÄzILò›XàÄK´dÄ}Ç. ¹pn¡ËÛ¯©rpÞ¹…Cjj}ÞQà;ëÇq+j`J¾#µâÛ–Y9jmZJbuÿ&Y4=‚À§‚lÈLÑD^g °Å-'–Û±8ˆö¬‘3wöH_ÜJ@«!Ìž àˆW€âïXi²o:¬t](Ùp,¹ò<b š^rö#*¹E%8—½uË© oþ©^Sp-<­\ñ¡;ÆíB©•P¾j­'³‰G×­M+´x×KSñFvÕ \…Ù µ‰ŒUo n¸Ò*ºŠ'”— 6`³kîؾ +Ͳ®‘’}RâCàlýÒˆ¿4û áŽoªÇ‡KHŸd‡®¤ëŸ·€Ú9‡]ØO4|ëdðœ”,Ó-jpCÒœ„Û¯<9M,âìi5qšãÈËF§b€$X=’™1ý¶|b®Ž>rÂÞÀ~Nó„)q“ªJJNò#šÍÈñªî¦GÎsƒž%Ó•žÈ®'©@*†l6`A§¿Âc{?Œâ¿y[biIòRõþAµÔ*O6µÌNcY*A drç.•Ì»…-¹iq¸ëÅór’ 16ð ¶:ˆõL”Óß`’¼æ²~Ëá©6q™ïHŒæ·•Á²Õë¤Ö=ÑWÒÊ1tlÂìjøœ!Á¿ä•!-‘©«¹t_Àiñu—3p>«:<23ÓµUœXâGBéè=çç‚|\³îâÅVs¶dœp/$ûzðlQÉ:d{†“’ðg‘×Hÿ…Èxr  .¤êÁ˜{¬L ¬$§êñK+ÇW¯¥ð*j²ñ _°¤ç}^F£w.«L¶ÆϘ¸Á/ÀÀ]œD2ºL°9)g‘a += Ö—¬<(NÆúݯ_FŽ5ÂÒÁ‰¢Ñ–Æ"ÃÚØQQ£pèŸå¼`¸M™°fMÞ-3Kð+QD +>èåÁTyDZ±/[…Ëë0TMïá7RïõÖɳšîŠŸGo~˜í:L²Ñá¿}.¯gYzIbY‚¯¢Ï”ùA‘έ¢T¿š °úôy UBBô¡˜“Ïÿ7Ê6"×°Ò.üá«17=£Â jzßšiÏâk©¸*Š«"ÔÅYHÝ+8_ +üŸ`^l¶S"˜oã˜:ÙŽq±¥ÓN¼ÑêŸê<ÖÕ!vÂgõ»TæèFgú1}ZÆ?¯ …½7qbmŽù<„ÿú“U¦Žïî6Ó„¨nÈ´E‘¹G,×™,.‘¾Íàí¼®OÓjèòTŠ^ì~…¦\;aÖ*Sý%–´îo´ÜúþîäÄ-·ÁùJÿÄ(fÄ`z¨O¤*íÄS'édòÛJÉÅlE„ŠPLÇ¡r§ùW=#‚ ™\° +[i´‚ÓÀQ,¡Ž(Íúm]²FËGø²FÃÐ9Ãÿr‘:`­œ£y\Ì5Õ s£mò—8Fæ]‡†ëêü‹’ŽãùýÖ›,SÏø0a#v³I"½[Öæ]N(åà9vä²Q›Füßý7‰•ú‚PûÙ† Žim' ºd‹Fq53S4 +ü±©¦‚½.Ôý' êE¹]·|» `æŸùé¤Ýð<4-»UÒÉ!ñ³iZçÎjDSÀšùjˆTvãî•/'…æõS̽"¦ ñ”¶¿1-oEx™eS»¼Æüê£$F 1µAatÝ 2³9pÚîy*Ø3êÐL¿AÖ}SÝL\ëA“å¸_=pãs*@‚Q«¸>Æ¿Ù—û}Åå³ ÑÖ€hyYàî`¶y¯ˆ+§´˜g;õêÙ.¾’ÜTY’$¾~‹êIz' ¹§ÇÑ*çGÙ™ƒb¢`jŸš EÒ?Ÿ ÞÆ]•‰d’ïœmû@Áá ƒeÎ#Xò«îåm×7S3µïÞµãBJFáHH$ +Í,6ºÿ‰HP#¶¿×‹ô†€è¾c¿Nþì+4lÏ^g?gp]ªóôt"bÛ†{ömpy®rv‹]êÂ*)Ò'úÝ%s}Oz ß®•ŽçJò“8ñ±8€«ï‡y’£  Ì_ñ»»µlGµ›q*gÑŽ=6kÍõƒç:™€ngZb…ôÊC¡›ŽÈÏ,êÑEÅ¡V²QTÓÿŸÓ%Ú2pŽIç›èRåä'­ŒB} ²û×ç~\ø¿ØÑËУÝx!Wèxe 8À}íÓš¬ñß,™V@ºúa»@ ;¬ï–7ãHb›†-”ûPY_z—Y¬ŒP³FÿUO-Å÷Ñ%52–.mº9Xã¤`RžâôÔ‰÷åWFzG`orrÉ«UErñ®Éãø†|ñì5Ï·nËEÃ:}µªH`sù¾I2fŸÈG“V~4àŽ­àG5Îç—ê¾¾õfáVØ%Ó®am[¥Ê1Æ6ç=¨’l²Æ¼#’Y‰ëªöºrÎ^°’ñ¼ˆƒÔÐ…iWr÷åçNLP‹ú[Gò)0­Hu~)6èýý”»¢<µŒ¥B< •m[ûœ lYY®ú!Å.÷«JPN÷Ê´öÉU £Ã½PÅ{·B§ÖÇPp¿yyn*’W£:ꤸ èÍ™œOtV¢Á»xê™RÈí¨—B€ÿ·¿ÞjHî%êgž˜%õKˆí%Ç?.­2ø5¹ÎšB):t¼ÂnËú +î|uF ù ¥éEð—O×vÓ(¯t"ÛM)_ø‚ïhùÜ ˜’×𙇪ç~fPOîå0H5”ÏB7$,ËøèÌGNbàÓÎgÞRŒ ŠÞBRƒ‰óI×±i"ŠB€¦½ë‘éQ¶¶,Q)«9“L‚¹] +ð“®â£õjò*IÑT‡|S;JÆ0a¹p®ÓJ}V© uü+þÚ*º¤®ø ÔZ]î/˜þúTæ%8ö7ª]mf†ÈÿSÒPVj²]{ƒ’_"Œ‡@l*ýhDaÂòT'áf×CÜÃ'T®±î¯^ ×‘=¢ŠôwêgSk î›¿ÒÑ3ÏF`»ÊIÜã‹Š§nÑïs¹J—ƒQ…JZ{7mòý»èÀ–,ê&K½ +endstream +endobj + +%QDF: ignore_newline +22 0 obj +146576 +endobj + +xref +0 23 +0000000000 65535 f +0000000025 00000 n +0000000097 00000 n +0000000221 00000 n +0000003486 00000 n +0000003507 00000 n +0000003589 00000 n +0000003741 00000 n +0000003793 00000 n +0000004252 00000 n +0000004272 00000 n +0000004336 00000 n +0000004534 00000 n +0000004570 00000 n +0000004884 00000 n +0000004904 00000 n +0000006922 00000 n +0000006965 00000 n +0000007208 00000 n +0000009576 00000 n +0000009598 00000 n +0000009682 00000 n +0000156384 00000 n +trailer << + /Info 2 0 R + /Root 1 0 R + /Size 23 + /ID [<31415926535897932384626433832795>] +>> +startxref +156408 +%%EOF diff --git a/examples/qtest/mod-info/files/3.qdf b/examples/qtest/mod-info/files/3.qdf new file mode 100644 index 0000000..ff82f56 Binary files /dev/null and b/examples/qtest/mod-info/files/3.qdf differ diff --git a/examples/qtest/mod-info/files/4.qdf b/examples/qtest/mod-info/files/4.qdf new file mode 100644 index 0000000..992314c Binary files /dev/null and b/examples/qtest/mod-info/files/4.qdf differ diff --git a/examples/qtest/mod-info/files/empty-info.pdf b/examples/qtest/mod-info/files/empty-info.pdf new file mode 100644 index 0000000..37bef28 Binary files /dev/null and b/examples/qtest/mod-info/files/empty-info.pdf differ diff --git a/examples/qtest/mod-info/files/no-info.pdf b/examples/qtest/mod-info/files/no-info.pdf new file mode 100644 index 0000000..0518044 Binary files /dev/null and b/examples/qtest/mod-info/files/no-info.pdf differ diff --git a/examples/qtest/mod-info/files/source1.pdf b/examples/qtest/mod-info/files/source1.pdf new file mode 100644 index 0000000..86cc347 Binary files /dev/null and b/examples/qtest/mod-info/files/source1.pdf differ diff --git a/examples/qtest/mod-info/files/source2.pdf b/examples/qtest/mod-info/files/source2.pdf new file mode 100644 index 0000000..1a814e9 Binary files /dev/null and b/examples/qtest/mod-info/files/source2.pdf differ diff --git a/examples/qtest/mod-info/usage.out b/examples/qtest/mod-info/usage.out new file mode 100644 index 0000000..5eeba82 --- /dev/null +++ b/examples/qtest/mod-info/usage.out @@ -0,0 +1,5 @@ +Usage: pdf-mod-info -in in_file [-out out_file] [-key key [-val val]?]+ +Modifies/Adds/Removes PDF /Info entries in the in_file +and stores the result in out_file +Special mode: pdf-mod-info --dump file +dumps all /Info entries to stdout diff --git a/examples/qtest/npages.test b/examples/qtest/npages.test new file mode 100644 index 0000000..b20f254 --- /dev/null +++ b/examples/qtest/npages.test @@ -0,0 +1,23 @@ +#!/usr/bin/env perl +require 5.008; +BEGIN { $^W = 1; } +use strict; + +chdir("npages"); + +require TestDriver; + +my $td = new TestDriver('pdf-npages'); + +$td->runtest("normal", + {$td->COMMAND => "pdf-npages minimal.pdf"}, + {$td->STRING => "1\n", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("error", + {$td->COMMAND => "pdf-npages bad"}, + {$td->STRING => "pdf-npages: bad: not a PDF file\n", + $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); + +$td->report(2); diff --git a/examples/qtest/npages/bad b/examples/qtest/npages/bad new file mode 100644 index 0000000..9daeafb --- /dev/null +++ b/examples/qtest/npages/bad @@ -0,0 +1 @@ +test diff --git a/examples/qtest/npages/minimal.pdf b/examples/qtest/npages/minimal.pdf new file mode 100644 index 0000000..a7e01f9 --- /dev/null +++ b/examples/qtest/npages/minimal.pdf @@ -0,0 +1,79 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R +>> +startxref +556 +%%EOF diff --git a/include/qpdf/Buffer.hh b/include/qpdf/Buffer.hh new file mode 100644 index 0000000..7fabe9a --- /dev/null +++ b/include/qpdf/Buffer.hh @@ -0,0 +1,53 @@ +// Copyright (c) 2005-2012 Jay Berkenbilt +// +// This file is part of qpdf. This software may be distributed under +// the terms of version 2 of the Artistic License which may be found +// in the source distribution. It is provided "as is" without express +// or implied warranty. + +#ifndef __BUFFER_HH__ +#define __BUFFER_HH__ + +#include +#include // for size_t + +class Buffer +{ + public: + QPDF_DLL + Buffer(); + + // Create a Buffer object whose memory is owned by the class and + // will be freed when the Buffer object is destroyed. + QPDF_DLL + Buffer(size_t size); + + // Create a Buffer object whose memory is owned by the caller and + // will not be freed when the Buffer is destroyed. + QPDF_DLL + Buffer(unsigned char* buf, size_t size); + + QPDF_DLL + Buffer(Buffer const&); + QPDF_DLL + Buffer& operator=(Buffer const&); + QPDF_DLL + ~Buffer(); + QPDF_DLL + size_t getSize() const; + QPDF_DLL + unsigned char const* getBuffer() const; + QPDF_DLL + unsigned char* getBuffer(); + + private: + void init(size_t size, unsigned char* buf, bool own_memory); + void copy(Buffer const&); + void destroy(); + + bool own_memory; + size_t size; + unsigned char* buf; +}; + +#endif // __BUFFER_HH__ diff --git a/include/qpdf/BufferInputSource.hh b/include/qpdf/BufferInputSource.hh new file mode 100644 index 0000000..48f6e3a --- /dev/null +++ b/include/qpdf/BufferInputSource.hh @@ -0,0 +1,30 @@ +#ifndef __QPDF_BUFFERINPUTSOURCE_HH__ +#define __QPDF_BUFFERINPUTSOURCE_HH__ + +#include +#include + +class BufferInputSource: public InputSource +{ + public: + BufferInputSource(std::string const& description, Buffer* buf, + bool own_memory = false); + BufferInputSource(std::string const& description, + std::string const& contents); + virtual ~BufferInputSource(); + virtual qpdf_offset_t findAndSkipNextEOL(); + virtual std::string const& getName() const; + virtual qpdf_offset_t tell(); + virtual void seek(qpdf_offset_t offset, int whence); + virtual void rewind(); + virtual size_t read(char* buffer, size_t length); + virtual void unreadCh(char ch); + + private: + bool own_memory; + std::string description; + Buffer* buf; + qpdf_offset_t cur_offset; +}; + +#endif // __QPDF_BUFFERINPUTSOURCE_HH__ diff --git a/include/qpdf/Constants.h b/include/qpdf/Constants.h new file mode 100644 index 0000000..176392e --- /dev/null +++ b/include/qpdf/Constants.h @@ -0,0 +1,61 @@ +/* Copyright (c) 2005-2012 Jay Berkenbilt + * + * This file is part of qpdf. This software may be distributed under + * the terms of version 2 of the Artistic License which may be found + * in the source distribution. It is provided "as is" without express + * or implied warranty. + */ + +#ifndef __QPDFCONSTANTS_H__ +#define __QPDFCONSTANTS_H__ + +/* Keep this file 'C' compatible so it can be used from the C and C++ + * interfaces. + */ + +/* Error Codes */ + +enum qpdf_error_code_e +{ + qpdf_e_success = 0, + qpdf_e_internal, /* logic/programming error -- indicates bug */ + qpdf_e_system, /* I/O error, memory error, etc. */ + qpdf_e_unsupported, /* PDF feature not (yet) supported by qpdf */ + qpdf_e_password, /* incorrect password for encrypted file */ + qpdf_e_damaged_pdf, /* syntax errors or other damage in PDF */ + qpdf_e_pages, /* erroneous or unsupported pages structure */ +}; + +/* Write Parameters */ + +enum qpdf_object_stream_e +{ + qpdf_o_disable = 0, /* disable object streams */ + qpdf_o_preserve, /* preserve object streams */ + qpdf_o_generate /* generate object streams */ +}; +enum qpdf_stream_data_e +{ + qpdf_s_uncompress = 0, /* uncompress stream data */ + qpdf_s_preserve, /* preserve stream data compression */ + qpdf_s_compress /* compress stream data */ +}; + +/* R3 Encryption Parameters */ + +enum qpdf_r3_print_e +{ + qpdf_r3p_full = 0, /* allow all printing */ + qpdf_r3p_low, /* allow only low-resolution printing */ + qpdf_r3p_none /* allow no printing */ +}; +enum qpdf_r3_modify_e /* Allowed changes: */ +{ + qpdf_r3m_all = 0, /* General editing, comments, forms */ + qpdf_r3m_annotate, /* Comments, form field fill-in, and signing */ + qpdf_r3m_form, /* form field fill-in and signing */ + qpdf_r3m_assembly, /* only document assembly */ + qpdf_r3m_none /* no modifications */ +}; + +#endif /* __QPDFCONSTANTS_H__ */ diff --git a/include/qpdf/DLL.h b/include/qpdf/DLL.h new file mode 100644 index 0000000..640e4f6 --- /dev/null +++ b/include/qpdf/DLL.h @@ -0,0 +1,18 @@ +/* Copyright (c) 2005-2012 Jay Berkenbilt + * + * This file is part of qpdf. This software may be distributed under + * the terms of version 2 of the Artistic License which may be found + * in the source distribution. It is provided "as is" without express + * or implied warranty. + */ + +#ifndef __QPDF_DLL_HH__ +#define __QPDF_DLL_HH__ + +#if defined(_WIN32) && defined(DLL_EXPORT) +# define QPDF_DLL __declspec(dllexport) +#else +# define QPDF_DLL +#endif + +#endif /* __QPDF_DLL_HH__ */ diff --git a/include/qpdf/FileInputSource.hh b/include/qpdf/FileInputSource.hh new file mode 100644 index 0000000..6129326 --- /dev/null +++ b/include/qpdf/FileInputSource.hh @@ -0,0 +1,32 @@ +#ifndef __QPDF_FILEINPUTSOURCE_HH__ +#define __QPDF_FILEINPUTSOURCE_HH__ + +#include + +class FileInputSource: public InputSource +{ + public: + FileInputSource(); + void setFilename(char const* filename); + void setFile(char const* description, FILE* filep, bool close_file); + virtual ~FileInputSource(); + virtual qpdf_offset_t findAndSkipNextEOL(); + virtual std::string const& getName() const; + virtual qpdf_offset_t tell(); + virtual void seek(qpdf_offset_t offset, int whence); + virtual void rewind(); + virtual size_t read(char* buffer, size_t length); + virtual void unreadCh(char ch); + + private: + FileInputSource(FileInputSource const&); + FileInputSource& operator=(FileInputSource const&); + + void destroy(); + + bool close_file; + std::string filename; + FILE* file; +}; + +#endif // __QPDF_FILEINPUTSOURCE_HH__ diff --git a/include/qpdf/InputSource.hh b/include/qpdf/InputSource.hh new file mode 100644 index 0000000..782d888 --- /dev/null +++ b/include/qpdf/InputSource.hh @@ -0,0 +1,35 @@ +#ifndef __QPDF_INPUTSOURCE_HH__ +#define __QPDF_INPUTSOURCE_HH__ + +#include +#include +#include + +class InputSource +{ + public: + InputSource() : + last_offset(0) + { + } + virtual ~InputSource() + { + } + + void setLastOffset(qpdf_offset_t); + qpdf_offset_t getLastOffset() const; + std::string readLine(size_t max_line_length); + + virtual qpdf_offset_t findAndSkipNextEOL() = 0; + virtual std::string const& getName() const = 0; + virtual qpdf_offset_t tell() = 0; + virtual void seek(qpdf_offset_t offset, int whence) = 0; + virtual void rewind() = 0; + virtual size_t read(char* buffer, size_t length) = 0; + virtual void unreadCh(char ch) = 0; + + protected: + qpdf_offset_t last_offset; +}; + +#endif // __QPDF_INPUTSOURCE_HH__ diff --git a/include/qpdf/Pipeline.hh b/include/qpdf/Pipeline.hh new file mode 100644 index 0000000..2de17ad --- /dev/null +++ b/include/qpdf/Pipeline.hh @@ -0,0 +1,65 @@ +// Copyright (c) 2005-2012 Jay Berkenbilt +// +// This file is part of qpdf. This software may be distributed under +// the terms of version 2 of the Artistic License which may be found +// in the source distribution. It is provided "as is" without express +// or implied warranty. + +// Generalized Pipeline interface. By convention, subclasses of +// Pipeline are called Pl_Something. +// +// When an instance of Pipeline is created with a pointer to a next +// pipeline, that pipeline writes its data to the next one when it +// finishes with it. In order to make possible a usage style in which +// a pipeline may be passed to a function which may stick other +// pipelines in front of it, the allocator of a pipeline is +// responsible for its destruction. In other words, one pipeline +// object does not attempt to manage the memory of its successor. +// +// The client is required to call finish() before destroying a +// Pipeline in order to avoid loss of data. A Pipeline class should +// not throw an exception in the destructor if this hasn't been done +// though since doing so causes too much trouble when deleting +// pipelines during error conditions. +// +// Some pipelines are reusable (i.e., you can call write() after +// calling finish() and can call finish() multiple times) while others +// are not. It is up to the caller to use a pipeline according to its +// own restrictions. + +#ifndef __PIPELINE_HH__ +#define __PIPELINE_HH__ + +#include +#include + +class Pipeline +{ + public: + QPDF_DLL + Pipeline(char const* identifier, Pipeline* next); + + QPDF_DLL + virtual ~Pipeline(); + + // Subclasses should implement write and finish to do their jobs + // and then, if they are not end-of-line pipelines, call + // getNext()->write or getNext()->finish. + QPDF_DLL + virtual void write(unsigned char* data, size_t len) = 0; + QPDF_DLL + virtual void finish() = 0; + + protected: + Pipeline* getNext(bool allow_null = false); + std::string identifier; + + private: + // Do not implement copy or assign + Pipeline(Pipeline const&); + Pipeline& operator=(Pipeline const&); + + Pipeline* next; +}; + +#endif // __PIPELINE_HH__ diff --git a/include/qpdf/Pl_Buffer.hh b/include/qpdf/Pl_Buffer.hh new file mode 100644 index 0000000..57473fd --- /dev/null +++ b/include/qpdf/Pl_Buffer.hh @@ -0,0 +1,51 @@ +// Copyright (c) 2005-2012 Jay Berkenbilt +// +// This file is part of qpdf. This software may be distributed under +// the terms of version 2 of the Artistic License which may be found +// in the source distribution. It is provided "as is" without express +// or implied warranty. + +#ifndef __PL_BUFFER_HH__ +#define __PL_BUFFER_HH__ + +// This pipeline accumulates the data passed to it into a memory +// buffer. Each subsequent use of this buffer appends to the data +// accumulated so far. getBuffer() may be called only after calling +// finish() and before calling any subsequent write(). At that point, +// a dynamically allocated Buffer object is returned and the internal +// buffer is reset. The caller is responsible for deleting the +// returned Buffer. +// +// For this pipeline, "next" may be null. If a next pointer is +// provided, this pipeline will also pass the data through to it. + +#include +#include +#include +#include + +class Pl_Buffer: public Pipeline +{ + public: + QPDF_DLL + Pl_Buffer(char const* identifier, Pipeline* next = 0); + QPDF_DLL + virtual ~Pl_Buffer(); + QPDF_DLL + virtual void write(unsigned char*, size_t); + QPDF_DLL + virtual void finish(); + + // Each call to getBuffer() resets this object -- see notes above. + // The caller is responsible for deleting the returned Buffer + // object. + QPDF_DLL + Buffer* getBuffer(); + + private: + bool ready; + std::list > data; + size_t total_size; +}; + +#endif // __PL_BUFFER_HH__ diff --git a/include/qpdf/Pl_Concatenate.hh b/include/qpdf/Pl_Concatenate.hh new file mode 100644 index 0000000..e8fd64e --- /dev/null +++ b/include/qpdf/Pl_Concatenate.hh @@ -0,0 +1,32 @@ +#ifndef __PL_CONCATENATE_HH__ +#define __PL_CONCATENATE_HH__ + +// This pipeline will drop all regular finished calls rather than +// passing them onto next. To finish downstream streams, call +// manualFinish. This makes it possible to pipe multiple streams +// (e.g. with QPDFObjectHandle::pipeStreamData) to a downstream like +// Pl_Flate that can't handle multiple calls to finish(). + +#include + +class Pl_Concatenate: public Pipeline +{ + public: + QPDF_DLL + Pl_Concatenate(char const* identifier, Pipeline* next); + QPDF_DLL + virtual ~Pl_Concatenate(); + + QPDF_DLL + virtual void write(unsigned char* data, size_t len); + + QPDF_DLL + virtual void finish(); + + // At the very end, call manualFinish to actually finish the rest of + // the pipeline. + QPDF_DLL + void manualFinish(); +}; + +#endif // __PL_CONCATENATE_HH__ diff --git a/include/qpdf/Pl_Count.hh b/include/qpdf/Pl_Count.hh new file mode 100644 index 0000000..7c5a418 --- /dev/null +++ b/include/qpdf/Pl_Count.hh @@ -0,0 +1,41 @@ +// Copyright (c) 2005-2012 Jay Berkenbilt +// +// This file is part of qpdf. This software may be distributed under +// the terms of version 2 of the Artistic License which may be found +// in the source distribution. It is provided "as is" without express +// or implied warranty. + +#ifndef __PL_COUNT_HH__ +#define __PL_COUNT_HH__ + +// This pipeline is reusable; i.e., it is safe to call write() after +// calling finish(). + +#include +#include + +class Pl_Count: public Pipeline +{ + public: + QPDF_DLL + Pl_Count(char const* identifier, Pipeline* next); + QPDF_DLL + virtual ~Pl_Count(); + QPDF_DLL + virtual void write(unsigned char*, size_t); + QPDF_DLL + virtual void finish(); + // Returns the number of bytes written + QPDF_DLL + qpdf_offset_t getCount() const; + // Returns the last character written, or '\0' if no characters + // have been written (in which case getCount() returns 0) + QPDF_DLL + unsigned char getLastChar() const; + + private: + qpdf_offset_t count; + unsigned char last_char; +}; + +#endif // __PL_COUNT_HH__ diff --git a/include/qpdf/Pl_Discard.hh b/include/qpdf/Pl_Discard.hh new file mode 100644 index 0000000..79b8564 --- /dev/null +++ b/include/qpdf/Pl_Discard.hh @@ -0,0 +1,32 @@ +// Copyright (c) 2005-2012 Jay Berkenbilt +// +// This file is part of qpdf. This software may be distributed under +// the terms of version 2 of the Artistic License which may be found +// in the source distribution. It is provided "as is" without express +// or implied warranty. + +#ifndef __PL_DISCARD_HH__ +#define __PL_DISCARD_HH__ + +// This pipeline discards its output. It is an end-of-line pipeline +// (with no next). + +// This pipeline is reusable; i.e., it is safe to call write() after +// calling finish(). + +#include + +class Pl_Discard: public Pipeline +{ + public: + QPDF_DLL + Pl_Discard(); + QPDF_DLL + virtual ~Pl_Discard(); + QPDF_DLL + virtual void write(unsigned char*, size_t); + QPDF_DLL + virtual void finish(); +}; + +#endif // __PL_DISCARD_HH__ diff --git a/include/qpdf/Pl_Flate.hh b/include/qpdf/Pl_Flate.hh new file mode 100644 index 0000000..31e3de3 --- /dev/null +++ b/include/qpdf/Pl_Flate.hh @@ -0,0 +1,42 @@ +// Copyright (c) 2005-2012 Jay Berkenbilt +// +// This file is part of qpdf. This software may be distributed under +// the terms of version 2 of the Artistic License which may be found +// in the source distribution. It is provided "as is" without express +// or implied warranty. + +#ifndef __PL_FLATE_HH__ +#define __PL_FLATE_HH__ + +#include + +class Pl_Flate: public Pipeline +{ + public: + static int const def_bufsize = 65536; + + enum action_e { a_inflate, a_deflate }; + + QPDF_DLL + Pl_Flate(char const* identifier, Pipeline* next, + action_e action, int out_bufsize = def_bufsize); + QPDF_DLL + virtual ~Pl_Flate(); + + QPDF_DLL + virtual void write(unsigned char* data, size_t len); + QPDF_DLL + virtual void finish(); + + private: + void handleData(unsigned char* data, int len, int flush); + void checkError(char const* prefix, int error_code); + + unsigned char* outbuf; + int out_bufsize; + action_e action; + bool initialized; + void* zdata; +}; + +#endif // __PL_FLATE_HH__ diff --git a/include/qpdf/Pl_StdioFile.hh b/include/qpdf/Pl_StdioFile.hh new file mode 100644 index 0000000..0a0f15d --- /dev/null +++ b/include/qpdf/Pl_StdioFile.hh @@ -0,0 +1,40 @@ +// Copyright (c) 2005-2012 Jay Berkenbilt +// +// This file is part of qpdf. This software may be distributed under +// the terms of version 2 of the Artistic License which may be found +// in the source distribution. It is provided "as is" without express +// or implied warranty. + +// End-of-line pipeline that simply writes its data to a stdio FILE* object. + +#ifndef __PL_STDIOFILE_HH__ +#define __PL_STDIOFILE_HH__ + +#include + +#include + +// +// This pipeline is reusable. +// + +class Pl_StdioFile: public Pipeline +{ + public: + // f is externally maintained; this class just writes to and + // flushes it. It does not close it. + QPDF_DLL + Pl_StdioFile(char const* identifier, FILE* f); + QPDF_DLL + virtual ~Pl_StdioFile(); + + QPDF_DLL + virtual void write(unsigned char* buf, size_t len); + QPDF_DLL + virtual void finish(); + + private: + FILE* file; +}; + +#endif // __PL_STDIOFILE_HH__ diff --git a/include/qpdf/PointerHolder.hh b/include/qpdf/PointerHolder.hh new file mode 100644 index 0000000..a2f33e9 --- /dev/null +++ b/include/qpdf/PointerHolder.hh @@ -0,0 +1,172 @@ +// Copyright (c) 2005-2012 Jay Berkenbilt +// +// This file is part of qpdf. This software may be distributed under +// the terms of version 2 of the Artistic License which may be found +// in the source distribution. It is provided "as is" without express +// or implied warranty. + +#ifndef __POINTERHOLDER_HH__ +#define __POINTERHOLDER_HH__ + +// This class is basically boost::shared_pointer but predates that by +// several years. + +// This class expects to be initialized with a dynamically allocated +// object pointer. It keeps a reference count and deletes this once +// the reference count goes to zero. PointerHolder objects are +// explicitly safe for use in STL containers. + +// It is very important that a client who pulls the pointer out of +// this holder does not let the holder go out of scope until it is +// finished with the pointer. It is also important that exactly one +// instance of this object ever gets initialized with a given pointer. +// Otherwise, the pointer will be deleted twice, and before that, some +// objects will be left with a pointer to a deleted object. In other +// words, the only legitimate way for two PointerHolder objects to +// contain the same pointer is for one to be a copy of the other. +// Copy and assignment semantics are well-defined and essentially +// allow you to use PointerHolder as a means to get pass-by-reference +// semantics in a pass-by-value environment without having to worry +// about memory management details. + +// Comparison (== and <) are defined and operate on the internally +// stored pointers, not on the data. This makes it possible to store +// PointerHolder objects in sorted lists or to find them in STL +// containers just as one would be able to store pointers. Comparing +// the underlying pointers provides a well-defined, if not +// particularly meaningful, ordering. + +template +class PointerHolder +{ + private: + class Data + { + public: + Data(T* pointer, bool array) : + pointer(pointer), + array(array), + refcount(0) + { + } + ~Data() + { + if (array) + { + delete [] this->pointer; + } + else + { + delete this->pointer; + } + } + T* pointer; + bool array; + int refcount; + private: + Data(Data const&); + Data& operator=(Data const&); + }; + + public: + // "tracing" is not used but is kept for interface backward compatbility + PointerHolder(T* pointer = 0, bool tracing = false) + { + this->init(new Data(pointer, false)); + } + // Special constructor indicating to free memory with delete [] + // instead of delete + PointerHolder(bool, T* pointer) + { + this->init(new Data(pointer, true)); + } + PointerHolder(PointerHolder const& rhs) + { + this->copy(rhs); + } + PointerHolder& operator=(PointerHolder const& rhs) + { + if (this != &rhs) + { + this->destroy(); + this->copy(rhs); + } + return *this; + } + ~PointerHolder() + { + this->destroy(); + } + bool operator==(PointerHolder const& rhs) const + { + return this->data->pointer == rhs.data->pointer; + } + bool operator<(PointerHolder const& rhs) const + { + return this->data->pointer < rhs.data->pointer; + } + + // NOTE: The pointer returned by getPointer turns into a pumpkin + // when the last PointerHolder that contains it disappears. + T* getPointer() + { + return this->data->pointer; + } + T const* getPointer() const + { + return this->data->pointer; + } + int getRefcount() const + { + return this->data->refcount; + } + + T const& operator*() const + { + return *this->data->pointer; + } + T& operator*() + { + return *this->data->pointer; + } + + T const* operator->() const + { + return this->data->pointer; + } + T* operator->() + { + return this->data->pointer; + } + + private: + void init(Data* data) + { + this->data = data; + { + ++this->data->refcount; + } + } + void copy(PointerHolder const& rhs) + { + this->init(rhs.data); + } + void destroy() + { + bool gone = false; + { + if (--this->data->refcount == 0) + { + gone = true; + } + } + if (gone) + { + delete this->data; + } + } + + Data* data; +}; + +#endif // __POINTERHOLDER_HH__ diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh new file mode 100644 index 0000000..e594a44 --- /dev/null +++ b/include/qpdf/QPDF.hh @@ -0,0 +1,1015 @@ +// Copyright (c) 2005-2012 Jay Berkenbilt +// +// This file is part of qpdf. This software may be distributed under +// the terms of version 2 of the Artistic License which may be found +// in the source distribution. It is provided "as is" without express +// or implied warranty. + +#ifndef __QPDF_HH__ +#define __QPDF_HH__ + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +class QPDF_Stream; +class BitStream; +class BitWriter; +class QPDFExc; + +class QPDF +{ + public: + // Get the current version of the QPDF software + QPDF_DLL + static std::string const& QPDFVersion(); + + QPDF_DLL + QPDF(); + QPDF_DLL + ~QPDF(); + + // Associate a file with a QPDF object and do initial parsing of + // the file. PDF objects are not read until they are needed. A + // QPDF object may be associated with only one file in its + // lifetime. This method must be called before any methods that + // potentially ask for information about the PDF file are called. + // Prior to calling this, the only methods that are allowed are + // those that set parameters. If the input file is not + // encrypted,either a null password or an empty password can be + // used. If the file is encrypted, either the user password or + // the owner password may be supplied. + QPDF_DLL + void processFile(char const* filename, char const* password = 0); + + // Parse a PDF from a stdio FILE*. The FILE must be open in + // binary mode and must be seekable. It may be open read only. + // This works exactly like processFile except that the PDF file is + // read from an already opened FILE*. If close_file is true, the + // file will be closed at the end. Otherwise, the caller is + // responsible for closing the file. + QPDF_DLL + void processFile(char const* description, FILE* file, + bool close_file, char const* password = 0); + + // Parse a PDF file loaded into a memory buffer. This works + // exactly like processFile except that the PDF file is in memory + // instead of on disk. The description appears in any warning or + // error message in place of the file name. + QPDF_DLL + void processMemoryFile(char const* description, + char const* buf, size_t length, + char const* password = 0); + + // Create a QPDF object for an empty PDF. This PDF has no pages + // or objects other than a minimal trailer, a document catalog, + // and a /Pages tree containing zero pages. Pages and other + // objects can be added to the file in the normal way, and the + // trailer and document catalog can be mutated. Calling this + // method is equivalent to calling processFile on an equivalent + // PDF file. See the pdf-create.cc example for a demonstration of + // how to use this method to create a PDF file from scratch. + QPDF_DLL + void emptyPDF(); + + // Parameter settings + + // By default, warning messages are issued to std::cerr and output + // messages printed by certain check calls are issued to + // std::cout. This method allows you to specify alternative + // streams for this purpose. Note that no normal QPDF operations + // generate output to std::cout, so for applications that just + // wish to avoid creating output and don't call any check + // functions, calling setSuppressWarnings(true) is sufficient. + // Applications that wish to present check or warning information + // to users may replace the output and error streams to capture + // the output and errors for other use. A null value for either + // stream will cause QPDF to use std::cout or std::cerr as + // appropriate. + QPDF_DLL + void setOutputStreams(std::ostream* out_stream, std::ostream* err_stream); + + // If true, ignore any cross-reference streams in a hybrid file + // (one that contains both cross-reference streams and + // cross-reference tables). This can be useful for testing to + // ensure that a hybrid file would work with an older reader. + QPDF_DLL + void setIgnoreXRefStreams(bool); + + // By default, any warnings are issued to std::cerr or the error + // stream specified in a call to setOutputStreams as they are + // encountered. If this is called with a true value, reporting of + // warnings is suppressed. You may still retrieve warnings by + // calling getWarnings. + QPDF_DLL + void setSuppressWarnings(bool); + + // By default, QPDF will try to recover if it finds certain types + // of errors in PDF files. If turned off, it will throw an + // exception on the first such problem it finds without attempting + // recovery. + QPDF_DLL + void setAttemptRecovery(bool); + + // Other public methods + + // Return the list of warnings that have been issued so far and + // clear the list. This method may be called even if processFile + // throws an exception. Note that if setSuppressWarnings was not + // called or was called with a false value, any warnings retrieved + // here will have already been output. + QPDF_DLL + std::vector getWarnings(); + + QPDF_DLL + std::string getFilename() const; + QPDF_DLL + std::string getPDFVersion() const; + QPDF_DLL + QPDFObjectHandle getTrailer(); + QPDF_DLL + QPDFObjectHandle getRoot(); + + // Install this object handle as an indirect object and return an + // indirect reference to it. + QPDF_DLL + QPDFObjectHandle makeIndirectObject(QPDFObjectHandle); + + // Retrieve an object by object ID and generation. Returns an + // indirect reference to it. + QPDF_DLL + QPDFObjectHandle getObjectByID(int objid, int generation); + + // Replace the object with the given object id with the given + // object. The object handle passed in must be a direct object, + // though it may contain references to other indirect objects + // within it. Calling this method can have somewhat confusing + // results. Any existing QPDFObjectHandle instances that point to + // the old object and that have been resolved (which happens + // automatically if you access them in any way) will continue to + // point to the old object even though that object will no longer + // be associated with the PDF file. Note that replacing an object + // with QPDFObjectHandle::newNull() effectively removes the object + // from the file since a non-existent object is treated as a null + // object. To replace a reserved object, call replaceReserved + // instead. + QPDF_DLL + void replaceObject(int objid, int generation, QPDFObjectHandle); + + // Swap two objects given by ID. Calling this method can have + // confusing results. After swapping two objects, existing + // QPDFObjectHandle instances that reference them will still + // reference the same underlying objects, at which point those + // existing QPDFObjectHandle instances will have incorrect + // information about the object and generation number of those + // objects. While this does not necessarily cause a problem, it + // can certainly be confusing. It is therefore recommended that + // you replace any existing QPDFObjectHandle instances that point + // to the swapped objects with new ones, possibly by calling + // getObjectByID. + QPDF_DLL + void swapObjects(int objid1, int generation1, + int objid2, int generation2); + + // Replace a reserved object. This is a wrapper around + // replaceObject but it guarantees that the underlying object is a + // reserved object. After this call, reserved will be a reference + // to replacement. + QPDF_DLL + void + replaceReserved(QPDFObjectHandle reserved, + QPDFObjectHandle replacement); + + // Copy an object from another QPDF to this one. The return value + // is an indirect reference to the copied object in this file. + // This method is intended to be used to copy non-page objects and + // will not copy page objects. To copy page objects, pass the + // foreign page object directly to addPage (or addPageAt). If you + // copy objects that contain references to pages, you should copy + // the pages first using addPage(At). Otherwise references to the + // pages that have not been copied will be replaced with nulls. + + // When copying objects with this method, object structure will be + // preserved, so all indirectly referenced indirect objects will + // be copied as well. This includes any circular references that + // may exist. The QPDF object keeps a record of what has already + // been copied, so shared objects will not be copied multiple + // times. This also means that if you mutate an object that has + // already been copied and try to copy it again, it won't work + // since the modified object will not be recopied. Therefore, you + // should do all mutation on the original file that you are going + // to do before you start copying its objects to a new file. + QPDF_DLL + QPDFObjectHandle copyForeignObject(QPDFObjectHandle foreign); + + // Encryption support + + enum encryption_method_e { e_none, e_unknown, e_rc4, e_aes }; + struct EncryptionData + { + // This class holds data read from the encryption dictionary. + EncryptionData(int V, int R, int Length_bytes, int P, + std::string const& O, std::string const& U, + std::string const& id1, bool encrypt_metadata) : + V(V), + R(R), + Length_bytes(Length_bytes), + P(P), + O(O), + U(U), + id1(id1), + encrypt_metadata(encrypt_metadata) + { + } + + int V; + int R; + int Length_bytes; + int P; + std::string O; + std::string U; + std::string id1; + bool encrypt_metadata; + }; + + QPDF_DLL + bool isEncrypted() const; + + QPDF_DLL + bool isEncrypted(int& R, int& P); + + QPDF_DLL + bool isEncrypted(int& R, int& P, int& V, + encryption_method_e& stream_method, + encryption_method_e& string_method, + encryption_method_e& file_method); + + // Encryption permissions -- not enforced by QPDF + QPDF_DLL + bool allowAccessibility(); + QPDF_DLL + bool allowExtractAll(); + QPDF_DLL + bool allowPrintLowRes(); + QPDF_DLL + bool allowPrintHighRes(); + QPDF_DLL + bool allowModifyAssembly(); + QPDF_DLL + bool allowModifyForm(); + QPDF_DLL + bool allowModifyAnnotation(); + QPDF_DLL + bool allowModifyOther(); + QPDF_DLL + bool allowModifyAll(); + + // Helper function to trim padding from user password. Calling + // trim_user_password on the result of getPaddedUserPassword gives + // getTrimmedUserPassword's result. + QPDF_DLL + static void trim_user_password(std::string& user_password); + QPDF_DLL + static std::string compute_data_key( + std::string const& encryption_key, int objid, int generation, + bool use_aes); + QPDF_DLL + static std::string compute_encryption_key( + std::string const& password, EncryptionData const& data); + + QPDF_DLL + static void compute_encryption_O_U( + char const* user_password, char const* owner_password, + int V, int R, int key_len, int P, bool encrypt_metadata, + std::string const& id1, + std::string& O, std::string& U); + // Return the full user password as stored in the PDF file. If + // you are attempting to recover the user password in a + // user-presentable form, call getTrimmedUserPassword() instead. + QPDF_DLL + std::string const& getPaddedUserPassword() const; + // Return human-readable form of user password. + QPDF_DLL + std::string getTrimmedUserPassword() const; + + // Linearization support + + // Returns true iff the file starts with a linearization parameter + // dictionary. Does no additional validation. + QPDF_DLL + bool isLinearized(); + + // Performs various sanity checks on a linearized file. Return + // true if no errors or warnings. Otherwise, return false and + // output errors and warnings to std::cout or the output stream + // specified in a call to setOutputStreams. + QPDF_DLL + bool checkLinearization(); + + // Calls checkLinearization() and, if possible, prints normalized + // contents of some of the hints tables to std::cout or the output + // stream specified in a call to setOutputStreams. Normalization + // includes adding min values to delta values and adjusting + // offsets based on the location and size of the primary hint + // stream. + QPDF_DLL + void showLinearizationData(); + + // Shows the contents of the cross-reference table + QPDF_DLL + void showXRefTable(); + + // Optimization support -- see doc/optimization. Implemented in + // QPDF_optimization.cc + + // The object_stream_data map maps from a "compressed" object to + // the object stream that contains it. This enables optimize to + // populate the object <-> user maps with only uncompressed + // objects. If allow_changes is false, an exception will be + // thrown if any changes are made during the optimization process. + // This is available so that the test suite can make sure that a + // linearized file is already optimized. When called in this way, + // optimize() still populates the object <-> user maps + QPDF_DLL + void optimize(std::map const& object_stream_data, + bool allow_changes = true); + + // Replace all references to indirect objects that are "scalars" + // (i.e., things that don't have children: not arrays, streams, or + // dictionaries) with direct objects. + QPDF_DLL + void flattenScalarReferences(); + + // Decode all streams, discarding the output. Used to check + // correctness of stream encoding. + QPDF_DLL + void decodeStreams(); + + // For QPDFWriter: + + // Remove /ID, /Encrypt, and /Prev keys from the trailer + // dictionary since these are regenerated during write. + QPDF_DLL + void trimTrailerForWrite(); + + // Get lists of all objects in order according to the part of a + // linearized file that they belong to. + QPDF_DLL + void getLinearizedParts( + std::map const& object_stream_data, + std::vector& part4, + std::vector& part6, + std::vector& part7, + std::vector& part8, + std::vector& part9); + + QPDF_DLL + void generateHintStream(std::map const& xref, + std::map const& lengths, + std::map const& obj_renumber, + PointerHolder& hint_stream, + int& S, int& O); + + // Map object to object stream that contains it + QPDF_DLL + void getObjectStreamData(std::map&); + // Get a list of objects that would be permitted in an object + // stream + QPDF_DLL + std::vector getCompressibleObjects(); + + // Convenience routines for common functions. See also + // QPDFObjectHandle.hh for additional convenience routines. + + // Page handling API + + // Traverse page tree return all /Page objects. Note that calls + // to page manipulation APIs will change the internal vector that + // this routine returns a pointer to. If you don't want that, + // assign this to a regular vector rather than a const reference. + QPDF_DLL + std::vector const& getAllPages(); + + // This method synchronizes QPDF's cache of the page structure + // with the actual /Pages tree. If you restrict changes to the + // /Pages tree, including addition, removal, or replacement of + // pages or changes to any /Pages objects, to calls to these page + // handling APIs, you never need to call this method. If you + // modify /Pages structures directly, you must call this method + // afterwards. This method updates the internal list of pages, so + // after calling this method, any previous references returned by + // getAllPages() will be valid again. It also resets any state + // about having pushed inherited attributes in /Pages objects down + // to the pages, so if you add any inheritable attributes to a + // /Pages object, you should also call this method. + QPDF_DLL + void updateAllPagesCache(); + + // The PDF /Pages tree allows inherited values. Working with + // the pages of a pdf is much easier when the inheritance is + // resolved by explicitly setting the values in each /Page. + QPDF_DLL + void pushInheritedAttributesToPage(); + + // Add new page at the beginning or the end of the current pdf. + // The newpage parameter may be either a direct object, an + // indirect object from this QPDF, or an indirect object from + // another QPDF. If it is a direct object, it will be made + // indirect. If it is an indirect object from another QPDF, this + // method will call pushInheritedAttributesToPage on the other + // file and then copy the page to this QPDF using the same + // underlying code as copyForeignObject. + QPDF_DLL + void addPage(QPDFObjectHandle newpage, bool first); + + // Add new page before or after refpage. See comments for addPage + // for details about what newpage should be. + QPDF_DLL + void addPageAt(QPDFObjectHandle newpage, bool before, + QPDFObjectHandle refpage); + + // Remove page from the pdf. + QPDF_DLL + void removePage(QPDFObjectHandle page); + + // Resolver class is restricted to QPDFObjectHandle so that only + // it can resolve indirect references. + class Resolver + { + friend class QPDFObjectHandle; + private: + static PointerHolder resolve( + QPDF* qpdf, int objid, int generation) + { + return qpdf->resolve(objid, generation); + } + }; + friend class Resolver; + + // Pipe class is restricted to QPDF_Stream + class Pipe + { + friend class QPDF_Stream; + private: + static void pipeStreamData(QPDF* qpdf, int objid, int generation, + qpdf_offset_t offset, size_t length, + QPDFObjectHandle dict, + Pipeline* pipeline) + { + qpdf->pipeStreamData( + objid, generation, offset, length, dict, pipeline); + } + }; + friend class Pipe; + + private: + static std::string qpdf_version; + + class ObjGen + { + public: + ObjGen(); + ObjGen(int obj, int gen); + bool operator<(ObjGen const&) const; + + int obj; + int gen; + }; + + class ObjCache + { + public: + ObjCache() : + end_before_space(0), + end_after_space(0) + { + } + ObjCache(PointerHolder object, + qpdf_offset_t end_before_space, + qpdf_offset_t end_after_space) : + object(object), + end_before_space(end_before_space), + end_after_space(end_after_space) + { + } + + PointerHolder object; + qpdf_offset_t end_before_space; + qpdf_offset_t end_after_space; + }; + + class ObjCopier + { + public: + std::map object_map; + std::vector to_copy; + std::set visiting; + }; + + class CopiedStreamDataProvider: public QPDFObjectHandle::StreamDataProvider + { + public: + virtual ~CopiedStreamDataProvider() + { + } + virtual void provideStreamData(int objid, int generation, + Pipeline* pipeline); + void registerForeignStream(ObjGen const& local_og, + QPDFObjectHandle foreign_stream); + + private: + std::map foreign_streams; + }; + + class StringDecrypter: public QPDFObjectHandle::StringDecrypter + { + friend class QPDF; + + public: + StringDecrypter(QPDF* qpdf, int objid, int gen); + virtual ~StringDecrypter() + { + } + virtual void decryptString(std::string& val); + + private: + QPDF* qpdf; + int objid; + int gen; + }; + + void parse(char const* password); + void warn(QPDFExc const& e); + void setTrailer(QPDFObjectHandle obj); + void read_xref(qpdf_offset_t offset); + void reconstruct_xref(QPDFExc& e); + qpdf_offset_t read_xrefTable(qpdf_offset_t offset); + qpdf_offset_t read_xrefStream(qpdf_offset_t offset); + qpdf_offset_t processXRefStream( + qpdf_offset_t offset, QPDFObjectHandle& xref_stream); + void insertXrefEntry(int obj, int f0, qpdf_offset_t f1, int f2, + bool overwrite = false); + void setLastObjectDescription(std::string const& description, + int objid, int generation); + QPDFObjectHandle readObject( + PointerHolder, std::string const& description, + int objid, int generation, bool in_object_stream); + size_t recoverStreamLength( + PointerHolder input, int objid, int generation, + qpdf_offset_t stream_offset); + QPDFTokenizer::Token readToken(PointerHolder); + + QPDFObjectHandle readObjectAtOffset( + bool attempt_recovery, + qpdf_offset_t offset, std::string const& description, + int exp_objid, int exp_generation, + int& act_objid, int& act_generation); + PointerHolder resolve(int objid, int generation); + void resolveObjectsInStream(int obj_stream_number); + + // Calls finish() on the pipeline when done but does not delete it + void pipeStreamData(int objid, int generation, + qpdf_offset_t offset, size_t length, + QPDFObjectHandle dict, + Pipeline* pipeline); + + // methods to support page handling + + void getAllPagesInternal(QPDFObjectHandle cur_pages, + std::vector& result); + void insertPage(QPDFObjectHandle newpage, int pos); + int findPage(int objid, int generation); + int findPage(QPDFObjectHandle& page); + void flattenPagesTree(); + void insertPageobjToPage(QPDFObjectHandle const& obj, int pos, + bool check_duplicate); + + // methods to support encryption -- implemented in QPDF_encryption.cc + encryption_method_e interpretCF(QPDFObjectHandle); + void initializeEncryption(); + std::string getKeyForObject(int objid, int generation, bool use_aes); + void decryptString(std::string&, int objid, int generation); + void decryptStream( + Pipeline*& pipeline, int objid, int generation, + QPDFObjectHandle& stream_dict, + std::vector >& heap); + + // Methods to support object copying + QPDFObjectHandle copyForeignObject( + QPDFObjectHandle foreign, bool allow_page); + void reserveObjects(QPDFObjectHandle foreign, ObjCopier& obj_copier, + bool top); + QPDFObjectHandle replaceForeignIndirectObjects( + QPDFObjectHandle foreign, ObjCopier& obj_copier, bool top); + + // Linearization Hint table structures. + // Naming conventions: + + // HSomething is the Something Hint Table or table header + // HSomethingEntry is an entry in the Something table + + // delta_something + min_something = something + // nbits_something = number of bits required for something + + // something_offset is the pre-adjusted offset in the file. If >= + // H0_offset, H0_length must be added to get an actual file + // offset. + + // PDF 1.4: Table F.4 + struct HPageOffsetEntry + { + HPageOffsetEntry() : + delta_nobjects(0), + delta_page_length(0), + nshared_objects(0), + delta_content_offset(0), + delta_content_length(0) + { + } + + int delta_nobjects; // 1 + qpdf_offset_t delta_page_length; // 2 + int nshared_objects; // 3 + // vectors' sizes = nshared_objects + std::vector shared_identifiers; // 4 + std::vector shared_numerators; // 5 + qpdf_offset_t delta_content_offset; // 6 + qpdf_offset_t delta_content_length; // 7 + }; + + // PDF 1.4: Table F.3 + struct HPageOffset + { + HPageOffset() : + min_nobjects(0), + first_page_offset(0), + nbits_delta_nobjects(0), + min_page_length(0), + nbits_delta_page_length(0), + min_content_offset(0), + nbits_delta_content_offset(0), + min_content_length(0), + nbits_delta_content_length(0), + nbits_nshared_objects(0), + nbits_shared_identifier(0), + nbits_shared_numerator(0), + shared_denominator(0) + { + } + + int min_nobjects; // 1 + qpdf_offset_t first_page_offset; // 2 + int nbits_delta_nobjects; // 3 + int min_page_length; // 4 + int nbits_delta_page_length; // 5 + int min_content_offset; // 6 + int nbits_delta_content_offset; // 7 + int min_content_length; // 8 + int nbits_delta_content_length; // 9 + int nbits_nshared_objects; // 10 + int nbits_shared_identifier; // 11 + int nbits_shared_numerator; // 12 + int shared_denominator; // 13 + // vector size is npages + std::vector entries; + }; + + // PDF 1.4: Table F.6 + struct HSharedObjectEntry + { + HSharedObjectEntry() : + delta_group_length(0), + signature_present(0), + nobjects_minus_one(0) + { + } + + // Item 3 is a 128-bit signature (unsupported by Acrobat) + int delta_group_length; // 1 + int signature_present; // 2 -- always 0 + int nobjects_minus_one; // 4 -- always 0 + }; + + // PDF 1.4: Table F.5 + struct HSharedObject + { + HSharedObject() : + first_shared_obj(0), + first_shared_offset(0), + nshared_first_page(0), + nshared_total(0), + nbits_nobjects(0), + min_group_length(0), + nbits_delta_group_length(0) + { + } + + int first_shared_obj; // 1 + qpdf_offset_t first_shared_offset; // 2 + int nshared_first_page; // 3 + int nshared_total; // 4 + int nbits_nobjects; // 5 + int min_group_length; // 6 + int nbits_delta_group_length; // 7 + // vector size is nshared_total + std::vector entries; + }; + + // PDF 1.4: Table F.9 + struct HGeneric + { + HGeneric() : + first_object(0), + first_object_offset(0), + nobjects(0), + group_length(0) + { + } + + int first_object; // 1 + qpdf_offset_t first_object_offset; // 2 + int nobjects; // 3 + int group_length; // 4 + }; + + // Other linearization data structures + + // Initialized from Linearization Parameter dictionary + struct LinParameters + { + LinParameters() : + file_size(0), + first_page_object(0), + first_page_end(0), + npages(0), + xref_zero_offset(0), + first_page(0), + H_offset(0), + H_length(0) + { + } + + qpdf_offset_t file_size; // /L + int first_page_object; // /O + qpdf_offset_t first_page_end; // /E + int npages; // /N + qpdf_offset_t xref_zero_offset; // /T + int first_page; // /P + qpdf_offset_t H_offset; // offset of primary hint stream + qpdf_offset_t H_length; // length of primary hint stream + }; + + // Computed hint table value data structures. These tables + // contain the computed values on which the hint table values are + // based. They exclude things like number of bits and store + // actual values instead of mins and deltas. File offsets are + // also absolute rather than being offset by the size of the + // primary hint table. We populate the hint table structures from + // these during writing and compare the hint table values with + // these during validation. We ignore some values for various + // reasons described in the code. Those values are omitted from + // these structures. Note also that object numbers are object + // numbers from the input file, not the output file. + + // Naming convention: CHSomething is analogous to HSomething + // above. "CH" is computed hint. + + struct CHPageOffsetEntry + { + CHPageOffsetEntry() : + nobjects(0), + nshared_objects(0) + { + } + + int nobjects; + int nshared_objects; + // vectors' sizes = nshared_objects + std::vector shared_identifiers; + }; + + struct CHPageOffset + { + // vector size is npages + std::vector entries; + }; + + struct CHSharedObjectEntry + { + CHSharedObjectEntry(int object) : + object(object) + { + } + + int object; + }; + + // PDF 1.4: Table F.5 + struct CHSharedObject + { + CHSharedObject() : + first_shared_obj(0), + nshared_first_page(0), + nshared_total(0) + { + } + + int first_shared_obj; + int nshared_first_page; + int nshared_total; + // vector size is nshared_total + std::vector entries; + }; + + // No need for CHGeneric -- HGeneric is fine as is. + + + // Data structures to support optimization -- implemented in + // QPDF_optimization.cc + + class ObjUser + { + public: + enum user_e + { + ou_bad, + ou_page, + ou_thumb, + ou_trailer_key, + ou_root_key, + ou_root + }; + + // type is set to ou_bad + ObjUser(); + + // type must be ou_root + ObjUser(user_e type); + + // type must be one of ou_page or ou_thumb + ObjUser(user_e type, int pageno); + + // type must be one of ou_trailer_key or ou_root_key + ObjUser(user_e type, std::string const& key); + + bool operator<(ObjUser const&) const; + + user_e ou_type; + int pageno; // if ou_page; + std::string key; // if ou_trailer_key or ou_root_key + }; + + // methods to support linearization checking -- implemented in + // QPDF_linearization.cc + void readLinearizationData(); + bool checkLinearizationInternal(); + void dumpLinearizationDataInternal(); + QPDFObjectHandle readHintStream( + Pipeline&, qpdf_offset_t offset, size_t length); + void readHPageOffset(BitStream); + void readHSharedObject(BitStream); + void readHGeneric(BitStream, HGeneric&); + int maxEnd(ObjUser const& ou); + qpdf_offset_t getLinearizationOffset(ObjGen const&); + QPDFObjectHandle getUncompressedObject( + QPDFObjectHandle&, std::map const& object_stream_data); + int lengthNextN(int first_object, int n, + std::list& errors); + void checkHPageOffset(std::list& errors, + std::list& warnings, + std::vector const& pages, + std::map& idx_to_obj); + void checkHSharedObject(std::list& warnings, + std::list& errors, + std::vector const& pages, + std::map& idx_to_obj); + void checkHOutlines(std::list& warnings); + void dumpHPageOffset(); + void dumpHSharedObject(); + void dumpHGeneric(HGeneric&); + int adjusted_offset(int offset); + QPDFObjectHandle objGenToIndirect(ObjGen const&); + void calculateLinearizationData( + std::map const& object_stream_data); + void pushOutlinesToPart( + std::vector& part, + std::set& lc_outlines, + std::map const& object_stream_data); + int outputLengthNextN( + int in_object, int n, + std::map const& lengths, + std::map const& obj_renumber); + void calculateHPageOffset( + std::map const& xref, + std::map const& lengths, + std::map const& obj_renumber); + void calculateHSharedObject( + std::map const& xref, + std::map const& lengths, + std::map const& obj_renumber); + void calculateHOutline( + std::map const& xref, + std::map const& lengths, + std::map const& obj_renumber); + void writeHPageOffset(BitWriter&); + void writeHSharedObject(BitWriter&); + void writeHGeneric(BitWriter&, HGeneric&); + + + // Methods to support optimization + + void pushInheritedAttributesToPage(bool allow_changes, + bool warn_skipped_keys); + void pushInheritedAttributesToPageInternal( + QPDFObjectHandle, + std::map >&, + std::vector& all_pages, + bool allow_changes, bool warn_skipped_keys); + void updateObjectMaps(ObjUser const& ou, QPDFObjectHandle oh); + void updateObjectMapsInternal(ObjUser const& ou, QPDFObjectHandle oh, + std::set& visited, bool top); + void filterCompressedObjects(std::map const& object_stream_data); + + + QPDFTokenizer tokenizer; + PointerHolder file; + std::string last_object_description; + bool encrypted; + bool encryption_initialized; + bool ignore_xref_streams; + bool suppress_warnings; + std::ostream* out_stream; + std::ostream* err_stream; + bool attempt_recovery; + int encryption_V; + bool encrypt_metadata; + std::map crypt_filters; + encryption_method_e cf_stream; + encryption_method_e cf_string; + encryption_method_e cf_file; + std::string provided_password; + std::string user_password; + std::string encryption_key; + std::string cached_object_encryption_key; + int cached_key_objid; + int cached_key_generation; + std::string pdf_version; + std::map xref_table; + std::set deleted_objects; + std::map obj_cache; + QPDFObjectHandle trailer; + std::vector all_pages; + std::map pageobj_to_pages_pos; + bool pushed_inherited_attributes_to_pages; + std::vector warnings; + std::map object_copiers; + PointerHolder copied_streams; + // copied_stream_data_provider is owned by copied_streams + CopiedStreamDataProvider* copied_stream_data_provider; + + // Linearization data + qpdf_offset_t first_xref_item_offset; // actual value from file + bool uncompressed_after_compressed; + + // Linearization parameter dictionary and hint table data: may be + // read from file or computed prior to writing a linearized file + QPDFObjectHandle lindict; + LinParameters linp; + HPageOffset page_offset_hints; + HSharedObject shared_object_hints; + HGeneric outline_hints; + + // Computed linearization data: used to populate above tables + // during writing and to compare with them during validation. c_ + // means computed. + LinParameters c_linp; + CHPageOffset c_page_offset_data; + CHSharedObject c_shared_object_data; + HGeneric c_outline_data; + + // Object ordering data for linearized files: initialized by + // calculateLinearizationData(). Part numbers refer to the PDF + // 1.4 specification. + std::vector part4; + std::vector part6; + std::vector part7; + std::vector part8; + std::vector part9; + + // Optimization data + std::map > obj_user_to_objects; + std::map > object_to_obj_users; +}; + +#endif // __QPDF_HH__ diff --git a/include/qpdf/QPDFExc.hh b/include/qpdf/QPDFExc.hh new file mode 100644 index 0000000..30d576e --- /dev/null +++ b/include/qpdf/QPDFExc.hh @@ -0,0 +1,63 @@ +// Copyright (c) 2005-2012 Jay Berkenbilt +// +// This file is part of qpdf. This software may be distributed under +// the terms of version 2 of the Artistic License which may be found +// in the source distribution. It is provided "as is" without express +// or implied warranty. + +#ifndef __QPDFEXC_HH__ +#define __QPDFEXC_HH__ + +#include +#include + +#include +#include + +class QPDFExc: public std::runtime_error +{ + public: + QPDF_DLL + QPDFExc(qpdf_error_code_e error_code, + std::string const& filename, + std::string const& object, + qpdf_offset_t offset, + std::string const& message); + QPDF_DLL + virtual ~QPDFExc() throw (); + + // To get a complete error string, call what(), provided by + // std::exception. The accessors below return the original values + // used to create the exception. Only the error code and message + // are guaranteed to have non-zero/empty values. + + // There is no lookup code that maps numeric error codes into + // strings. The numeric error code is just another way to get at + // the underlying issue, but it is more programmer-friendly than + // trying to parse a string that is subject to change. + + QPDF_DLL + qpdf_error_code_e getErrorCode() const; + QPDF_DLL + std::string const& getFilename() const; + QPDF_DLL + std::string const& getObject() const; + QPDF_DLL + qpdf_offset_t getFilePosition() const; + QPDF_DLL + std::string const& getMessageDetail() const; + + private: + static std::string createWhat(std::string const& filename, + std::string const& object, + qpdf_offset_t offset, + std::string const& message); + + qpdf_error_code_e error_code; + std::string filename; + std::string object; + qpdf_offset_t offset; + std::string message; +}; + +#endif // __QPDFEXC_HH__ diff --git a/include/qpdf/QPDFObject.hh b/include/qpdf/QPDFObject.hh new file mode 100644 index 0000000..4626eb6 --- /dev/null +++ b/include/qpdf/QPDFObject.hh @@ -0,0 +1,44 @@ +// Copyright (c) 2005-2012 Jay Berkenbilt +// +// This file is part of qpdf. This software may be distributed under +// the terms of version 2 of the Artistic License which may be found +// in the source distribution. It is provided "as is" without express +// or implied warranty. + +#ifndef __QPDFOBJECT_HH__ +#define __QPDFOBJECT_HH__ + +#include + +#include + +class QPDF; +class QPDFObjectHandle; + +class QPDFObject +{ + public: + virtual ~QPDFObject() {} + virtual std::string unparse() = 0; + + // Accessor to give specific access to non-public methods + class ObjAccessor + { + friend class QPDF; + friend class QPDFObjectHandle; + private: + static void releaseResolved(QPDFObject* o) + { + if (o) + { + o->releaseResolved(); + } + } + }; + friend class ObjAccessor; + + protected: + virtual void releaseResolved() {} +}; + +#endif // __QPDFOBJECT_HH__ diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh new file mode 100644 index 0000000..0375b83 --- /dev/null +++ b/include/qpdf/QPDFObjectHandle.hh @@ -0,0 +1,565 @@ +// Copyright (c) 2005-2012 Jay Berkenbilt +// +// This file is part of qpdf. This software may be distributed under +// the terms of version 2 of the Artistic License which may be found +// in the source distribution. It is provided "as is" without express +// or implied warranty. + +#ifndef __QPDFOBJECTHANDLE_HH__ +#define __QPDFOBJECTHANDLE_HH__ + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include + +class Pipeline; +class QPDF; +class QPDF_Dictionary; +class QPDF_Array; +class QPDFTokenizer; + +class QPDFObjectHandle +{ + public: + // This class is used by replaceStreamData. It provides an + // alternative way of associating stream data with a stream. See + // comments on replaceStreamData and newStream for additional + // details. + class StreamDataProvider + { + public: + QPDF_DLL + virtual ~StreamDataProvider() + { + } + // The implementation of this function must write the + // unencrypted, raw stream data to the given pipeline. Every + // call to provideStreamData for a given stream must write the + // same data. The number of bytes written must agree with the + // length provided at the time the StreamDataProvider object + // was associated with the stream. The object ID and + // generation passed to this method are those that belong to + // the stream on behalf of which the provider is called. They + // may be ignored or used by the implementation for indexing + // or other purposes. This information is made available just + // to make it more convenient to use a single + // StreamDataProvider object to provide data for multiple + // streams. + virtual void provideStreamData(int objid, int generation, + Pipeline* pipeline) = 0; + }; + + // This class is used by parse to decrypt strings when reading an + // object that contains encrypted strings. + class StringDecrypter + { + public: + QPDF_DLL + virtual ~StringDecrypter() + { + } + virtual void decryptString(std::string& val) = 0; + }; + + QPDF_DLL + QPDFObjectHandle(); + QPDF_DLL + bool isInitialized() const; + + // Exactly one of these will return true for any object. + QPDF_DLL + bool isBool(); + QPDF_DLL + bool isNull(); + QPDF_DLL + bool isInteger(); + QPDF_DLL + bool isReal(); + QPDF_DLL + bool isName(); + QPDF_DLL + bool isString(); + QPDF_DLL + bool isArray(); + QPDF_DLL + bool isDictionary(); + QPDF_DLL + bool isStream(); + QPDF_DLL + bool isReserved(); + + // This returns true in addition to the query for the specific + // type for indirect objects. + QPDF_DLL + bool isIndirect(); + + // True for everything except array, dictionary, and stream + QPDF_DLL + bool isScalar(); + + // Public factory methods + + // Construct an object of any type from a string representation of + // the object. Throws QPDFExc with an empty filename and an + // offset into the string if there is an error. Any indirect + // object syntax (obj gen R) will cause a logic_error exception to + // be thrown. If object_description is provided, it will appear + // in the message of any QPDFExc exception thrown for invalid + // syntax. + QPDF_DLL + static QPDFObjectHandle parse(std::string const& object_str, + std::string const& object_description = ""); + + // Construct an object as above by reading from the given + // InputSource at its current position and using the tokenizer you + // supply. Indirect objects and encrypted strings are permitted. + // This method is intended to be called by QPDF for parsing + // objects that are ready from the object's input stream. + QPDF_DLL + static QPDFObjectHandle parse(PointerHolder input, + std::string const& object_description, + QPDFTokenizer&, bool& empty, + StringDecrypter* decrypter, + QPDF* context); + + // Type-specific factories + QPDF_DLL + static QPDFObjectHandle newNull(); + QPDF_DLL + static QPDFObjectHandle newBool(bool value); + QPDF_DLL + static QPDFObjectHandle newInteger(long long value); + QPDF_DLL + static QPDFObjectHandle newReal(std::string const& value); + QPDF_DLL + static QPDFObjectHandle newReal(double value, int decimal_places = 0); + QPDF_DLL + static QPDFObjectHandle newName(std::string const& name); + QPDF_DLL + static QPDFObjectHandle newString(std::string const& str); + QPDF_DLL + static QPDFObjectHandle newArray(); + QPDF_DLL + static QPDFObjectHandle newArray( + std::vector const& items); + QPDF_DLL + static QPDFObjectHandle newDictionary(); + QPDF_DLL + static QPDFObjectHandle newDictionary( + std::map const& items); + + // Create a new stream and associate it with the given qpdf + // object. A subsequent call must be made to replaceStreamData() + // to provide data for the stream. The stream's dictionary may be + // retrieved by calling getDict(), and the resulting dictionary + // may be modified. Alternatively, you can create a new + // dictionary and call replaceDict to install it. + QPDF_DLL + static QPDFObjectHandle newStream(QPDF* qpdf); + + // Create a new stream and associate it with the given qpdf + // object. Use the given buffer as the stream data. The stream + // dictionary's /Length key will automatically be set to the size + // of the data buffer. If additional keys are required, the + // stream's dictionary may be retrieved by calling getDict(), and + // the resulting dictionary may be modified. This method is just + // a convenient wrapper around the newStream() and + // replaceStreamData(). It is a convenience methods for streams + // that require no parameters beyond the stream length. Note that + // you don't have to deal with compression yourself if you use + // QPDFWriter. By default, QPDFWriter will automatically compress + // uncompressed stream data. Example programs are provided that + // illustrate this. + QPDF_DLL + static QPDFObjectHandle newStream(QPDF* qpdf, PointerHolder data); + + // Create new stream with data from string. This method will + // create a copy of the data rather than using the user-provided + // buffer as in the PointerHolder version of newStream. + QPDF_DLL + static QPDFObjectHandle newStream(QPDF* qpdf, std::string const& data); + + // A reserved object is a special sentinel used for qpdf to + // reserve a spot for an object that is going to be added to the + // QPDF object. Normally you don't have to use this type since + // you can just call QPDF::makeIndirectObject. However, in some + // cases, if you have to create objects with circular references, + // you may need to create a reserved object so that you can have a + // reference to it and then replace the object later. Reserved + // objects have the special property that they can't be resolved + // to direct objects. This makes it possible to replace a + // reserved object with a new object while preserving existing + // references to them. When you are ready to replace a reserved + // object with its replacement, use QPDF::replaceReserved for this + // purpose rather than the more general QPDF::replaceObject. It + // is an error to try to write a QPDF with QPDFWriter if it has + // any reserved objects in it. + QPDF_DLL + static QPDFObjectHandle newReserved(QPDF* qpdf); + + // Accessor methods. If an accessor method that is valid for only + // a particular object type is called on an object of the wrong + // type, an exception is thrown. + + // Methods for bool objects + QPDF_DLL + bool getBoolValue(); + + // Methods for integer objects + QPDF_DLL + long long getIntValue(); + + // Methods for real objects + QPDF_DLL + std::string getRealValue(); + + // Methods that work for both integer and real objects + QPDF_DLL + bool isNumber(); + QPDF_DLL + double getNumericValue(); + + // Methods for name objects; see also name and array objects + QPDF_DLL + std::string getName(); + + // Methods for string objects + QPDF_DLL + std::string getStringValue(); + QPDF_DLL + std::string getUTF8Value(); + + // Methods for array objects; see also name and array objects + QPDF_DLL + int getArrayNItems(); + QPDF_DLL + QPDFObjectHandle getArrayItem(int n); + QPDF_DLL + std::vector getArrayAsVector(); + + // Methods for dictionary objects + QPDF_DLL + bool hasKey(std::string const&); + QPDF_DLL + QPDFObjectHandle getKey(std::string const&); + QPDF_DLL + std::set getKeys(); + QPDF_DLL + std::map getDictAsMap(); + + // Methods for name and array objects + QPDF_DLL + bool isOrHasName(std::string const&); + + // Return the QPDF object that owns an indirect object. Returns + // null for a direct object. + QPDF_DLL + QPDF* getOwningQPDF(); + + // Create a shallow copy of an object as a direct object. Since + // this is a shallow copy, for dictionaries and arrays, any keys + // or items that were indirect objects will still be indirect + // objects that point to the same place. + QPDF_DLL + QPDFObjectHandle shallowCopy(); + + // Mutator methods. Use with caution. + + // Recursively copy this object, making it direct. Throws an + // exception if a loop is detected or any sub-object is a stream. + QPDF_DLL + void makeDirect(); + + // Mutator methods for array objects + QPDF_DLL + void setArrayItem(int, QPDFObjectHandle const&); + QPDF_DLL + void setArrayFromVector(std::vector const& items); + // Insert an item before the item at the given position ("at") so + // that it has that position after insertion. If "at" is equal to + // the size of the array, insert the item at the end. + QPDF_DLL + void insertItem(int at, QPDFObjectHandle const& item); + QPDF_DLL + void appendItem(QPDFObjectHandle const& item); + // Remove the item at that position, reducing the size of the + // array by one. + QPDF_DLL + void eraseItem(int at); + + // Mutator methods for dictionary objects + + // Replace value of key, adding it if it does not exist + QPDF_DLL + void replaceKey(std::string const& key, QPDFObjectHandle const&); + // Remove key, doing nothing if key does not exist + QPDF_DLL + void removeKey(std::string const& key); + // If the object is null, remove the key. Otherwise, replace it. + QPDF_DLL + void replaceOrRemoveKey(std::string const& key, QPDFObjectHandle); + + // Methods for stream objects + QPDF_DLL + QPDFObjectHandle getDict(); + + // Returns filtered (uncompressed) stream data. Throws an + // exception if the stream is filtered and we can't decode it. + QPDF_DLL + PointerHolder getStreamData(); + // Returns unfiltered (raw) stream data. + QPDF_DLL + PointerHolder getRawStreamData(); + + // Write stream data through the given pipeline. A null pipeline + // value may be used if all you want to do is determine whether a + // stream is filterable. If filter is false, write raw stream + // data and return false. If filter is true, then attempt to + // apply all the decoding filters to the stream data. If we are + // successful, return true. Otherwise, return false and write raw + // data. If filtering is requested and successfully performed, + // then the normalize and compress flags are used to determine + // whether stream data should be normalized and compressed. In + // all cases, if this function returns false, raw data has been + // written. If it returns true, then any requested filtering has + // been performed. Note that if the original stream data has no + // filters applied to it, the return value will be equal to the + // value of the filter parameter. Callers may use the return + // value of this function to determine whether or not the /Filter + // and /DecodeParms keys in the stream dictionary should be + // replaced if writing a new stream object. + QPDF_DLL + bool pipeStreamData(Pipeline*, bool filter, + bool normalize, bool compress); + + // Replace a stream's dictionary. The new dictionary must be + // consistent with the stream's data. This is most appropriately + // used when creating streams from scratch that will use a stream + // data provider and therefore start with an empty dictionary. It + // may be more convenient in this case than calling getDict and + // modifying it for each key. The pdf-create example does this. + QPDF_DLL + void replaceDict(QPDFObjectHandle); + + // Replace this stream's stream data with the given data buffer, + // and replace the /Filter and /DecodeParms keys in the stream + // dictionary with the given values. (If either value is empty, + // the corresponding key is removed.) The stream's /Length key is + // replaced with the length of the data buffer. The stream is + // interpreted as if the data read from the file, after any + // decryption filters have been applied, is as presented. + QPDF_DLL + void replaceStreamData(PointerHolder data, + QPDFObjectHandle const& filter, + QPDFObjectHandle const& decode_parms); + + // Replace the stream's stream data with the given string. + // This method will create a copy of the data rather than using + // the user-provided buffer as in the PointerHolder version + // of replaceStreamData. + QPDF_DLL + void replaceStreamData(std::string const& data, + QPDFObjectHandle const& filter, + QPDFObjectHandle const& decode_parms); + + // As above, replace this stream's stream data. Instead of + // directly providing a buffer with the stream data, call the + // given provider's provideStreamData method. See comments on the + // StreamDataProvider class (defined above) for details on the + // method. The data must be consistent with filter and + // decode_parms as provided. Although it is more complex to use + // this form of replaceStreamData than the one that takes a + // buffer, it makes it possible to avoid allocating memory for the + // stream data. Example programs are provided that use both forms + // of replaceStreamData. + + // Note about stream length: for any given stream, the provider + // must provide the same amount of data each time it is called. + // This is critical for making linearization work properly. + // Versions of qpdf before 3.0.0 required a length to be specified + // here. Starting with version 3.0.0, this is no longer necessary + // (or permitted). The first time the stream data provider is + // invoked for a given stream, the actual length is stored. + // Subsequent times, it is enforced that the length be the same as + // the first time. + + // If you have gotten a compile error here while building code + // that worked with older versions of qpdf, just omit the length + // parameter. You can also simplify your code by not having to + // compute the length in advance. + QPDF_DLL + void replaceStreamData(PointerHolder provider, + QPDFObjectHandle const& filter, + QPDFObjectHandle const& decode_parms); + + // return 0 for direct objects + QPDF_DLL + int getObjectID() const; + QPDF_DLL + int getGeneration() const; + + QPDF_DLL + std::string unparse(); + QPDF_DLL + std::string unparseResolved(); + + // Convenience routines for commonly performed functions + + // Throws an exception if this is not a Page object. Returns an + // empty map if there are no images or no resources. This + // function does not presently support inherited resources. If + // this is a significant concern, call + // pushInheritedAttributesToPage() on the QPDF object that owns + // this page. See comment in the source for details. Return + // value is a map from XObject name to the image object, which is + // always a stream. + QPDF_DLL + std::map getPageImages(); + + // Returns a vector of stream objects representing the content + // streams for the given page. This routine allows the caller to + // not care whether there are one or more than one content streams + // for a page. Throws an exception if this is not a Page object. + QPDF_DLL + std::vector getPageContents(); + + // Add the given object as a new content stream for this page. If + // parameter 'first' is true, add to the beginning. Otherwise, + // add to the end. This routine automatically converts the page + // contents to an array if it is a scalar, allowing the caller not + // to care what the initial structure is. Throws an exception if + // this is not a Page object. + QPDF_DLL + void addPageContents(QPDFObjectHandle contents, bool first); + + // Initializers for objects. This Factory class gives the QPDF + // class specific permission to call factory methods without + // making it a friend of the whole QPDFObjectHandle class. + class Factory + { + friend class QPDF; + private: + static QPDFObjectHandle newIndirect(QPDF* qpdf, + int objid, int generation) + { + return QPDFObjectHandle::newIndirect(qpdf, objid, generation); + } + // object must be dictionary object + static QPDFObjectHandle newStream( + QPDF* qpdf, int objid, int generation, + QPDFObjectHandle stream_dict, qpdf_offset_t offset, size_t length) + { + return QPDFObjectHandle::newStream( + qpdf, objid, generation, stream_dict, offset, length); + } + }; + friend class Factory; + + // Accessor for raw underlying object -- only QPDF is allowed to + // call this. + class ObjAccessor + { + friend class QPDF; + private: + static PointerHolder getObject(QPDFObjectHandle& o) + { + o.dereference(); + return o.obj; + } + }; + friend class ObjAccessor; + + // Provide access to specific classes for recursive + // reverseResolved(). + class ReleaseResolver + { + friend class QPDF_Dictionary; + friend class QPDF_Array; + private: + static void releaseResolved(QPDFObjectHandle& o) + { + o.releaseResolved(); + } + }; + friend class ReleaseResolver; + + // Convenience routine: Throws if the assumption is violated. + QPDF_DLL + void assertInitialized() const; + + QPDF_DLL + void assertNull(); + QPDF_DLL + void assertBool(); + QPDF_DLL + void assertInteger(); + QPDF_DLL + void assertReal(); + QPDF_DLL + void assertName(); + QPDF_DLL + void assertString(); + QPDF_DLL + void assertArray(); + QPDF_DLL + void assertDictionary(); + QPDF_DLL + void assertStream(); + QPDF_DLL + void assertReserved(); + + QPDF_DLL + void assertIndirect(); + QPDF_DLL + void assertScalar(); + QPDF_DLL + void assertNumber(); + + QPDF_DLL + bool isPageObject(); + QPDF_DLL + bool isPagesObject(); + QPDF_DLL + void assertPageObject(); + + private: + QPDFObjectHandle(QPDF*, int objid, int generation); + QPDFObjectHandle(QPDFObject*); + + // Private object factory methods + static QPDFObjectHandle newIndirect(QPDF*, int objid, int generation); + static QPDFObjectHandle newStream( + QPDF* qpdf, int objid, int generation, + QPDFObjectHandle stream_dict, qpdf_offset_t offset, size_t length); + + void assertType(char const* type_name, bool istype) const; + void dereference(); + void makeDirectInternal(std::set& visited); + void releaseResolved(); + static QPDFObjectHandle parseInternal( + PointerHolder input, + std::string const& object_description, + QPDFTokenizer& tokenizer, bool& empty, + StringDecrypter* decrypter, QPDF* context, + bool in_array, bool in_dictionary); + + bool initialized; + + QPDF* qpdf; // 0 for direct object + int objid; // 0 for direct object + int generation; + PointerHolder obj; + bool reserved; +}; + +#endif // __QPDFOBJECTHANDLE_HH__ diff --git a/include/qpdf/QPDFTokenizer.hh b/include/qpdf/QPDFTokenizer.hh new file mode 100644 index 0000000..6b385b4 --- /dev/null +++ b/include/qpdf/QPDFTokenizer.hh @@ -0,0 +1,159 @@ +// Copyright (c) 2005-2012 Jay Berkenbilt +// +// This file is part of qpdf. This software may be distributed under +// the terms of version 2 of the Artistic License which may be found +// in the source distribution. It is provided "as is" without express +// or implied warranty. + +#ifndef __QPDFTOKENIZER_HH__ +#define __QPDFTOKENIZER_HH__ + +#include + +#include +#include +#include +#include + +class QPDFTokenizer +{ + public: + enum token_type_e + { + tt_bad, + tt_array_close, + tt_array_open, + tt_brace_close, + tt_brace_open, + tt_dict_close, + tt_dict_open, + tt_integer, + tt_name, + tt_real, + tt_string, + tt_null, + tt_bool, + tt_word, + }; + + class Token + { + public: + Token() : type(tt_bad) {} + + Token(token_type_e type, std::string const& value) : + type(type), + value(value) + { + } + + Token(token_type_e type, std::string const& value, + std::string raw_value, std::string error_message) : + type(type), + value(value), + raw_value(raw_value), + error_message(error_message) + { + } + token_type_e getType() const + { + return this->type; + } + std::string const& getValue() const + { + return this->value; + } + std::string const& getRawValue() const + { + return this->raw_value; + } + std::string const& getErrorMessage() const + { + return this->error_message; + } + bool operator==(Token const& rhs) + { + // Ignore fields other than type and value + return ((this->type != tt_bad) && + (this->type == rhs.type) && + (this->value == rhs.value)); + } + + private: + token_type_e type; + std::string value; + std::string raw_value; + std::string error_message; + }; + + QPDF_DLL + QPDFTokenizer(); + + // PDF files with version < 1.2 allowed the pound character + // anywhere in a name. Starting with version 1.2, the pound + // character was allowed only when followed by two hexadecimal + // digits. This method should be called when parsing a PDF file + // whose version is older than 1.2. + QPDF_DLL + void allowPoundAnywhereInName(); + + // Mode of operation: + + // Keep presenting characters and calling getToken() until + // getToken() returns true. When it does, be sure to check + // unread_ch and to unread ch if it is true. + + // It these are called when a token is available, an exception + // will be thrown. + QPDF_DLL + void presentCharacter(char ch); + QPDF_DLL + void presentEOF(); + + // If a token is available, return true and initialize token with + // the token, unread_char with whether or not we have to unread + // the last character, and if unread_char, ch with the character + // to unread. + QPDF_DLL + bool getToken(Token& token, bool& unread_char, char& ch); + + // This function returns true of the current character is between + // tokens (i.e., white space that is not part of a string) or is + // part of a comment. A tokenizing filter can call this to + // determine whether to output the character. + QPDF_DLL + bool betweenTokens(); + + // Read a token from an input source. Context describes the + // context in which the token is being read and is used in the + // exception thrown if there is an error. + QPDF_DLL + Token readToken(PointerHolder input, + std::string const& context); + + private: + void reset(); + void resolveLiteral(); + + // Lexer state + enum { st_top, st_in_comment, st_in_string, st_lt, st_gt, + st_literal, st_in_hexstring, st_token_ready } state; + + bool pound_special_in_name; + + // Current token accumulation + token_type_e type; + std::string val; + std::string raw_val; + std::string error_message; + bool unread_char; + char char_to_unread; + + // State for strings + int string_depth; + bool string_ignoring_newline; + char bs_num_register[4]; + bool last_char_was_bs; +}; + +#endif // __QPDFTOKENIZER_HH__ diff --git a/include/qpdf/QPDFWriter.hh b/include/qpdf/QPDFWriter.hh new file mode 100644 index 0000000..2c1c32f --- /dev/null +++ b/include/qpdf/QPDFWriter.hh @@ -0,0 +1,391 @@ +// Copyright (c) 2005-2012 Jay Berkenbilt +// +// This file is part of qpdf. This software may be distributed under +// the terms of version 2 of the Artistic License which may be found +// in the source distribution. It is provided "as is" without express +// or implied warranty. + +// This class implements a simple writer for saving QPDF objects to +// new PDF files. See comments through the header file for additional +// details. + +#ifndef __QPDFWRITER_HH__ +#define __QPDFWRITER_HH__ + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include + +class QPDF; +class QPDFObjectHandle; +class Pl_Count; + +class QPDFWriter +{ + public: + // Construct a QPDFWriter object without specifying output. You + // must call one of the output setting routines defined below. + QPDF_DLL + QPDFWriter(QPDF& pdf); + + // Create a QPDFWriter object that writes its output to a file or + // to stdout. This is equivalent to using the previous + // constructor and then calling setOutputFilename(). See + // setOutputFilename() for details. + QPDF_DLL + QPDFWriter(QPDF& pdf, char const* filename); + + // Create a QPDFWriter object that writes its output to an already + // open FILE*. This is equivalent to calling the first + // constructor and then calling setOutputFile(). See + // setOutputFile() for details. + QPDF_DLL + QPDFWriter(QPDF& pdf, char const* description, FILE* file, bool close_file); + + QPDF_DLL + ~QPDFWriter(); + + // Setting Output. Output may be set only one time. If you don't + // use the filename version of the QPDFWriter constructor, you + // must call exactly one of these methods. + + // Passing null as filename means write to stdout. QPDFWriter + // will create a zero-length output file upon construction. If + // write fails, the empty or partially written file will not be + // deleted. This is by design: sometimes the partial file may be + // useful for tracking down problems. If your application doesn't + // want the partially written file to be left behind, you should + // delete it the eventual call to write fails. + QPDF_DLL + void setOutputFilename(char const* filename); + + // Write to the given FILE*, which must be opened by the caller. + // If close_file is true, QPDFWriter will close the file. + // Otherwise, the caller must close the file. The file does not + // need to be seekable; it will be written to in a single pass. + // It must be open in binary mode. + QPDF_DLL + void setOutputFile(char const* description, FILE* file, bool close_file); + + // Indicate that QPDFWriter should create a memory buffer to + // contain the final PDF file. Obtain the memory by calling + // getBuffer(). + QPDF_DLL + void setOutputMemory(); + + // Return the buffer object containing the PDF file. If + // setOutputMemory() has been called, this method may be called + // exactly one time after write() has returned. The caller is + // responsible for deleting the buffer when done. + QPDF_DLL + Buffer* getBuffer(); + + // Setting Parameters + + // Set the value of object stream mode. In disable mode, we never + // generate any object streams. In preserve mode, we preserve + // object stream structure from the original file. In generate + // mode, we generate our own object streams. In all cases, we + // generate a conventional cross-reference table if there are no + // object streams and a cross-reference stream if there are object + // streams. The default is o_preserve. + QPDF_DLL + void setObjectStreamMode(qpdf_object_stream_e); + + // Set value of stream data mode. In uncompress mode, we attempt + // to uncompress any stream that we can. In preserve mode, we + // preserve any filtering applied to streams. In compress mode, + // if we can apply all filters and the stream is not already + // optimally compressed, recompress the stream. + QPDF_DLL + void setStreamDataMode(qpdf_stream_data_e); + + // Set value of content stream normalization. The default is + // "false". If true, we attempt to normalize newlines inside of + // content streams. Some constructs such as inline images may + // thwart our efforts. There may be some cases where this can + // damage the content stream. This flag should be used only for + // debugging and experimenting with PDF content streams. Never + // use it for production files. + QPDF_DLL + void setContentNormalization(bool); + + // Set QDF mode. QDF mode causes special "pretty printing" of + // PDF objects, adds comments for easier perusing of files. + // Resulting PDF files can be edited in a text editor and then run + // through fix-qdf to update cross reference tables and stream + // lengths. + QPDF_DLL + void setQDFMode(bool); + + // Set the minimum PDF version. If the PDF version of the input + // file (or previously set minimum version) is less than the + // version passed to this method, the PDF version of the output + // file will be set to this value. If the original PDF file's + // version or previously set minimum version is already this + // version or later, the original file's version will be used. + // QPDFWriter automatically sets the minimum version to 1.4 when + // R3 encryption parameters are used, and to 1.5 when object + // streams are used. + QPDF_DLL + void setMinimumPDFVersion(std::string const&); + + // Force the PDF version of the output file to be a given version. + // Use of this function may create PDF files that will not work + // properly with older PDF viewers. When a PDF version is set + // using this function, qpdf will use this version even if the + // file contains features that are not supported in that version + // of PDF. In other words, you should only use this function if + // you are sure the PDF file in question has no features of newer + // versions of PDF or if you are willing to create files that old + // viewers may try to open but not be able to properly interpret. + // If any encryption has been applied to the document either + // explicitly or by preserving the encryption of the source + // document, forcing the PDF version to a value too low to support + // that type of encryption will explicitly disable decryption. + // Additionally, forcing to a version below 1.5 will disable + // object streams. + QPDF_DLL + void forcePDFVersion(std::string const&); + + // Provide additional text to insert in the PDF file somewhere + // near the beginning of the file. This can be used to add + // comments to the beginning of a PDF file, for example, if those + // comments are to be consumed by some other application. No + // checks are performed to ensure that the text inserted here is + // valid PDF. If you want to insert multiline comments, you will + // need to include \n in the string yourself and start each line + // with %. An extra newline will be appended if one is not + // already present at the end of your text. + QPDF_DLL + void setExtraHeaderText(std::string const&); + + // Cause a static /ID value to be generated. Use only in test + // suites. + QPDF_DLL + void setStaticID(bool); + + // Use a fixed initialization vector for AES-CBC encryption. This + // is not secure. It should be used only in test suites for + // creating predictable encrypted output. + QPDF_DLL + void setStaticAesIV(bool); + + // Suppress inclusion of comments indicating original object IDs + // when writing QDF files. This can also be useful for testing, + // particularly when using comparison of two qdf files to + // determine whether two PDF files have identical content. + QPDF_DLL + void setSuppressOriginalObjectIDs(bool); + + // Preserve encryption. The default is true unless prefilering, + // content normalization, or qdf mode has been selected in which + // case encryption is never preserved. Encryption is also not + // preserved if we explicitly set encryption parameters. + QPDF_DLL + void setPreserveEncryption(bool); + + // Copy encryption parameters from another QPDF object. If you + // want to copy encryption from the object you are writing, call + // setPreserveEncryption(true) instead. + QPDF_DLL + void copyEncryptionParameters(QPDF&); + + // Set up for encrypted output. Disables stream prefiltering and + // content normalization. Note that setting R2 encryption + // parameters sets the PDF version to at least 1.3, setting R3 + // encryption parameters pushes the PDF version number to at least + // 1.4, and setting R4 parameters pushes the version to at least + // 1.5, or if AES is used, 1.6. + QPDF_DLL + void setR2EncryptionParameters( + char const* user_password, char const* owner_password, + bool allow_print, bool allow_modify, + bool allow_extract, bool allow_annotate); + QPDF_DLL + void setR3EncryptionParameters( + char const* user_password, char const* owner_password, + bool allow_accessibility, bool allow_extract, + qpdf_r3_print_e print, qpdf_r3_modify_e modify); + QPDF_DLL + void setR4EncryptionParameters( + char const* user_password, char const* owner_password, + bool allow_accessibility, bool allow_extract, + qpdf_r3_print_e print, qpdf_r3_modify_e modify, + bool encrypt_metadata, bool use_aes); + + // Create linearized output. Disables qdf mode, content + // normalization, and stream prefiltering. + QPDF_DLL + void setLinearization(bool); + + QPDF_DLL + void write(); + + private: + // flags used by unparseObject + static int const f_stream = 1 << 0; + static int const f_filtered = 1 << 1; + static int const f_in_ostream = 1 << 2; + + enum trailer_e { t_normal, t_lin_first, t_lin_second }; + + void init(); + int bytesNeeded(unsigned long long n); + void writeBinary(unsigned long long val, unsigned int bytes); + void writeString(std::string const& str); + void writeBuffer(PointerHolder&); + void writeStringQDF(std::string const& str); + void writeStringNoQDF(std::string const& str); + void writePad(int nspaces); + void assignCompressedObjectNumbers(int objid); + void enqueueObject(QPDFObjectHandle object); + void writeObjectStreamOffsets( + std::vector& offsets, int first_obj); + void writeObjectStream(QPDFObjectHandle object); + void writeObject(QPDFObjectHandle object, int object_stream_index = -1); + void writeTrailer(trailer_e which, int size, + bool xref_stream, qpdf_offset_t prev = 0); + void unparseObject(QPDFObjectHandle object, int level, + unsigned int flags); + void unparseObject(QPDFObjectHandle object, int level, + unsigned int flags, + // for stream dictionaries + size_t stream_length, bool compress); + void unparseChild(QPDFObjectHandle child, int level, int flags); + void initializeSpecialStreams(); + void preserveObjectStreams(); + void generateObjectStreams(); + void generateID(); + void interpretR3EncryptionParameters( + std::set& bits_to_clear, + char const* user_password, char const* owner_password, + bool allow_accessibility, bool allow_extract, + qpdf_r3_print_e print, qpdf_r3_modify_e modify); + void disableIncompatibleEncryption(int major, int minor); + void parseVersion(std::string const& version, int& major, int& minor) const; + int compareVersions(int major1, int minor1, int major2, int minor2) const; + void setEncryptionParameters( + char const* user_password, char const* owner_password, + int V, int R, int key_len, std::set& bits_to_clear); + void setEncryptionParametersInternal( + int V, int R, int key_len, long P, + std::string const& O, std::string const& U, + std::string const& id1, std::string const& user_password); + void setDataKey(int objid); + int openObject(int objid = 0); + void closeObject(int objid); + void writeStandard(); + void writeLinearized(); + void enqueuePart(std::vector& part); + void writeEncryptionDictionary(); + void writeHeader(); + void writeHintStream(int hint_id); + qpdf_offset_t writeXRefTable( + trailer_e which, int first, int last, int size); + qpdf_offset_t writeXRefTable( + trailer_e which, int first, int last, int size, + // for linearization + qpdf_offset_t prev, + bool suppress_offsets, + int hint_id, + qpdf_offset_t hint_offset, + qpdf_offset_t hint_length); + qpdf_offset_t writeXRefStream( + int objid, int max_id, qpdf_offset_t max_offset, + trailer_e which, int first, int last, int size); + qpdf_offset_t writeXRefStream( + int objid, int max_id, qpdf_offset_t max_offset, + trailer_e which, int first, int last, int size, + // for linearization + qpdf_offset_t prev, + int hint_id, + qpdf_offset_t hint_offset, + qpdf_offset_t hint_length, + bool skip_compression); + int calculateXrefStreamPadding(int xref_bytes); + + // When filtering subsections, push additional pipelines to the + // stack. When ready to switch, activate the pipeline stack. + // Pipelines passed to pushPipeline are deleted when + // clearPipelineStack is called. + Pipeline* pushPipeline(Pipeline*); + void activatePipelineStack(); + void initializePipelineStack(Pipeline *); + + // Calls finish on the current pipeline and pops the pipeline + // stack until the top of stack is a previous active top of stack, + // and restores the pipeline to that point. Deletes any pipelines + // that it pops. If the bp argument is non-null and any of the + // stack items are of type Pl_Buffer, the buffer is retrieved. + void popPipelineStack(PointerHolder* bp = 0); + + void adjustAESStreamLength(size_t& length); + void pushEncryptionFilter(); + void pushDiscardFilter(); + + QPDF& pdf; + char const* filename; + FILE* file; + bool close_file; + Pl_Buffer* buffer_pipeline; + Buffer* output_buffer; + bool normalize_content_set; + bool normalize_content; + bool stream_data_mode_set; + qpdf_stream_data_e stream_data_mode; + bool qdf_mode; + bool static_id; + bool suppress_original_object_ids; + bool direct_stream_lengths; + bool encrypted; + bool preserve_encryption; + bool linearized; + qpdf_object_stream_e object_stream_mode; + std::string encryption_key; + bool encrypt_metadata; + bool encrypt_use_aes; + std::map encryption_dictionary; + + std::string id1; // for /ID key of + std::string id2; // trailer dictionary + std::string min_pdf_version; + std::string forced_pdf_version; + std::string extra_header_text; + int encryption_dict_objid; + std::string cur_data_key; + std::list > to_delete; + Pl_Count* pipeline; + std::list object_queue; + std::map obj_renumber; + std::map xref; + std::map lengths; + int next_objid; + int cur_stream_length_id; + size_t cur_stream_length; + bool added_newline; + int max_ostream_index; + std::set normalized_streams; + std::map page_object_to_seq; + std::map contents_to_page_seq; + std::map object_to_object_stream; + std::map > object_stream_to_objects; + std::list pipeline_stack; +}; + +#endif // __QPDFWRITER_HH__ diff --git a/include/qpdf/QPDFXRefEntry.hh b/include/qpdf/QPDFXRefEntry.hh new file mode 100644 index 0000000..f27b434 --- /dev/null +++ b/include/qpdf/QPDFXRefEntry.hh @@ -0,0 +1,43 @@ +// Copyright (c) 2005-2012 Jay Berkenbilt +// +// This file is part of qpdf. This software may be distributed under +// the terms of version 2 of the Artistic License which may be found +// in the source distribution. It is provided "as is" without express +// or implied warranty. + +#ifndef __QPDFXREFENTRY_HH__ +#define __QPDFXREFENTRY_HH__ + +#include +#include + +class QPDFXRefEntry +{ + public: + // Type constants are from the PDF spec section + // "Cross-Reference Streams": + // 0 = free entry; not used + // 1 = "uncompressed"; field 1 = offset + // 2 = "compressed"; field 1 = object stream number, field 2 = index + + QPDF_DLL + QPDFXRefEntry(); + QPDF_DLL + QPDFXRefEntry(int type, qpdf_offset_t field1, int field2); + + QPDF_DLL + int getType() const; + QPDF_DLL + qpdf_offset_t getOffset() const; // only for type 1 + QPDF_DLL + int getObjStreamNumber() const; // only for type 2 + QPDF_DLL + int getObjStreamIndex() const; // only for type 2 + + private: + int type; + qpdf_offset_t field1; + int field2; +}; + +#endif // __QPDFXREFENTRY_HH__ diff --git a/include/qpdf/QTC.hh b/include/qpdf/QTC.hh new file mode 100644 index 0000000..1433742 --- /dev/null +++ b/include/qpdf/QTC.hh @@ -0,0 +1,19 @@ +// Copyright (c) 2005-2012 Jay Berkenbilt +// +// This file is part of qpdf. This software may be distributed under +// the terms of version 2 of the Artistic License which may be found +// in the source distribution. It is provided "as is" without express +// or implied warranty. + +#ifndef __QTC_HH__ +#define __QTC_HH__ + +#include + +namespace QTC +{ + QPDF_DLL + void TC(char const* const scope, char const* const ccase, int n = 0); +}; + +#endif // __QTC_HH__ diff --git a/include/qpdf/QUtil.hh b/include/qpdf/QUtil.hh new file mode 100644 index 0000000..cdeefd7 --- /dev/null +++ b/include/qpdf/QUtil.hh @@ -0,0 +1,88 @@ +// Copyright (c) 2005-2012 Jay Berkenbilt +// +// This file is part of qpdf. This software may be distributed under +// the terms of version 2 of the Artistic License which may be found +// in the source distribution. It is provided "as is" without express +// or implied warranty. + +#ifndef __QUTIL_HH__ +#define __QUTIL_HH__ + +#include +#include +#include +#include +#include +#include + +namespace QUtil +{ + // This is a collection of useful utility functions that don't + // really go anywhere else. + QPDF_DLL + std::string int_to_string(long long, int length = 0); + QPDF_DLL + std::string double_to_string(double, int decimal_places = 0); + + QPDF_DLL + long long string_to_ll(char const* str); + + // Throw std::runtime_error with a string formed by appending to + // "description: " the standard string corresponding to the + // current value of errno. + QPDF_DLL + void throw_system_error(std::string const& description); + + // The status argument is assumed to be the return value of a + // standard library call that sets errno when it fails. If status + // is -1, convert the current value of errno to a + // std::runtime_error that includes the standard error string. + // Otherwise, return status. + QPDF_DLL + int os_wrapper(std::string const& description, int status); + + // The FILE* argument is assumed to be the return of fopen. If + // null, throw std::runtime_error. Otherwise, return the FILE* + // argument. + QPDF_DLL + FILE* fopen_wrapper(std::string const&, FILE*); + + // Wrap around off_t versions of fseek and ftell if available + QPDF_DLL + int seek(FILE* stream, qpdf_offset_t offset, int whence); + QPDF_DLL + qpdf_offset_t tell(FILE* stream); + + QPDF_DLL + char* copy_string(std::string const&); + + // Set stdin, stdout to binary mode + QPDF_DLL + void binary_stdout(); + QPDF_DLL + void binary_stdin(); + // Set stdout to line buffered + QPDF_DLL + void setLineBuf(FILE*); + + + // May modify argv0 + QPDF_DLL + char* getWhoami(char* argv0); + + // Get the value of an environment variable in a portable fashion. + // Returns true iff the variable is defined. If `value' is + // non-null, initializes it with the value of the variable. + QPDF_DLL + bool get_env(std::string const& var, std::string* value = 0); + + QPDF_DLL + time_t get_current_time(); + + // Return a string containing the byte representation of the UTF-8 + // encoding for the unicode value passed in. + QPDF_DLL + std::string toUTF8(unsigned long uval); +}; + +#endif // __QUTIL_HH__ diff --git a/include/qpdf/Types.h b/include/qpdf/Types.h new file mode 100644 index 0000000..0d6b8a2 --- /dev/null +++ b/include/qpdf/Types.h @@ -0,0 +1,11 @@ +#ifndef __QPDFTYPES_H__ +#define __QPDFTYPES_H__ + +/* Provide an offset type that should be as big as off_t on just about + * any system. If your compiler doesn't support C99 (or at least the + * "long long" type), then you may have to modify this definition. + */ + +typedef long long int qpdf_offset_t; + +#endif /* __QPDFTYPES_H__ */ diff --git a/include/qpdf/qpdf-c.h b/include/qpdf/qpdf-c.h new file mode 100644 index 0000000..beba231 --- /dev/null +++ b/include/qpdf/qpdf-c.h @@ -0,0 +1,379 @@ +/* Copyright (c) 2005-2012 Jay Berkenbilt + * + * This file is part of qpdf. This software may be distributed under + * the terms of version 2 of the Artistic License which may be found + * in the source distribution. It is provided "as is" without express + * or implied warranty. + */ + +#ifndef __QPDF_C_H__ +#define __QPDF_C_H__ + +/* + * This file defines a basic "C" API for qpdf. It provides access to + * a subset of the QPDF library's capabilities to make them accessible + * to callers who can't handle calling C++ functions or working with + * C++ classes. This may be especially useful to Windows users who + * are accessing the qpdf DLL directly or to other people programming + * in non-C/C++ languages that can call C code but not C++ code. + * + * There are several things to keep in mind when using the C API. + * + * The C API is not as rich as the C++ API. For any operations + * that involve actually manipulating PDF objects, you must use + * the C++ API. The C API is primarily useful for doing basic + * transformations on PDF files similar to what you might do with + * the qpdf command-line tool. + * + * These functions store their state in a qpdf_data object. + * Individual instances of qpdf_data are not thread-safe: although + * you may access different qpdf_data objects from different + * threads, you may not access one qpdf_data simultaneously from + * multiple threads. + * + * All dynamic memory, except for that of the qpdf_data object + * itself, is managed by the library. You must create a qpdf_data + * object using qpdf_init and free it using qpdf_cleanup. + * + * Many functions return char*. In all cases, the char* values + * returned are pointers to data inside the qpdf_data object. As + * such, they are always freed by qpdf_cleanup. In most cases, + * strings returned by functions here may be invalidated by + * subsequent function calls, sometimes even to different + * functions. If you want a string to last past the next qpdf + * call or after a call to qpdf_cleanup, you should make a copy of + * it. + * + * Many functions defined here merely set parameters and therefore + * never return error conditions. Functions that may cause PDF + * files to be read or written may return error conditions. Such + * functions return an error code. If there were no errors or + * warnings, they return QPDF_SUCCESS. If there were warnings, + * the return value has the QPDF_WARNINGS bit set. If there + * errors, the QPDF_ERRORS bit is set. In other words, if there + * are both warnings and errors, then the return status will be + * QPDF_WARNINGS | QPDF_ERRORS. You may also call the + * qpdf_more_warnings and qpdf_more_errors functions to test + * whether there are unseen warning or error conditions. By + * default, warnings are written to stderr when detected, but this + * behavior can be suppressed. In all cases, errors and warnings + * may be retrieved by calling qpdf_next_warning and + * qpdf_next_error. All exceptions thrown by the C++ interface + * are caught and converted into error messages by the C + * interface. + * + * Most functions defined here have obvious counterparts that are + * methods to either QPDF or QPDFWriter. Please see comments in + * QPDF.hh and QPDFWriter.hh for details on their use. In order + * to avoid duplication of information, comments here focus + * primarily on differences between the C and C++ API. + */ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + typedef struct _qpdf_data* qpdf_data; + typedef struct _qpdf_error* qpdf_error; + + /* Many functions return an integer error code. Codes are defined + * below. See comments at the top of the file for details. Note + * that the values below can be logically orred together. + */ + typedef int QPDF_ERROR_CODE; +# define QPDF_SUCCESS 0 +# define QPDF_WARNINGS 1 << 0 +# define QPDF_ERRORS 1 << 1 + + typedef int QPDF_BOOL; +# define QPDF_TRUE 1 +# define QPDF_FALSE 0 + + /* Returns the version of the qpdf software */ + QPDF_DLL + char const* qpdf_get_qpdf_version(); + + /* Returns dynamically allocated qpdf_data pointer; must be freed + * by calling qpdf_cleanup. + */ + QPDF_DLL + qpdf_data qpdf_init(); + + /* Pass a pointer to the qpdf_data pointer created by qpdf_init to + * clean up resources. + */ + QPDF_DLL + void qpdf_cleanup(qpdf_data* qpdf); + + /* ERROR REPORTING */ + + /* Returns 1 if there is an error condition. The error condition + * can be retrieved by a single call to qpdf_get_error. + */ + QPDF_DLL + QPDF_BOOL qpdf_has_error(qpdf_data qpdf); + + /* Returns the error condition, if any. The return value is a + * pointer to data that will become invalid after the next call to + * this function, qpdf_next_warning, or qpdf_destroy. After this + * function is called, qpdf_has_error will return QPDF_FALSE until + * the next error condition occurs. If there is no error + * condition, this function returns a null pointer. + */ + QPDF_DLL + qpdf_error qpdf_get_error(qpdf_data qpdf); + + /* Returns 1 if there are any unretrieved warnings, and zero + * otherwise. + */ + QPDF_DLL + QPDF_BOOL qpdf_more_warnings(qpdf_data qpdf); + + /* If there are any warnings, returns a pointer to the next + * warning. Otherwise returns a null pointer. + */ + QPDF_DLL + qpdf_error qpdf_next_warning(qpdf_data qpdf); + + /* Extract fields of the error. */ + + /* Use this function to get a full error message suitable for + * showing to the user. */ + QPDF_DLL + char const* qpdf_get_error_full_text(qpdf_data q, qpdf_error e); + + /* Use these functions to extract individual fields from the + * error; see QPDFExc.hh for details. */ + QPDF_DLL + enum qpdf_error_code_e qpdf_get_error_code(qpdf_data q, qpdf_error e); + QPDF_DLL + char const* qpdf_get_error_filename(qpdf_data q, qpdf_error e); + QPDF_DLL + unsigned long long qpdf_get_error_file_position(qpdf_data q, qpdf_error e); + QPDF_DLL + char const* qpdf_get_error_message_detail(qpdf_data q, qpdf_error e); + + /* By default, warnings are written to stderr. Passing true to + * this function will prevent warnings from being written to + * stderr. They will still be available by calls to + * qpdf_next_warning. + */ + QPDF_DLL + void qpdf_set_suppress_warnings(qpdf_data qpdf, QPDF_BOOL value); + + /* READ FUNCTIONS */ + + /* READ PARAMETER FUNCTIONS -- must be called before qpdf_read */ + + QPDF_DLL + void qpdf_set_ignore_xref_streams(qpdf_data qpdf, QPDF_BOOL value); + + QPDF_DLL + void qpdf_set_attempt_recovery(qpdf_data qpdf, QPDF_BOOL value); + + /* Calling qpdf_read causes processFile to be called in the C++ + * API. Basic parsing is performed, but data from the file is + * only read as needed. For files without passwords, pass a null + * pointer as the password. + */ + QPDF_DLL + QPDF_ERROR_CODE qpdf_read(qpdf_data qpdf, char const* filename, + char const* password); + + /* Calling qpdf_read_memory causes processMemoryFile to be called + * in the C++ API. Otherwise, it behaves in the same way as + * qpdf_read. The description argument will be used in place of + * the file name in any error or warning messages generated by the + * library. + */ + QPDF_DLL + QPDF_ERROR_CODE qpdf_read_memory(qpdf_data qpdf, + char const* description, + char const* buffer, + unsigned long long size, + char const* password); + + /* Read functions below must be called after qpdf_read or + * qpdf_read_memory. */ + + /* + * NOTE: Functions that return char* are returning a pointer to an + * internal buffer that will be reused for each call to a function + * that returns a char*. You must use or copy the value before + * calling any other qpdf library functions. + */ + + /* Return the version of the PDF file. See warning above about + * functions that return char*. */ + QPDF_DLL + char const* qpdf_get_pdf_version(qpdf_data qpdf); + + /* Return the user password. If the file is opened using the + * owner password, the user password may be retrieved using this + * function. If the file is opened using the user password, this + * function will return that user password. See warning above + * about functions that return char*. + */ + QPDF_DLL + char const* qpdf_get_user_password(qpdf_data qpdf); + + /* Return the string value of a key in the document's Info + * dictionary. The key parameter should include the leading + * slash, e.g. "/Author". If the key is not present or has a + * non-string value, a null pointer is returned. Otherwise, a + * pointer to an internal buffer is returned. See warning above + * about functions that return char*. + */ + QPDF_DLL + char const* qpdf_get_info_key(qpdf_data qpdf, char const* key); + + /* Set a value in the info dictionary, possibly replacing an + * existing value. The key must include the leading slash + * (e.g. "/Author"). Passing a null pointer as a value will + * remove the key from the info dictionary. Otherwise, a copy + * will be made of the string that is passed in. + */ + QPDF_DLL + void qpdf_set_info_key(qpdf_data qpdf, char const* key, char const* value); + + /* Indicate whether the input file is linearized. */ + QPDF_DLL + QPDF_BOOL qpdf_is_linearized(qpdf_data qpdf); + + /* Indicate whether the input file is encrypted. */ + QPDF_DLL + QPDF_BOOL qpdf_is_encrypted(qpdf_data qpdf); + + QPDF_DLL + QPDF_BOOL qpdf_allow_accessibility(qpdf_data qpdf); + QPDF_DLL + QPDF_BOOL qpdf_allow_extract_all(qpdf_data qpdf); + QPDF_DLL + QPDF_BOOL qpdf_allow_print_low_res(qpdf_data qpdf); + QPDF_DLL + QPDF_BOOL qpdf_allow_print_high_res(qpdf_data qpdf); + QPDF_DLL + QPDF_BOOL qpdf_allow_modify_assembly(qpdf_data qpdf); + QPDF_DLL + QPDF_BOOL qpdf_allow_modify_form(qpdf_data qpdf); + QPDF_DLL + QPDF_BOOL qpdf_allow_modify_annotation(qpdf_data qpdf); + QPDF_DLL + QPDF_BOOL qpdf_allow_modify_other(qpdf_data qpdf); + QPDF_DLL + QPDF_BOOL qpdf_allow_modify_all(qpdf_data qpdf); + + /* WRITE FUNCTIONS */ + + /* Set up for writing. No writing is actually performed until the + * call to qpdf_write(). + */ + + /* Supply the name of the file to be written and initialize the + * qpdf_data object to handle writing operations. This function + * also attempts to create the file. The PDF data is not written + * until the call to qpdf_write. qpdf_init_write may be called + * multiple times for the same qpdf_data object. When + * qpdf_init_write is called, all information from previous calls + * to functions that set write parameters (qpdf_set_linearization, + * etc.) is lost, so any write parameter functions must be called + * again. + */ + QPDF_DLL + QPDF_ERROR_CODE qpdf_init_write(qpdf_data qpdf, char const* filename); + + /* Initialize for writing but indicate that the PDF file should be + * written to memory. Call qpdf_get_buffer_length and + * qpdf_get_buffer to retrieve the resulting buffer. The memory + * containing the PDF file will be destroyed when qpdf_cleanup is + * called. + */ + QPDF_DLL + QPDF_ERROR_CODE qpdf_init_write_memory(qpdf_data qpdf); + + /* Retrieve the buffer used if the file was written to memory. + * qpdf_get_buffer returns a null pointer if data was not written + * to memory. The memory is freed when qpdf_cleanup is called or + * if a subsequent call to qpdf_init_write or + * qpdf_init_write_memory is called. */ + QPDF_DLL + size_t qpdf_get_buffer_length(qpdf_data qpdf); + QPDF_DLL + unsigned char const* qpdf_get_buffer(qpdf_data qpdf); + + QPDF_DLL + void qpdf_set_object_stream_mode(qpdf_data qpdf, + enum qpdf_object_stream_e mode); + + QPDF_DLL + void qpdf_set_stream_data_mode(qpdf_data qpdf, + enum qpdf_stream_data_e mode); + + QPDF_DLL + void qpdf_set_content_normalization(qpdf_data qpdf, QPDF_BOOL value); + + QPDF_DLL + void qpdf_set_qdf_mode(qpdf_data qpdf, QPDF_BOOL value); + + /* Never use qpdf_set_static_ID except in test suites to suppress + * generation of a random /ID. + */ + QPDF_DLL + void qpdf_set_static_ID(qpdf_data qpdf, QPDF_BOOL value); + + /* Never use qpdf_set_static_aes_IV except in test suites to + * create predictable AES encrypted output. + */ + QPDF_DLL + void qpdf_set_static_aes_IV(qpdf_data qpdf, QPDF_BOOL value); + + QPDF_DLL + void qpdf_set_suppress_original_object_IDs( + qpdf_data qpdf, QPDF_BOOL value); + + QPDF_DLL + void qpdf_set_preserve_encryption(qpdf_data qpdf, QPDF_BOOL value); + + QPDF_DLL + void qpdf_set_r2_encryption_parameters( + qpdf_data qpdf, char const* user_password, char const* owner_password, + QPDF_BOOL allow_print, QPDF_BOOL allow_modify, + QPDF_BOOL allow_extract, QPDF_BOOL allow_annotate); + + QPDF_DLL + void qpdf_set_r3_encryption_parameters( + qpdf_data qpdf, char const* user_password, char const* owner_password, + QPDF_BOOL allow_accessibility, QPDF_BOOL allow_extract, + enum qpdf_r3_print_e print, enum qpdf_r3_modify_e modify); + + QPDF_DLL + void qpdf_set_r4_encryption_parameters( + qpdf_data qpdf, char const* user_password, char const* owner_password, + QPDF_BOOL allow_accessibility, QPDF_BOOL allow_extract, + enum qpdf_r3_print_e print, enum qpdf_r3_modify_e modify, + QPDF_BOOL encrypt_metadata, QPDF_BOOL use_aes); + + QPDF_DLL + void qpdf_set_linearization(qpdf_data qpdf, QPDF_BOOL value); + + QPDF_DLL + void qpdf_set_minimum_pdf_version(qpdf_data qpdf, char const* version); + + QPDF_DLL + void qpdf_force_pdf_version(qpdf_data qpdf, char const* version); + + /* Do actual write operation. */ + QPDF_DLL + QPDF_ERROR_CODE qpdf_write(qpdf_data qpdf); + +#ifdef __cplusplus +} +#endif + + +#endif /* __QPDF_C_H__ */ diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..a9244eb --- /dev/null +++ b/install-sh @@ -0,0 +1,527 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2011-01-19.21; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for `test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/ispell-words b/ispell-words new file mode 100644 index 0000000..51f70a1 --- /dev/null +++ b/ispell-words @@ -0,0 +1,1207 @@ +aaa +ab +abc +ABCD +abcde +abcdefABCDEF +abcdefghijklmnopqrstuvwxyz +ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi +abÏ +abs +abuild +ac +accessor +aclocal +AcroForm +acroread +activatePipelineStack +ActiveState +acyclic +addPage +addPageAt +addPageContents +addToTable +adjustAESStreamLength +admon +Adobeâ +aes +AESv +ageneration +AHx +AIX +alloc +allocator +allowAccessibility +allowExtractAll +allowModifyAll +allowModifyAnnotation +allowModifyAssembly +allowModifyForm +allowModifyOther +allowPoundAnywhereInName +allowPrintHighRes +allowPrintLowRes +antivirus +aobjid +apexcovantage +API +APIs +appendItem +appendString +arg +argc +argv +arko +arko's +ArtBox +ascii +asciiHex +ASCIIHexDecode +ASCIIHexDecoder +assertArray +assertBool +assertDictionary +assertIndirect +assertInitialized +assertInteger +assertName +assertNull +assertNumber +assertPageObject +assertReal +assertReserved +assertScalar +assertStream +assertString +assertType +assignCompressedObjectNumbers +atof +atoi +AuthEvent +autobuilder +autoconf +autogen +autoheader +autolabel +automake +autotools +backref +backreference +backrefs +badLength +BADMAGIC +BADOPTION +BaseFont +basename +Berkenbilt +betweenTokens +binmode +BitsPerComponent +bitstream +BitStream +BitWriter +BleedBox +boldseq +bookinfo +bool +bp +bs +BT +buf +BufferInputSource +buflen +bufpl +bufsize +BUGREPORT +buildrules +bw +bytesNeeded +calculateHOutline +calculateHPageOffset +calculateHSharedObject +calculateLinearizationData +calculateXrefStreamPadding +callHello +CAPTURECOUNT +cbc +cc +ccase +CCF +CCITTFaxDecode +cd +cdict +ce +cerr +cf +CFM +ch +ChangeLog +Checkboxes +checkDataChecksum +checkError +checkFileChecksum +checkHOutlines +checkHPageOffset +checkHSharedObject +checkLinearization +checkLinearizationInternal +checkPageContents +checkUnread +CHGeneric +cho +CHPageOffset +CHPageOffsetEntry +CHSharedObject +CHSharedObjectEntry +CHSomething +ciphertext +cl +classname +clearPipelineStack +cleartext +closeObject +cmd +codepoint +ColorSpace +com +compareVersions +compatbility +concat +Cond +config +const +contrib +CopiedStreamDataProvider +copyEncryptionParameters +copyForeign +copyForeignObject +cout +CoVantage +cp +cph +cphe +cplusplus +CPPFLAGS +cr +createPageContents +createWhat +CreationDate +CRNL +CropBox +CryptFilterDecodeParms +cso +csoe +css +cstr +cstring +ctest +ctype +cygwin +daae +DCT +DCTDecode +ddd +de +debian +declspec +DecodeParms +decodeRow +decodeStreams +decrypt +decrypted +decrypter +decrypting +decryptStream +decryptString +def +deflateEnd +deflateInit +defq +delphi +dereference +dereferenced +dest +DESTDIR +detecet +DeviceGray +DeviceRGB +dict +diff +diffs +diffutils +DIR +dirname +disableCBC +disableIncompatibleEncryption +dist +distclean +dlfcn +DLL +DLL's +dllexport +dlls +DLLs +docbook +DOCBOOKX +docdir +DocOpen +DOCTYPE +doubleBoxSize +DTD +dtdvalid +dumpHGeneric +dumpHPageOffset +dumpHSharedObject +dumpInfoDict +dumpLinearizationDataInternal +dwHighDateTime +dwLowDateTime +DWORD +earlychange +EarlyChange +EF +EFF +efgh +EI +elif +elt +EmbeddedFiles +emptyPDF +en +encodeDataIncrementally +encodeFile +encodeRow +encodeString +EncryptionData +EncryptionParameters +EncryptMetadata +endian +endif +endl +endobj +endpos +endstream +enqueue +enqueueing +enqueueObject +enqueuePart +enqueues +enqueuing +enum +env +envar +eod +eof +eol +epub +eraseItem +Erdelsky's +errno +erroffset +errptr +esize +exc +exe +exp +extern +fb +fBqpdf +fclose +fcntl +fd +ferror +FF +ffff +fflush +fghij +fi +fI +fIinfilename +fileinfo +FileInputSource +fileno +filenow +filep +FILETIME +filetrailer +filterCompressedObjects +findAndSkipNextEOL +findPage +fIoptions +fIoutfilename +firstname +firstterm +fl +flate +FlateDecode +flattenPagesTree +flattenScalarReferences +fn +fname +fo +fopen +forcePDFVersion +fprintf +fR +fread +fseek +fseeki +fseeko +ftell +ftelli +ftello +fullinfo +fullpad +func +fwrite +GajiÄ +gcc +gen +generateHintStream +generateID +generateObjectStreams +genok +getAllPages +getAllPagesInternal +getArrayAsVector +getArrayItem +getArrayNItems +getAsArray +getAsMap +getAsVector +getBits +getBoolValue +getBuffer +getCompressibleObjects +getCount +getDataChecksum +getDict +getDictAsMap +getenv +GetEnvironmentVariable +getErrorCode +getErrorMessage +getFileChecksum +getFilename +getFilePosition +getFirstChar +getGeneration +getHexDigest +getIntValue +getItem +getKey +getKeyForObject +getKeys +getLastChar +getLastOffset +getLength +getLinearizationOffset +getLinearizedParts +getMatch +getMessageDetail +getName +getNext +getNItems +getNumericValue +getObject +getObjectByID +getObjectID +getObjectStreamData +getObjStreamIndex +getObjStreamNumber +getOffset +getOffsetLength +getOwningQPDF +getPaddedUserPassword +getPageContents +getPageImages +getPDFVersion +getPointer +getRawStreamData +getRawValue +getRealValue +getRefcount +getRoot +getSize +getStreamData +getStringValue +GetSystemTime +getToken +getTrailer +getTrimmedUserPassword +getTrimmedUserPassword's +getType +GETU +getUncompressedObject +getUserPassword +getUTF +getVal +getValue +getWarnings +getWhoami +GG +ghostscript +GhostScript +github +glerbl +glibc +gm +grayscale +gt +GUIs +gz +gzip +HAGOOGAMAGOOGLE +handleCode +handleData +hasKey +hb +hbp +Hdict +Helvetica +hexkey +hexkeylen +hexstring +hexstrings +HGeneric +hh +HighPart +hlen +Hoffmann +HOi +HPageOffset +HPageOffsetEntry +href +HS +HSharedObject +HSharedObjectEntry +HSi +HSomething +HSomethingEntry +htm +html +http +https +ic +icc +iconv +IDs +idx +ifdef +ifeq +iff +ifndef +Im +ImageC +ImageChecker +ImageInverter +ImageMask +ImageProvider +inbuf +INDOC +indx +inf +infile +infilename +inflateEnd +inflateInit +inflateReset +init +initializeEncryption +initializePipelineStack +initializeSpecialStreams +initializeVector +inline +inode +inputLen +InputSource +insertItem +insertPage +insertPageobjToPage +insertXrefEntry +inst +int +interpretCF +interpretR +ints +inttypes +inv +inverter +io +IOLBF +iostream +isArray +isBool +isDictionary +isdigit +isEncrypted +isIndirect +isInitialized +isInteger +isLinearized +isName +isNull +isNumber +iso +isOrHasName +isPageObject +isPagesObject +ispell +isReal +isReserved +isScalar +isspace +isStream +isString +istype +italicseq +itemizedlist +iter +ith +Jian +jklmnopqrstuvwxyz +keybits +keylen +KEYLENGTH +LARGEFILE +lastnum +lastreleased +latin +lbuf +lc +ld +LDFLAGS +ldquo +len +lengthNextN +Lexer +lhs +libgcc +libqpdf +libs +libtests +libtiff +libtool +libtool's +libtoolize +libtools +libz +lin +lindict +linearization +linearize +linearized +linearizing +linefeeds +linkend +linkey +linp +LinParameters +linux +listitem +ll +lld +lookup +lossy +LowPart +lpcre +lqpdf +lsb +lt +ltmain +lu +lval +lx +lz +lzw +LZWDecode +LZWDecoder +m'qpdf +makeDirect +makeDirectInternal +Makefile +makeIndirectObject +malloc +manualFinish +maxEnd +maxval +md +mdash +MDd +mediabox +MediaBox +MEM +Memcheck +memchr +memcmp +memcpy +memmove +memset +merchantability +metadata +min +mingw +MinGW +MINGW's +mins +misc +MixColumn +mk +mkinstalldirs +monoseq +MSC +msg +msvc +MSVC's +msys +multibyte +multithreaded +Mutator +mutators +mv +nbackrefs +nbits +nbsp +nbytes +nch +ndash +nendobj +nendstream +newArray +newBool +NewDict +newDictionary +newIndirect +newInteger +newName +newNull +newpage +newpdf +newReal +newReserved +newStream +newString +nfirst +nitems +nl +nmatches +nMatches +NoBackref +nobjects +NOMATCH +NOMEMORY +nonprintable +noout +normalizeName +normalizer +npages +npos +nrounds +nshared +nspaces +nstream +nstripes +ntotal +NUL +num +numrange +nval +nwalsh +obj +ObjAccessor +ObjCache +ObjCopier +OBJDIR +ObjectHolder +ObjGen +ObjGens +objGenToIndirect +objid +objidok +objok +ObjStm +ObjUser +objusers +oc +og +ogs +oiter +okey +ol +olist +omap +op +OpenAction +openObject +opensource +ord +org +orig +orred +os +ostream +ostringstream +OtherPage +ou +ous +outbuf +OUTDOC +outfile +outfilename +outputLengthNextN +ovecsize +ovector +padLen +Paeth +pagemode +PageMode +pageno +pageobj +PageSpec +para +param +parms +parseInternal +parseVersion +partLen +pathsep +Pavlyuk +pb +pbytes +pcre +pcreapi +pdf +PDFâ +pdfDumpInfoDict +PDFS +pdlin +pe +perl +ph +phe +php +pipeStreamData +pipeStringAndFinish +Pkey +PKI +pl +plaintext +png +PNGFilter +pngify +PointerHolder +popPipelineStack +pos +POSIX +PP +pre +precompiled +prefilering +prefiltering +presentCharacter +presentEOF +preserveObjectStreams +prev +printability +printf +processChar +processFile +processMemoryFile +processRow +processXRefStream +procset +ProcSet +procsets +programlisting +provideStreamData +PSâ +pt +pthread +ptr +pushDiscardFilter +pushEncryptionFilter +pushInheritedAttributesToPage +pushInheritedAttributesToPageInternal +pushOutlinesToPart +pushPipeline +PUTU +qarray +QArray +qdf +QDFObject +QDFWriter +qdict +QDict +QEXC +qnumbers +QNumbers +qpdf +qpdf's +QPDF's +QPDFCONSTANTS +QPDFExc +QPDFObject +QPDFObjectHandle +QPDFObjectTypeAccessor +QPDFPageData +qpdfs +QPDFStream +QPDFTokenizer +QPDFTYPES +QPDFVersion +QPDFWriter +QPDFXRefEntry +qqqcqqq +qstream +QStream +QStreams +qstrings +QStrings +QTC +qtest +QTest +QuadPart +QUtil +qwert +rand +rb +rbegin +rc +rcon +RDONLY +rdquo +readHGeneric +readHintStream +readHPageOffset +readHSharedObject +readLine +readLinearizationData +README +readObject +readObjectAtOffset +readToken +reattached +recompress +recompressing +recomputation +recoverStreamLength +refcount +refpage +refpos +regexp +registerForeignStream +releaseResolved +ReleaseResolver +remotesensing +removeKey +removePage +repl +replaceDict +replaceFilterData +replaceForeignIndirectObjects +replaceKey +replaceObject +replaceOrRemoveKey +replaceReserved +replaceStreamData +reserveObjects +resolveObjectsInStream +retargeted +retested +reverseResolved +rf +rfont +rhs +rijndael +rijndaelDecrypt +rijndaelEncrypt +rijndaelSetupDecrypt +rijndaelSetupEncrypt +rk +Rkey +RKLENGTH +RL +rm +roundoff +RSA +rstream +RStream +RunLengthDecode +runtest +sAlT +se +sed +seekable +sendNextCode +sep +seq +serif +setArrayFromVector +setArrayItem +setAttemptRecovery +setContentNormalization +setDataKey +setEncryptionParameters +setEncryptionParametersInternal +setFile +setFilename +setFromVector +setIgnoreXRefStreams +setItem +setLastObjectDescription +setLastOffset +setLinearization +setLineBuf +setMinimumPDFVersion +setmode +setObjectStreamMode +setObjGen +setOutputFile +setOutputFilename +setOutputMemory +setOutputStreams +setPreserveEncryption +setQDFMode +setR +setStaticAesIV +setStaticID +setStreamDataMode +setSuppressOriginalObjectIDs +setSuppressWarnings +setTrailer +setvbuf +shallowCopy +showLinearizationData +showXRefTable +sizeof +skipToNextByte +soe +sourceforge +SourceForge +sprintf +srand +srandom +src +sstream +startoffset +startxref +stat +std +STDC +StdCF +stderr +stdexcept +stdin +stdint +StdioFile +stdlib +stdout +STL +StmF +str +strchr +strcmp +strcpy +StreamDataProvider +strerror +StrF +StringDecrypter +stripesize +strlen +strncmp +stronghorse +strrchr +strstr +strtoi +strtol +strtoll +struct +stylesheet +stylesheets +subclasses +SubFilter +SubFilters +Subramanyam +substr +substring +Subtype +supp +suppressions +swapObjects +swversion +Symlink +sys +sysnow +SYSTEMTIME +SystemTimeToFileTime +TARNAME +tbuf +tc +Td +Te +TESTSUITE +Tf +tgen +th +Tj +tmp +tnum +Tobias +tobj +tobjid +TODO +toffset +tokenized +tokenizer +tokenizing +toolchain +Toolchains +toupper +toUTF +TrimBox +trimTrailerForWrite +tt +txt +uc +udata +uinow +uint +uiter +UL +ULARGE +ulink +uLong +ULONGLONG +uncompresesd +uncompress +uncompressing +undef +unencrypted +unfilterable +ungetc +unicode +uninstalled +unistd +unlink +unlinked +unparse +unparseChild +unparseObject +unparseResolved +unreadCh +unreferenced +unresolvable +unretrieved +upass +updateAllPagesCache +updateObjectMaps +updateObjectMapsInternal +updatePagesCache +url +UseOutlines +useStaticIV +USLetter +usr +utf +Util +utils +uval +val +valgrind +valstr +var +variablelist +varlistentry +varname +vc +vec +vecs +VER +viewable +ViewerPreferences +Vitaliy +Vkey +vlen +voidpf +vvv +wb +werror +whoami +WinAnsiEncoding +writeBinary +writeBits +writeBuffer +writeEncryptionDictionary +writeHeader +writeHGeneric +writeHintStream +writeHPageOffset +writeHSharedObject +writeLinearized +writeNext +writeObject +writeObjectStream +writeObjectStreamOffsets +writePad +writeStandard +writeString +writeStringNoQDF +writeStringQDF +writeToken +writeTrailer +writeXRefStream +writeXRefTable +www +wxWindows +xA +xa +xABUL +xbebfbc +xbf +xc +xD +xDC +xeaa +xefcdab +xF +xf +xFC +xfcefa +xfde +xfe +xff +xffeff +xfffa +xfffe +xgen +xhtml +xml +XMLLINT +xmlns +xobj +xobject +XObject +xor +xpacket +xpdf +XRef +xref +XRefStm +xrefStream +xrefTable +xsl +XSLTPROC +XXX +yn +yuiop +yyyymmdd +z's +zalloc +zdata +Zeroize +zeroizing +zfree +zlib +zstream +zzzzz +zzzzzz diff --git a/libqpdf.map b/libqpdf.map new file mode 100644 index 0000000..857f56c --- /dev/null +++ b/libqpdf.map @@ -0,0 +1,4 @@ +LIBQPDF_8 { + global: + *; +}; diff --git a/libqpdf.pc.in b/libqpdf.pc.in new file mode 100644 index 0000000..c765900 --- /dev/null +++ b/libqpdf.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libqpdf +Description: PDF transformation library +Version: @PACKAGE_VERSION@ +Libs: -L${libdir} -lqpdf +Cflags: -I${includedir} diff --git a/libqpdf/BitStream.cc b/libqpdf/BitStream.cc new file mode 100644 index 0000000..eb511f7 --- /dev/null +++ b/libqpdf/BitStream.cc @@ -0,0 +1,44 @@ +#include + +// See comments in bits.cc +#define BITS_READ 1 +#include "bits.icc" + +BitStream::BitStream(unsigned char const* p, int nbytes) : + start(p), + nbytes(nbytes) +{ + reset(); +} + +void +BitStream::reset() +{ + p = start; + bit_offset = 7; + bits_available = 8 * nbytes; +} + +unsigned long long +BitStream::getBits(int nbits) +{ + return read_bits(this->p, this->bit_offset, + this->bits_available, nbits); +} + +void +BitStream::skipToNextByte() +{ + if (bit_offset != 7) + { + unsigned int bits_to_skip = bit_offset + 1; + if (bits_available < bits_to_skip) + { + throw std::logic_error( + "INTERNAL ERROR: overflow skipping to next byte in bitstream"); + } + bit_offset = 7; + ++p; + bits_available -= bits_to_skip; + } +} diff --git a/libqpdf/BitWriter.cc b/libqpdf/BitWriter.cc new file mode 100644 index 0000000..4fb375c --- /dev/null +++ b/libqpdf/BitWriter.cc @@ -0,0 +1,28 @@ +#include + +// See comments in bits.cc +#define BITS_WRITE 1 +#include "bits.icc" + +BitWriter::BitWriter(Pipeline* pl) : + pl(pl), + ch(0), + bit_offset(7) +{ +} + +void +BitWriter::writeBits(unsigned long long val, unsigned int bits) +{ + write_bits(this->ch, this->bit_offset, val, bits, this->pl); +} + +void +BitWriter::flush() +{ + if (bit_offset < 7) + { + int bits_to_write = bit_offset + 1; + write_bits(this->ch, this->bit_offset, 0, bits_to_write, this->pl); + } +} diff --git a/libqpdf/Buffer.cc b/libqpdf/Buffer.cc new file mode 100644 index 0000000..94e69a5 --- /dev/null +++ b/libqpdf/Buffer.cc @@ -0,0 +1,94 @@ +#include + +#include + +Buffer::Buffer() +{ + init(0, 0, true); +} + +Buffer::Buffer(size_t size) +{ + init(size, 0, true); +} + +Buffer::Buffer(unsigned char* buf, size_t size) +{ + init(size, buf, false); +} + +Buffer::Buffer(Buffer const& rhs) +{ + init(0, 0, true); + copy(rhs); +} + +Buffer& +Buffer::operator=(Buffer const& rhs) +{ + copy(rhs); + return *this; +} + +Buffer::~Buffer() +{ + destroy(); +} + +void +Buffer::init(size_t size, unsigned char* buf, bool own_memory) +{ + this->own_memory = own_memory; + this->size = size; + if (own_memory) + { + this->buf = (size ? new unsigned char[size] : 0); + } + else + { + this->buf = buf; + } +} + +void +Buffer::copy(Buffer const& rhs) +{ + if (this != &rhs) + { + this->destroy(); + this->init(rhs.size, 0, true); + if (this->size) + { + memcpy(this->buf, rhs.buf, this->size); + } + } +} + +void +Buffer::destroy() +{ + if (this->own_memory) + { + delete [] this->buf; + } + this->size = 0; + this->buf = 0; +} + +size_t +Buffer::getSize() const +{ + return this->size; +} + +unsigned char const* +Buffer::getBuffer() const +{ + return this->buf; +} + +unsigned char* +Buffer::getBuffer() +{ + return this->buf; +} diff --git a/libqpdf/BufferInputSource.cc b/libqpdf/BufferInputSource.cc new file mode 100644 index 0000000..0343995 --- /dev/null +++ b/libqpdf/BufferInputSource.cc @@ -0,0 +1,153 @@ +#include +#include +#include + +BufferInputSource::BufferInputSource(std::string const& description, + Buffer* buf, bool own_memory) : + own_memory(own_memory), + description(description), + buf(buf), + cur_offset(0) +{ +} + +BufferInputSource::BufferInputSource(std::string const& description, + std::string const& contents) : + own_memory(true), + description(description), + buf(0), + cur_offset(0) +{ + this->buf = new Buffer(contents.length()); + unsigned char* bp = buf->getBuffer(); + memcpy(bp, (char*)contents.c_str(), contents.length()); +} + +BufferInputSource::~BufferInputSource() +{ + if (own_memory) + { + delete this->buf; + } +} + +qpdf_offset_t +BufferInputSource::findAndSkipNextEOL() +{ + if (this->cur_offset < 0) + { + throw std::logic_error("INTERNAL ERROR: BufferInputSource offset < 0"); + } + qpdf_offset_t end_pos = (qpdf_offset_t) this->buf->getSize(); + if (this->cur_offset >= end_pos) + { + this->last_offset = end_pos; + this->cur_offset = end_pos; + return end_pos; + } + + qpdf_offset_t result = 0; + size_t len = (size_t)(end_pos - this->cur_offset); + unsigned char const* buffer = this->buf->getBuffer(); + + void* start = (void*)(buffer + this->cur_offset); + unsigned char* p1 = (unsigned char*)memchr(start, '\r', len); + unsigned char* p2 = (unsigned char*)memchr(start, '\n', len); + unsigned char* p = (p1 && p2) ? std::min(p1, p2) : p1 ? p1 : p2; + if (p) + { + result = p - buffer; + this->cur_offset = result + 1; + ++p; + while ((this->cur_offset < end_pos) && + ((*p == '\r') || (*p == '\n'))) + { + ++p; + ++this->cur_offset; + } + } + else + { + this->cur_offset = end_pos; + result = end_pos; + } + return result; +} + +std::string const& +BufferInputSource::getName() const +{ + return this->description; +} + +qpdf_offset_t +BufferInputSource::tell() +{ + return this->cur_offset; +} + +void +BufferInputSource::seek(qpdf_offset_t offset, int whence) +{ + switch (whence) + { + case SEEK_SET: + this->cur_offset = offset; + break; + + case SEEK_END: + this->cur_offset = (qpdf_offset_t)this->buf->getSize() + offset; + break; + + case SEEK_CUR: + this->cur_offset += offset; + break; + + default: + throw std::logic_error( + "INTERNAL ERROR: invalid argument to BufferInputSource::seek"); + break; + } + + if (this->cur_offset < 0) + { + throw std::runtime_error( + this->description + ": seek before beginning of buffer"); + } +} + +void +BufferInputSource::rewind() +{ + this->cur_offset = 0; +} + +size_t +BufferInputSource::read(char* buffer, size_t length) +{ + if (this->cur_offset < 0) + { + throw std::logic_error("INTERNAL ERROR: BufferInputSource offset < 0"); + } + qpdf_offset_t end_pos = (qpdf_offset_t) this->buf->getSize(); + if (this->cur_offset >= end_pos) + { + this->last_offset = end_pos; + return 0; + } + + this->last_offset = this->cur_offset; + size_t len = std::min((size_t)(end_pos - this->cur_offset), length); + memcpy(buffer, buf->getBuffer() + this->cur_offset, len); + this->cur_offset += len; + return len; +} + +void +BufferInputSource::unreadCh(char ch) +{ + if (this->cur_offset > 0) + { + --this->cur_offset; + } +} diff --git a/libqpdf/FileInputSource.cc b/libqpdf/FileInputSource.cc new file mode 100644 index 0000000..b1f7b5d --- /dev/null +++ b/libqpdf/FileInputSource.cc @@ -0,0 +1,141 @@ +#include +#include +#include +#include + +FileInputSource::FileInputSource() : + close_file(false), + file(0) +{ +} + +void +FileInputSource::setFilename(char const* filename) +{ + destroy(); + this->filename = filename; + this->close_file = true; + this->file = QUtil::fopen_wrapper(std::string("open ") + this->filename, + fopen(this->filename.c_str(), "rb")); +} + +void +FileInputSource::setFile( + char const* description, FILE* filep, bool close_file) +{ + destroy(); + this->filename = description; + this->close_file = close_file; + this->file = filep; + this->seek(0, SEEK_SET); +} + +FileInputSource::~FileInputSource() +{ + destroy(); +} + +void +FileInputSource::destroy() +{ + if (this->file && this->close_file) + { + fclose(this->file); + this->file = 0; + } +} + +qpdf_offset_t +FileInputSource::findAndSkipNextEOL() +{ + qpdf_offset_t result = 0; + bool done = false; + char buf[10240]; + while (! done) + { + qpdf_offset_t cur_offset = QUtil::tell(this->file); + size_t len = this->read(buf, sizeof(buf)); + if (len == 0) + { + done = true; + result = this->tell(); + } + else + { + char* p1 = (char*)memchr((void*)buf, '\r', len); + char* p2 = (char*)memchr((void*)buf, '\n', len); + char* p = (p1 && p2) ? std::min(p1, p2) : p1 ? p1 : p2; + if (p) + { + result = cur_offset + (p - buf); + // We found \r or \n. Keep reading until we get past + // \r and \n characters. + this->seek(result + 1, SEEK_SET); + char ch; + while (! done) + { + if (this->read(&ch, 1) == 0) + { + done = true; + } + else if (! ((ch == '\r') || (ch == '\n'))) + { + this->unreadCh(ch); + done = true; + } + } + } + } + } + return result; +} + +std::string const& +FileInputSource::getName() const +{ + return this->filename; +} + +qpdf_offset_t +FileInputSource::tell() +{ + return QUtil::tell(this->file); +} + +void +FileInputSource::seek(qpdf_offset_t offset, int whence) +{ + QUtil::os_wrapper(std::string("seek to ") + this->filename + ", offset " + + QUtil::int_to_string(offset) + " (" + + QUtil::int_to_string(whence) + ")", + QUtil::seek(this->file, offset, whence)); +} + +void +FileInputSource::rewind() +{ + ::rewind(this->file); +} + +size_t +FileInputSource::read(char* buffer, size_t length) +{ + this->last_offset = QUtil::tell(this->file); + size_t len = fread(buffer, 1, length, this->file); + if ((len == 0) && ferror(this->file)) + { + throw QPDFExc(qpdf_e_system, + this->filename, "", + this->last_offset, + std::string("read ") + + QUtil::int_to_string(length) + " bytes"); + } + return len; +} + +void +FileInputSource::unreadCh(char ch) +{ + QUtil::os_wrapper(this->filename + ": unread character", + ungetc((unsigned char)ch, this->file)); +} diff --git a/libqpdf/InputSource.cc b/libqpdf/InputSource.cc new file mode 100644 index 0000000..79c889b --- /dev/null +++ b/libqpdf/InputSource.cc @@ -0,0 +1,41 @@ +#include +#include +#include + +void +InputSource::setLastOffset(qpdf_offset_t offset) +{ + this->last_offset = offset; +} + +qpdf_offset_t +InputSource::getLastOffset() const +{ + return this->last_offset; +} + +std::string +InputSource::readLine(size_t max_line_length) +{ + // Return at most max_line_length characters from the next line. + // Lines are terminated by one or more \r or \n characters. + // Consume the trailing newline characters but don't return them. + // After this is called, the file will be positioned after a line + // terminator or at the end of the file, and last_offset will + // point to position the file had when this method was called. + + qpdf_offset_t offset = this->tell(); + char* buf = new char[max_line_length + 1]; + PointerHolder bp(true, buf); + memset(buf, '\0', max_line_length + 1); + this->read(buf, max_line_length); + this->seek(offset, SEEK_SET); + qpdf_offset_t eol = this->findAndSkipNextEOL(); + this->last_offset = offset; + size_t line_length = eol - offset; + if (line_length < max_line_length) + { + buf[line_length] = '\0'; + } + return std::string(buf); +} diff --git a/libqpdf/MD5.cc b/libqpdf/MD5.cc new file mode 100644 index 0000000..70be696 --- /dev/null +++ b/libqpdf/MD5.cc @@ -0,0 +1,440 @@ +// This file implements a class for computation of MD5 checksums. +// It is derived from the reference algorithm for MD5 as given in +// RFC 1321. The original copyright notice is as follows: +// +///////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All +// rights reserved. +// +// License to copy and use this software is granted provided that it +// is identified as the "RSA Data Security, Inc. MD5 Message-Digest +// Algorithm" in all material mentioning or referencing this software +// or this function. +// +// License is also granted to make and use derivative works provided +// that such works are identified as "derived from the RSA Data +// Security, Inc. MD5 Message-Digest Algorithm" in all material +// mentioning or referencing the derived work. +// +// RSA Data Security, Inc. makes no representations concerning either +// the merchantability of this software or the suitability of this +// software for any particular purpose. It is provided "as is" +// without express or implied warranty of any kind. +// +// These notices must be retained in any copies of any part of this +// documentation and/or software. +// +///////////////////////////////////////////////////////////////////////// + +#include +#include + +#include +#include +#include +#include +#include + +int const S11 = 7; +int const S12 = 12; +int const S13 = 17; +int const S14 = 22; +int const S21 = 5; +int const S22 = 9; +int const S23 = 14; +int const S24 = 20; +int const S31 = 4; +int const S32 = 11; +int const S33 = 16; +int const S34 = 23; +int const S41 = 6; +int const S42 = 10; +int const S43 = 15; +int const S44 = 21; + +static unsigned char PADDING[64] = { + 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +// F, G, H and I are basic MD5 functions. +#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) +#define G(x, y, z) (((x) & (z)) | ((y) & (~z))) +#define H(x, y, z) ((x) ^ (y) ^ (z)) +#define I(x, y, z) ((y) ^ ((x) | (~z))) + +// ROTATE_LEFT rotates x left n bits. +#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) + +// FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. +// Rotation is separate from addition to prevent recomputation. +#define FF(a, b, c, d, x, s, ac) { \ + (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define GG(a, b, c, d, x, s, ac) { \ + (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define HH(a, b, c, d, x, s, ac) { \ + (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define II(a, b, c, d, x, s, ac) { \ + (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } + +// MD5 initialization. Begins an MD5 operation, writing a new context. +void MD5::init() +{ + count[0] = count[1] = 0; + // Load magic initialization constants. + state[0] = 0x67452301; + state[1] = 0xefcdab89; + state[2] = 0x98badcfe; + state[3] = 0x10325476; + + finalized = false; + memset(digest_val, 0, sizeof(digest_val)); +} + +// MD5 block update operation. Continues an MD5 message-digest +// operation, processing another message block, and updating the +// context. + +void MD5::update(unsigned char *input, + unsigned int inputLen) +{ + unsigned int i, index, partLen; + + // Compute number of bytes mod 64 + index = (unsigned int)((count[0] >> 3) & 0x3F); + + // Update number of bits + if ((count[0] += ((UINT4)inputLen << 3)) + < ((UINT4)inputLen << 3)) + count[1]++; + count[1] += ((UINT4)inputLen >> 29); + + partLen = 64 - index; + + // Transform as many times as possible. + + if (inputLen >= partLen) { + memcpy + ((POINTER)&buffer[index], (POINTER)input, partLen); + transform(state, buffer); + + for (i = partLen; i + 63 < inputLen; i += 64) + transform(state, &input[i]); + + index = 0; + } + else + i = 0; + + // Buffer remaining input + memcpy + ((POINTER)&buffer[index], (POINTER)&input[i], + inputLen-i); +} + +// MD5 finalization. Ends an MD5 message-digest operation, writing the +// the message digest and zeroizing the context. +void MD5::final() +{ + if (finalized) + { + return; + } + + unsigned char bits[8]; + unsigned int index, padLen; + + // Save number of bits + encode(bits, count, 8); + + // Pad out to 56 mod 64. + + index = (unsigned int)((count[0] >> 3) & 0x3f); + padLen = (index < 56) ? (56 - index) : (120 - index); + update(PADDING, padLen); + + // Append length (before padding) + update(bits, 8); + // Store state in digest_val + encode(digest_val, state, 16); + + // Zeroize sensitive information. + memset(state, 0, sizeof(state)); + memset(count, 0, sizeof(count)); + memset(buffer, 0, sizeof(buffer)); + + finalized = true; +} + +// MD5 basic transformation. Transforms state based on block. +void MD5::transform(UINT4 state[4], unsigned char block[64]) +{ + UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; + + decode(x, block, 64); + + // Round 1 + FF (a, b, c, d, x[ 0], S11, 0xd76aa478); // 1 + FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); // 2 + FF (c, d, a, b, x[ 2], S13, 0x242070db); // 3 + FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); // 4 + FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); // 5 + FF (d, a, b, c, x[ 5], S12, 0x4787c62a); // 6 + FF (c, d, a, b, x[ 6], S13, 0xa8304613); // 7 + FF (b, c, d, a, x[ 7], S14, 0xfd469501); // 8 + FF (a, b, c, d, x[ 8], S11, 0x698098d8); // 9 + FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); // 10 + FF (c, d, a, b, x[10], S13, 0xffff5bb1); // 11 + FF (b, c, d, a, x[11], S14, 0x895cd7be); // 12 + FF (a, b, c, d, x[12], S11, 0x6b901122); // 13 + FF (d, a, b, c, x[13], S12, 0xfd987193); // 14 + FF (c, d, a, b, x[14], S13, 0xa679438e); // 15 + FF (b, c, d, a, x[15], S14, 0x49b40821); // 16 + + // Round 2 + GG (a, b, c, d, x[ 1], S21, 0xf61e2562); // 17 + GG (d, a, b, c, x[ 6], S22, 0xc040b340); // 18 + GG (c, d, a, b, x[11], S23, 0x265e5a51); // 19 + GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); // 20 + GG (a, b, c, d, x[ 5], S21, 0xd62f105d); // 21 + GG (d, a, b, c, x[10], S22, 0x2441453); // 22 + GG (c, d, a, b, x[15], S23, 0xd8a1e681); // 23 + GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); // 24 + GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); // 25 + GG (d, a, b, c, x[14], S22, 0xc33707d6); // 26 + GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); // 27 + GG (b, c, d, a, x[ 8], S24, 0x455a14ed); // 28 + GG (a, b, c, d, x[13], S21, 0xa9e3e905); // 29 + GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); // 30 + GG (c, d, a, b, x[ 7], S23, 0x676f02d9); // 31 + GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); // 32 + + // Round 3 + HH (a, b, c, d, x[ 5], S31, 0xfffa3942); // 33 + HH (d, a, b, c, x[ 8], S32, 0x8771f681); // 34 + HH (c, d, a, b, x[11], S33, 0x6d9d6122); // 35 + HH (b, c, d, a, x[14], S34, 0xfde5380c); // 36 + HH (a, b, c, d, x[ 1], S31, 0xa4beea44); // 37 + HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); // 38 + HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); // 39 + HH (b, c, d, a, x[10], S34, 0xbebfbc70); // 40 + HH (a, b, c, d, x[13], S31, 0x289b7ec6); // 41 + HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); // 42 + HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); // 43 + HH (b, c, d, a, x[ 6], S34, 0x4881d05); // 44 + HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); // 45 + HH (d, a, b, c, x[12], S32, 0xe6db99e5); // 46 + HH (c, d, a, b, x[15], S33, 0x1fa27cf8); // 47 + HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); // 48 + + // Round 4 + II (a, b, c, d, x[ 0], S41, 0xf4292244); // 49 + II (d, a, b, c, x[ 7], S42, 0x432aff97); // 50 + II (c, d, a, b, x[14], S43, 0xab9423a7); // 51 + II (b, c, d, a, x[ 5], S44, 0xfc93a039); // 52 + II (a, b, c, d, x[12], S41, 0x655b59c3); // 53 + II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); // 54 + II (c, d, a, b, x[10], S43, 0xffeff47d); // 55 + II (b, c, d, a, x[ 1], S44, 0x85845dd1); // 56 + II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); // 57 + II (d, a, b, c, x[15], S42, 0xfe2ce6e0); // 58 + II (c, d, a, b, x[ 6], S43, 0xa3014314); // 59 + II (b, c, d, a, x[13], S44, 0x4e0811a1); // 60 + II (a, b, c, d, x[ 4], S41, 0xf7537e82); // 61 + II (d, a, b, c, x[11], S42, 0xbd3af235); // 62 + II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); // 63 + II (b, c, d, a, x[ 9], S44, 0xeb86d391); // 64 + + state[0] += a; + state[1] += b; + state[2] += c; + state[3] += d; + + // Zeroize sensitive information. + + memset ((POINTER)x, 0, sizeof (x)); +} + +// Encodes input (UINT4) into output (unsigned char). Assumes len is a +// multiple of 4. +void MD5::encode(unsigned char *output, UINT4 *input, unsigned int len) +{ + unsigned int i, j; + + for (i = 0, j = 0; j < len; i++, j += 4) { + output[j] = (unsigned char)(input[i] & 0xff); + output[j+1] = (unsigned char)((input[i] >> 8) & 0xff); + output[j+2] = (unsigned char)((input[i] >> 16) & 0xff); + output[j+3] = (unsigned char)((input[i] >> 24) & 0xff); + } +} + +// Decodes input (unsigned char) into output (UINT4). Assumes len is a +// multiple of 4. +void MD5::decode(UINT4 *output, unsigned char *input, unsigned int len) +{ + unsigned int i, j; + + for (i = 0, j = 0; j < len; i++, j += 4) + output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) | + (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); +} + +// Public functions + +MD5::MD5() +{ + init(); +} + +void MD5::reset() +{ + init(); +} + +void MD5::encodeString(char const* str) +{ + unsigned int len = (unsigned int)strlen(str); + + update((unsigned char *)str, len); + final(); +} + +void MD5::appendString(char const* input_string) +{ + update((unsigned char *)input_string, (unsigned int) strlen(input_string)); +} + +void MD5::encodeDataIncrementally(char const* data, int len) +{ + update((unsigned char *)data, len); +} + +void MD5::encodeFile(char const *filename, int up_to_size) +{ + unsigned char buffer[1024]; + + FILE *file = QUtil::fopen_wrapper( + std::string("MD5: open ") + filename, + fopen(filename, "rb")); + + size_t len; + int so_far = 0; + int to_try = 1024; + do + { + if ((up_to_size >= 0) && ((so_far + to_try) > up_to_size)) + { + to_try = up_to_size - so_far; + } + len = fread(buffer, 1, to_try, file); + if (len > 0) + { + update(buffer, (unsigned int) len); + so_far += len; + if ((up_to_size >= 0) && (so_far >= up_to_size)) + { + break; + } + } + } while (len > 0); + if (ferror(file)) + { + // Assume, perhaps incorrectly, that errno was set by the + // underlying call to read.... + (void) fclose(file); + QUtil::throw_system_error( + std::string("MD5: read error on ") + filename); + } + (void) fclose(file); + + final(); +} + +void MD5::digest(Digest result) +{ + final(); + memcpy(result, digest_val, sizeof(digest_val)); +} + +void MD5::print() +{ + final(); + + unsigned int i; + for (i = 0; i < 16; ++i) + { + printf("%02x", digest_val[i]); + } + printf("\n"); +} + +std::string MD5::unparse() +{ + final(); + + char result[33]; + char* p = result; + unsigned int i; + for (i = 0; i < 16; ++i) + { + sprintf(p, "%02x", digest_val[i]); + p += 2; + } + return result; +} + +std::string +MD5::getDataChecksum(char const* buf, int len) +{ + MD5 m; + m.encodeDataIncrementally(buf, len); + return m.unparse(); +} + +std::string +MD5::getFileChecksum(char const* filename, int up_to_size) +{ + MD5 m; + m.encodeFile(filename, up_to_size); + return m.unparse(); +} + +bool +MD5::checkDataChecksum(char const* const checksum, + char const* buf, int len) +{ + std::string actual_checksum = getDataChecksum(buf, len); + return (checksum == actual_checksum); +} + +bool +MD5::checkFileChecksum(char const* const checksum, + char const* filename, int up_to_size) +{ + bool result = false; + try + { + std::string actual_checksum = getFileChecksum(filename, up_to_size); + result = (checksum == actual_checksum); + } + catch (std::runtime_error) + { + // Ignore -- return false + } + return result; +} diff --git a/libqpdf/Makefile b/libqpdf/Makefile new file mode 100644 index 0000000..9089905 --- /dev/null +++ b/libqpdf/Makefile @@ -0,0 +1 @@ +include ../make/proxy.mk diff --git a/libqpdf/PCRE.cc b/libqpdf/PCRE.cc new file mode 100644 index 0000000..1e5585b --- /dev/null +++ b/libqpdf/PCRE.cc @@ -0,0 +1,354 @@ +#include +#include + +#include +#include +#include + +PCRE::NoBackref::NoBackref() : + std::logic_error("PCRE error: no match") +{ +} + +PCRE::Match::Match(int nbackrefs, char const* subject) +{ + this->init(-1, nbackrefs, subject); +} + +PCRE::Match::~Match() +{ + this->destroy(); +} + +PCRE::Match::Match(Match const& rhs) +{ + this->copy(rhs); +} + +PCRE::Match& +PCRE::Match::operator=(Match const& rhs) +{ + if (this != &rhs) + { + this->destroy(); + this->copy(rhs); + } + return *this; +} + +void +PCRE::Match::init(int nmatches, int nbackrefs, char const* subject) +{ + this->nmatches = nmatches; + this->nbackrefs = nbackrefs; + this->subject = subject; + this->ovecsize = 3 * (1 + nbackrefs); + this->ovector = 0; + if (this->ovecsize) + { + this->ovector = new int[this->ovecsize]; + } +} + +void +PCRE::Match::copy(Match const& rhs) +{ + this->init(rhs.nmatches, rhs.nbackrefs, rhs.subject); + int i; + for (i = 0; i < this->ovecsize; ++i) + { + this->ovector[i] = rhs.ovector[i]; + } +} + +void +PCRE::Match::destroy() +{ + delete [] this->ovector; +} + +PCRE::Match::operator bool() +{ + return (this->nmatches >= 0); +} + +std::string +PCRE::Match::getMatch(int n, int flags) +{ + // This method used to be implemented in terms of + // pcre_get_substring, but that function gives you an empty string + // for an unmatched backreference that is in range. + + int offset; + int length; + try + { + getOffsetLength(n, offset, length); + } + catch (NoBackref&) + { + if (flags & gm_no_substring_returns_empty) + { + return ""; + } + else + { + throw; + } + } + + return std::string(this->subject).substr(offset, length); +} + +void +PCRE::Match::getOffsetLength(int n, int& offset, int& length) +{ + if ((this->nmatches < 0) || + (n > this->nmatches - 1) || + (this->ovector[n * 2] == -1)) + { + throw NoBackref(); + } + offset = this->ovector[n * 2]; + length = this->ovector[n * 2 + 1] - offset; +} + +int +PCRE::Match::getOffset(int n) +{ + int offset; + int length; + this->getOffsetLength(n, offset, length); + return offset; +} + +int +PCRE::Match::getLength(int n) +{ + int offset; + int length; + this->getOffsetLength(n, offset, length); + return length; +} + +int +PCRE::Match::nMatches() const +{ + return this->nmatches; +} + +PCRE::PCRE(char const* pattern, int options) +{ + char const *errptr; + int erroffset; + this->code = pcre_compile(pattern, options, &errptr, &erroffset, 0); + if (this->code) + { + pcre_fullinfo(this->code, 0, PCRE_INFO_CAPTURECOUNT, &(this->nbackrefs)); + } + else + { + std::string message = (std::string("compilation of ") + pattern + + " failed at offset " + + QUtil::int_to_string(erroffset) + ": " + + errptr); + throw std::runtime_error("PCRE error: " + message); + } +} + +PCRE::~PCRE() +{ + pcre_free(this->code); +} + +PCRE::Match +PCRE::match(char const* subject, int options, int startoffset, int size) +{ + if (size == -1) + { + size = (int) strlen(subject); + } + + Match result(this->nbackrefs, subject); + int status = pcre_exec(this->code, 0, subject, size, + startoffset, options, + result.ovector, result.ovecsize); + if (status >= 0) + { + result.nmatches = status; + } + else + { + std::string message; + + switch (status) + { + case PCRE_ERROR_NOMATCH: + break; + + case PCRE_ERROR_BADOPTION: + message = "bad option passed to PCRE::match()"; + throw std::logic_error(message); + break; + + case PCRE_ERROR_NOMEMORY: + message = "insufficient memory"; + throw std::runtime_error(message); + break; + + case PCRE_ERROR_NULL: + case PCRE_ERROR_BADMAGIC: + case PCRE_ERROR_UNKNOWN_NODE: + default: + message = "pcre_exec returned " + QUtil::int_to_string(status); + throw std::logic_error(message); + } + } + + return result; +} + +void +PCRE::test(int n) +{ + try + { + if (n == 1) + { + static char const* utf8 = "abÏ€defq"; + PCRE u1("^([[:alpha:]]+)"); + PCRE u2("^([\\p{L}]+)", PCRE_UTF8); + PCRE::Match m1 = u1.match(utf8); + if (m1) + { + std::cout << "no utf8: " << m1.getMatch(1) << std::endl; + } + PCRE::Match m2 = u2.match(utf8); + if (m2) + { + std::cout << "utf8: " << m2.getMatch(1) << std::endl; + } + return; + } + + try + { + PCRE pcre1("a**"); + } + catch (std::exception& e) + { + std::cout << e.what() << std::endl; + } + + PCRE pcre2("^([^\\s:]*)\\s*:\\s*(.*?)\\s*$"); + PCRE::Match m2 = pcre2.match("key: value one two three "); + if (m2) + { + std::cout << m2.nMatches() << std::endl; + std::cout << m2.getMatch(0) << std::endl; + std::cout << m2.getOffset(0) << std::endl; + std::cout << m2.getLength(0) << std::endl; + std::cout << m2.getMatch(1) << std::endl; + std::cout << m2.getOffset(1) << std::endl; + std::cout << m2.getLength(1) << std::endl; + std::cout << m2.getMatch(2) << std::endl; + std::cout << m2.getOffset(2) << std::endl; + std::cout << m2.getLength(2) << std::endl; + try + { + std::cout << m2.getMatch(3) << std::endl; + } + catch (std::exception& e) + { + std::cout << e.what() << std::endl; + } + try + { + std::cout << m2.getOffset(3) << std::endl; + } + catch (std::exception& e) + { + std::cout << e.what() << std::endl; + } + } + PCRE pcre3("^(a+)(b+)?$"); + PCRE::Match m3 = pcre3.match("aaa"); + try + { + if (m3) + { + std::cout << m3.nMatches() << std::endl; + std::cout << m3.getMatch(0) << std::endl; + std::cout << m3.getMatch(1) << std::endl; + std::cout << "-" + << m3.getMatch( + 2, Match::gm_no_substring_returns_empty) + << "-" << std::endl; + std::cout << "hello" << std::endl; + std::cout << m3.getMatch(2) << std::endl; + std::cout << "can't see this" << std::endl; + } + } + catch (std::exception& e) + { + std::cout << e.what() << std::endl; + } + + // backref: 1 2 3 4 5 + PCRE pcre4("^((?:(a(b)?)(?:,(c))?)|(c))?$"); + static char const* candidates[] = { + "qqqcqqq", // no match + "ab,c", // backrefs: 0, 1, 2, 3, 4 + "ab", // backrefs: 0, 1, 2, 3 + "a", // backrefs: 0, 1, 2 + "a,c", // backrefs: 0, 1, 2, 4 + "c", // backrefs: 0, 1, 5 + "", // backrefs: 0 + 0 + }; + for (char const** p = candidates; *p; ++p) + { + PCRE::Match m(pcre4.match(*p)); + if (m) + { + int nmatches = m.nMatches(); + for (int i = 0; i < nmatches; ++i) + { + std::cout << *p << ": " << i << ": "; + try + { + std::string match = m.getMatch(i); + std::cout << match; + } + catch (NoBackref&) + { + std::cout << "no backref (getMatch)"; + } + std::cout << std::endl; + + std::cout << *p << ": " << i << ": "; + try + { + int offset; + int length; + m.getOffsetLength(i, offset, length); + std::cout << offset << ", " << length; + } + catch (NoBackref&) + { + std::cout << "no backref (getOffsetLength)"; + } + std:: cout << std::endl; + } + } + else + { + std::cout << *p << ": no match" << std::endl; + } + } + } + catch (std::exception& e) + { + std::cout << "unexpected exception: " << e.what() << std::endl; + } +} diff --git a/libqpdf/Pipeline.cc b/libqpdf/Pipeline.cc new file mode 100644 index 0000000..b80b2d6 --- /dev/null +++ b/libqpdf/Pipeline.cc @@ -0,0 +1,24 @@ +#include +#include + +Pipeline::Pipeline(char const* identifier, Pipeline* next) : + identifier(identifier), + next(next) +{ +} + +Pipeline::~Pipeline() +{ +} + +Pipeline* +Pipeline::getNext(bool allow_null) +{ + if ((next == 0) && (! allow_null)) + { + throw std::logic_error( + this->identifier + + ": Pipeline::getNext() called on pipeline with no next"); + } + return this->next; +} diff --git a/libqpdf/Pl_AES_PDF.cc b/libqpdf/Pl_AES_PDF.cc new file mode 100644 index 0000000..0f73c09 --- /dev/null +++ b/libqpdf/Pl_AES_PDF.cc @@ -0,0 +1,226 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef HAVE_RANDOM +# define random rand +# define srandom srand +#endif + +bool Pl_AES_PDF::use_static_iv = false; + +Pl_AES_PDF::Pl_AES_PDF(char const* identifier, Pipeline* next, + bool encrypt, unsigned char const key[key_size]) : + Pipeline(identifier, next), + encrypt(encrypt), + cbc_mode(true), + first(true), + offset(0), + nrounds(0) +{ + static int const keybits = 128; + assert(key_size == KEYLENGTH(keybits)); + assert(sizeof(this->rk) / sizeof(uint32_t) == RKLENGTH(keybits)); + std::memcpy(this->key, key, key_size); + std::memset(this->rk, 0, sizeof(this->rk)); + std::memset(this->inbuf, 0, this->buf_size); + std::memset(this->outbuf, 0, this->buf_size); + std::memset(this->cbc_block, 0, this->buf_size); + if (encrypt) + { + this->nrounds = rijndaelSetupEncrypt(this->rk, this->key, keybits); + } + else + { + this->nrounds = rijndaelSetupDecrypt(this->rk, this->key, keybits); + } + assert(this->nrounds == NROUNDS(keybits)); +} + +Pl_AES_PDF::~Pl_AES_PDF() +{ + // nothing needed +} + +void +Pl_AES_PDF::disableCBC() +{ + this->cbc_mode = false; +} + +void +Pl_AES_PDF::useStaticIV() +{ + use_static_iv = true; +} + +void +Pl_AES_PDF::write(unsigned char* data, size_t len) +{ + size_t bytes_left = len; + unsigned char* p = data; + + while (bytes_left > 0) + { + if (this->offset == this->buf_size) + { + flush(false); + } + + size_t available = this->buf_size - this->offset; + size_t bytes = (bytes_left < available ? bytes_left : available); + bytes_left -= bytes; + std::memcpy(this->inbuf + this->offset, p, bytes); + this->offset += bytes; + p += bytes; + } +} + +void +Pl_AES_PDF::finish() +{ + if (this->encrypt) + { + if (this->offset == this->buf_size) + { + flush(false); + } + // Pad as described in section 3.5.1 of version 1.7 of the PDF + // specification, including providing an entire block of padding + // if the input was a multiple of 16 bytes. + unsigned char pad = (unsigned char) (this->buf_size - this->offset); + memset(this->inbuf + this->offset, pad, pad); + this->offset = this->buf_size; + flush(false); + } + else + { + if (this->offset != this->buf_size) + { + // This is never supposed to happen as the output is + // always supposed to be padded. However, we have + // encountered files for which the output is not a + // multiple of the block size. In this case, pad with + // zeroes and hope for the best. + assert(this->buf_size > this->offset); + std::memset(this->inbuf + this->offset, 0, + this->buf_size - this->offset); + this->offset = this->buf_size; + } + flush(true); + } + getNext()->finish(); +} + +void +Pl_AES_PDF::initializeVector() +{ + static bool seeded_random = false; + if (! seeded_random) + { + // Seed the random number generator with something simple, but + // just to be interesting, don't use the unmodified current + // time.... + srandom((int)QUtil::get_current_time() ^ 0xcccc); + seeded_random = true; + } + if (use_static_iv) + { + for (unsigned int i = 0; i < this->buf_size; ++i) + { + this->cbc_block[i] = 14 * (1 + i); + } + } + else + { + for (unsigned int i = 0; i < this->buf_size; ++i) + { + this->cbc_block[i] = (unsigned char)((random() & 0xff0) >> 4); + } + } +} + +void +Pl_AES_PDF::flush(bool strip_padding) +{ + assert(this->offset == this->buf_size); + + if (first) + { + first = false; + if (this->cbc_mode) + { + if (encrypt) + { + // Set cbc_block to a random initialization vector and + // write it to the output stream + initializeVector(); + getNext()->write(this->cbc_block, this->buf_size); + } + else + { + // Take the first block of input as the initialization + // vector. There's nothing to write at this time. + memcpy(this->cbc_block, this->inbuf, this->buf_size); + this->offset = 0; + return; + } + } + } + + if (this->encrypt) + { + if (this->cbc_mode) + { + for (unsigned int i = 0; i < this->buf_size; ++i) + { + this->inbuf[i] ^= this->cbc_block[i]; + } + } + rijndaelEncrypt(this->rk, this->nrounds, this->inbuf, this->outbuf); + if (this->cbc_mode) + { + memcpy(this->cbc_block, this->outbuf, this->buf_size); + } + } + else + { + rijndaelDecrypt(this->rk, this->nrounds, this->inbuf, this->outbuf); + if (this->cbc_mode) + { + for (unsigned int i = 0; i < this->buf_size; ++i) + { + this->outbuf[i] ^= this->cbc_block[i]; + } + memcpy(this->cbc_block, this->inbuf, this->buf_size); + } + } + unsigned int bytes = this->buf_size; + if (strip_padding) + { + unsigned char last = this->outbuf[this->buf_size - 1]; + if (last <= this->buf_size) + { + bool strip = true; + for (unsigned int i = 1; i <= last; ++i) + { + if (this->outbuf[this->buf_size - i] != last) + { + strip = false; + break; + } + } + if (strip) + { + bytes -= last; + } + } + } + getNext()->write(this->outbuf, bytes); + this->offset = 0; +} diff --git a/libqpdf/Pl_ASCII85Decoder.cc b/libqpdf/Pl_ASCII85Decoder.cc new file mode 100644 index 0000000..5c9c9f5 --- /dev/null +++ b/libqpdf/Pl_ASCII85Decoder.cc @@ -0,0 +1,131 @@ +#include +#include +#include +#include + +Pl_ASCII85Decoder::Pl_ASCII85Decoder(char const* identifier, Pipeline* next) : + Pipeline(identifier, next), + pos(0), + eod(0) +{ + memset(this->inbuf, 117, 5); +} + +Pl_ASCII85Decoder::~Pl_ASCII85Decoder() +{ +} + +void +Pl_ASCII85Decoder::write(unsigned char* buf, size_t len) +{ + if (eod > 1) + { + return; + } + for (size_t i = 0; i < len; ++i) + { + if (eod > 1) + { + break; + } + else if (eod == 1) + { + if (buf[i] == '>') + { + flush(); + eod = 2; + } + else + { + throw std::runtime_error( + "broken end-of-data sequence in base 85 data"); + } + } + else + { + switch (buf[i]) + { + case ' ': + case '\f': + case '\v': + case '\t': + case '\r': + case '\n': + QTC::TC("libtests", "Pl_ASCII85Decoder ignore space"); + // ignore whitespace + break; + + case '~': + eod = 1; + break; + + case 'z': + if (pos != 0) + { + throw std::runtime_error( + "unexpected z during base 85 decode"); + } + else + { + QTC::TC("libtests", "Pl_ASCII85Decoder read z"); + getNext()->write((unsigned char*)"\000\000\000\000", 4); + } + break; + + default: + if ((buf[i] < 33) || (buf[i] > 117)) + { + throw std::runtime_error( + "character out of range during base 85 decode"); + } + else + { + this->inbuf[this->pos++] = buf[i]; + if (pos == 5) + { + flush(); + } + } + break; + } + } + } +} + +void +Pl_ASCII85Decoder::flush() +{ + if (this->pos == 0) + { + QTC::TC("libtests", "Pl_ASCII85Decoder no-op flush"); + return; + } + unsigned long lval = 0; + for (int i = 0; i < 5; ++i) + { + lval *= 85; + lval += (this->inbuf[i] - 33); + } + + unsigned char outbuf[4]; + memset(outbuf, 0, 4); + for (int i = 3; i >= 0; --i) + { + outbuf[i] = lval & 0xff; + lval >>= 8; + } + + QTC::TC("libtests", "Pl_ASCII85Decoder partial flush", + (this->pos == 5) ? 0 : 1); + getNext()->write(outbuf, this->pos - 1); + + this->pos = 0; + memset(this->inbuf, 117, 5); +} + +void +Pl_ASCII85Decoder::finish() +{ + flush(); + getNext()->finish(); +} diff --git a/libqpdf/Pl_ASCIIHexDecoder.cc b/libqpdf/Pl_ASCIIHexDecoder.cc new file mode 100644 index 0000000..ca153e8 --- /dev/null +++ b/libqpdf/Pl_ASCIIHexDecoder.cc @@ -0,0 +1,109 @@ +#include +#include +#include +#include +#include + +Pl_ASCIIHexDecoder::Pl_ASCIIHexDecoder(char const* identifier, Pipeline* next) : + Pipeline(identifier, next), + pos(0), + eod(false) +{ + strcpy(this->inbuf, "00"); +} + +Pl_ASCIIHexDecoder::~Pl_ASCIIHexDecoder() +{ +} + +void +Pl_ASCIIHexDecoder::write(unsigned char* buf, size_t len) +{ + if (this->eod) + { + return; + } + for (size_t i = 0; i < len; ++i) + { + char ch = toupper(buf[i]); + switch (ch) + { + case ' ': + case '\f': + case '\v': + case '\t': + case '\r': + case '\n': + QTC::TC("libtests", "Pl_ASCIIHexDecoder ignore space"); + // ignore whitespace + break; + + case '>': + this->eod = true; + flush(); + break; + + default: + if (((ch >= '0') && (ch <= '9')) || + ((ch >= 'A') && (ch <= 'F'))) + { + this->inbuf[this->pos++] = ch; + if (this->pos == 2) + { + flush(); + } + } + else + { + char t[2]; + t[0] = ch; + t[1] = 0; + throw std::runtime_error( + std::string("character out of range" + " during base Hex decode: ") + t); + } + break; + } + if (this->eod) + { + break; + } + } +} + +void +Pl_ASCIIHexDecoder::flush() +{ + if (this->pos == 0) + { + QTC::TC("libtests", "Pl_ASCIIHexDecoder no-op flush"); + return; + } + int b[2]; + for (int i = 0; i < 2; ++i) + { + if (this->inbuf[i] >= 'A') + { + b[i] = this->inbuf[i] - 'A' + 10; + } + else + { + b[i] = this->inbuf[i] - '0'; + } + } + unsigned char ch = (unsigned char)((b[0] << 4) + b[1]); + + QTC::TC("libtests", "Pl_ASCIIHexDecoder partial flush", + (this->pos == 2) ? 0 : 1); + getNext()->write(&ch, 1); + + this->pos = 0; + strcpy(this->inbuf, "00"); +} + +void +Pl_ASCIIHexDecoder::finish() +{ + flush(); + getNext()->finish(); +} diff --git a/libqpdf/Pl_Buffer.cc b/libqpdf/Pl_Buffer.cc new file mode 100644 index 0000000..600ee7d --- /dev/null +++ b/libqpdf/Pl_Buffer.cc @@ -0,0 +1,66 @@ +#include +#include +#include +#include + +Pl_Buffer::Pl_Buffer(char const* identifier, Pipeline* next) : + Pipeline(identifier, next), + ready(false), + total_size(0) +{ +} + +Pl_Buffer::~Pl_Buffer() +{ +} + +void +Pl_Buffer::write(unsigned char* buf, size_t len) +{ + Buffer* b = new Buffer(len); + memcpy(b->getBuffer(), buf, len); + this->data.push_back(b); + this->ready = false; + this->total_size += len; + + if (getNext(true)) + { + getNext()->write(buf, len); + } +} + +void +Pl_Buffer::finish() +{ + this->ready = true; + if (getNext(true)) + { + getNext()->finish(); + } +} + +Buffer* +Pl_Buffer::getBuffer() +{ + if (! this->ready) + { + throw std::logic_error("Pl_Buffer::getBuffer() called when not ready"); + } + + Buffer* b = new Buffer(this->total_size); + unsigned char* p = b->getBuffer(); + while (! this->data.empty()) + { + PointerHolder bp = this->data.front(); + this->data.pop_front(); + size_t bytes = bp->getSize(); + memcpy(p, bp->getBuffer(), bytes); + p += bytes; + this->total_size -= bytes; + } + + assert(this->total_size == 0); + this->ready = false; + + return b; +} diff --git a/libqpdf/Pl_Concatenate.cc b/libqpdf/Pl_Concatenate.cc new file mode 100644 index 0000000..8d48de6 --- /dev/null +++ b/libqpdf/Pl_Concatenate.cc @@ -0,0 +1,28 @@ +#include + +Pl_Concatenate::Pl_Concatenate(char const* identifier, Pipeline* next) : + Pipeline(identifier, next) +{ +} + +Pl_Concatenate::~Pl_Concatenate() +{ +} + +void +Pl_Concatenate::write(unsigned char* data, size_t len) +{ + getNext()->write(data, len); +} + +void +Pl_Concatenate::finish() +{ +} + +void +Pl_Concatenate::manualFinish() +{ + getNext()->finish(); +} + diff --git a/libqpdf/Pl_Count.cc b/libqpdf/Pl_Count.cc new file mode 100644 index 0000000..c76a5e2 --- /dev/null +++ b/libqpdf/Pl_Count.cc @@ -0,0 +1,41 @@ +#include + +Pl_Count::Pl_Count(char const* identifier, Pipeline* next) : + Pipeline(identifier, next), + count(0), + last_char('\0') +{ +} + +Pl_Count::~Pl_Count() +{ +} + +void +Pl_Count::write(unsigned char* buf, size_t len) +{ + if (len) + { + this->count += len; + getNext()->write(buf, len); + this->last_char = buf[len - 1]; + } +} + +void +Pl_Count::finish() +{ + getNext()->finish(); +} + +qpdf_offset_t +Pl_Count::getCount() const +{ + return this->count; +} + +unsigned char +Pl_Count::getLastChar() const +{ + return this->last_char; +} diff --git a/libqpdf/Pl_Discard.cc b/libqpdf/Pl_Discard.cc new file mode 100644 index 0000000..34d49f3 --- /dev/null +++ b/libqpdf/Pl_Discard.cc @@ -0,0 +1,22 @@ +#include + +// Exercised in md5 test suite + +Pl_Discard::Pl_Discard() : + Pipeline("discard", 0) +{ +} + +Pl_Discard::~Pl_Discard() +{ +} + +void +Pl_Discard::write(unsigned char* buf, size_t len) +{ +} + +void +Pl_Discard::finish() +{ +} diff --git a/libqpdf/Pl_Flate.cc b/libqpdf/Pl_Flate.cc new file mode 100644 index 0000000..3061670 --- /dev/null +++ b/libqpdf/Pl_Flate.cc @@ -0,0 +1,222 @@ +#include +#include + +#include + +Pl_Flate::Pl_Flate(char const* identifier, Pipeline* next, + action_e action, int out_bufsize) : + Pipeline(identifier, next), + out_bufsize(out_bufsize), + action(action), + initialized(false) +{ + this->outbuf = new unsigned char[out_bufsize]; + // Indirect through zdata to reach the z_stream so we don't have + // to include zlib.h in Pl_Flate.hh. This means people using + // shared library versions of qpdf don't have to have zlib + // development files available, which particularly helps in a + // Windows environment. + this->zdata = new z_stream; + + z_stream& zstream = *((z_stream*) this->zdata); + zstream.zalloc = (alloc_func)0; + zstream.zfree = (free_func)0; + zstream.opaque = (voidpf)0; + zstream.next_in = 0; + zstream.avail_in = 0; + zstream.next_out = this->outbuf; + zstream.avail_out = out_bufsize; +} + +Pl_Flate::~Pl_Flate() +{ + if (this->outbuf) + { + delete [] this->outbuf; + this->outbuf = 0; + } + delete (z_stream*)this->zdata; + this->zdata = 0; +} + +void +Pl_Flate::write(unsigned char* data, size_t len) +{ + if (this->outbuf == 0) + { + throw std::logic_error( + this->identifier + + ": Pl_Flate: write() called after finish() called"); + } + + // Write in chunks in case len is too big to fit in an int. + // Assume int is at least 32 bits. + static size_t const max_bytes = 1 << 30; + size_t bytes_left = len; + unsigned char* buf = data; + while (bytes_left > 0) + { + size_t bytes = (bytes_left >= max_bytes ? max_bytes : bytes_left); + handleData(buf, (int)bytes, Z_NO_FLUSH); + bytes_left -= bytes; + buf += bytes; + } +} + +void +Pl_Flate::handleData(unsigned char* data, int len, int flush) +{ + z_stream& zstream = *((z_stream*) this->zdata); + zstream.next_in = data; + zstream.avail_in = len; + + if (! this->initialized) + { + int err = Z_OK; + if (this->action == a_deflate) + { + err = deflateInit(&zstream, Z_DEFAULT_COMPRESSION); + } + else + { + err = inflateInit(&zstream); + } + checkError("Init", err); + this->initialized = true; + } + + int err = Z_OK; + + bool done = false; + while (! done) + { + if (action == a_deflate) + { + err = deflate(&zstream, flush); + } + else + { + err = inflate(&zstream, flush); + } + switch (err) + { + case Z_BUF_ERROR: + // Probably shouldn't be able to happen, but possible as a + // boundary condition: if the last call to inflate exactly + // filled the output buffer, it's possible that the next + // call to inflate could have nothing to do. + done = true; + break; + + case Z_STREAM_END: + done = true; + // fall through + + case Z_OK: + { + if ((zstream.avail_in == 0) && + (zstream.avail_out > 0)) + { + // There is nothing left to read, and there was + // sufficient buffer space to write everything we + // needed, so we're done for now. + done = true; + } + uLong ready = (this->out_bufsize - zstream.avail_out); + if (ready > 0) + { + this->getNext()->write(this->outbuf, ready); + zstream.next_out = this->outbuf; + zstream.avail_out = this->out_bufsize; + } + } + break; + + default: + this->checkError("data", err); + break; + } + } +} + +void +Pl_Flate::finish() +{ + if (this->outbuf) + { + if (this->initialized) + { + z_stream& zstream = *((z_stream*) this->zdata); + unsigned char buf[1]; + buf[0] = '\0'; + handleData(buf, 0, Z_FINISH); + int err = Z_OK; + if (action == a_deflate) + { + err = deflateEnd(&zstream); + } + else + { + err = inflateEnd(&zstream); + } + checkError("End", err); + } + + delete [] this->outbuf; + this->outbuf = 0; + } + this->getNext()->finish(); +} + +void +Pl_Flate::checkError(char const* prefix, int error_code) +{ + z_stream& zstream = *((z_stream*) this->zdata); + if (error_code != Z_OK) + { + char const* action_str = (action == a_deflate ? "deflate" : "inflate"); + std::string msg = + this->identifier + ": " + action_str + ": " + prefix + ": "; + + if (zstream.msg) + { + msg += zstream.msg; + } + else + { + switch (error_code) + { + case Z_ERRNO: + msg += "zlib system error"; + break; + + case Z_STREAM_ERROR: + msg += "zlib stream error"; + break; + + case Z_DATA_ERROR: + msg += "zlib data error"; + break; + + case Z_MEM_ERROR: + msg += "zlib memory error"; + break; + + case Z_BUF_ERROR: + msg += "zlib buffer error"; + break; + + case Z_VERSION_ERROR: + msg += "zlib version error"; + break; + + default: + msg += std::string("zlib unknown error (") + + QUtil::int_to_string(error_code) + ")"; + break; + } + } + + throw std::runtime_error(msg); + } +} diff --git a/libqpdf/Pl_LZWDecoder.cc b/libqpdf/Pl_LZWDecoder.cc new file mode 100644 index 0000000..646e45d --- /dev/null +++ b/libqpdf/Pl_LZWDecoder.cc @@ -0,0 +1,228 @@ +#include + +#include +#include +#include +#include + +Pl_LZWDecoder::Pl_LZWDecoder(char const* identifier, Pipeline* next, + bool early_code_change) : + Pipeline(identifier, next), + code_size(9), + next(0), + byte_pos(0), + bit_pos(0), + bits_available(0), + code_change_delta(early_code_change ? 1 : 0), + eod(false), + last_code(256) +{ + memset(buf, 0, 3); +} + +Pl_LZWDecoder::~Pl_LZWDecoder() +{ +} + +void +Pl_LZWDecoder::write(unsigned char* bytes, size_t len) +{ + for (size_t i = 0; i < len; ++i) + { + this->buf[next++] = bytes[i]; + if (this->next == 3) + { + this->next = 0; + } + this->bits_available += 8; + if (this->bits_available >= this->code_size) + { + sendNextCode(); + } + } +} + +void +Pl_LZWDecoder::finish() +{ + getNext()->finish(); +} + +void +Pl_LZWDecoder::sendNextCode() +{ + int high = this->byte_pos; + int med = (this->byte_pos + 1) % 3; + int low = (this->byte_pos + 2) % 3; + + int bits_from_high = 8 - this->bit_pos; + int bits_from_med = this->code_size - bits_from_high; + int bits_from_low = 0; + if (bits_from_med > 8) + { + bits_from_low = bits_from_med - 8; + bits_from_med = 8; + } + int high_mask = (1 << bits_from_high) - 1; + int med_mask = 0xff - ((1 << (8 - bits_from_med)) - 1); + int low_mask = 0xff - ((1 << (8 - bits_from_low)) - 1); + int code = 0; + code += (this->buf[high] & high_mask) << bits_from_med; + code += ((this->buf[med] & med_mask) >> (8 - bits_from_med)); + if (bits_from_low) + { + code <<= bits_from_low; + code += ((this->buf[low] & low_mask) >> (8 - bits_from_low)); + this->byte_pos = low; + this->bit_pos = bits_from_low; + } + else + { + this->byte_pos = med; + this->bit_pos = bits_from_med; + } + if (this->bit_pos == 8) + { + this->bit_pos = 0; + ++this->byte_pos; + this->byte_pos %= 3; + } + this->bits_available -= this->code_size; + + handleCode(code); +} + +unsigned char +Pl_LZWDecoder::getFirstChar(int code) +{ + unsigned char result = '\0'; + if (code < 256) + { + result = (unsigned char) code; + } + else + { + assert(code > 257); + unsigned int idx = code - 258; + assert(idx < table.size()); + Buffer& b = table[idx]; + result = b.getBuffer()[0]; + } + return result; +} + +void +Pl_LZWDecoder::addToTable(unsigned char next) +{ + unsigned int last_size = 0; + unsigned char const* last_data = 0; + unsigned char tmp[1]; + + if (this->last_code < 256) + { + tmp[0] = this->last_code; + last_data = tmp; + last_size = 1; + } + else + { + assert(this->last_code > 257); + unsigned int idx = this->last_code - 258; + assert(idx < table.size()); + Buffer& b = table[idx]; + last_data = b.getBuffer(); + last_size = (unsigned int) b.getSize(); + } + + Buffer entry(1 + last_size); + unsigned char* new_data = entry.getBuffer(); + memcpy(new_data, last_data, last_size); + new_data[last_size] = next; + this->table.push_back(entry); +} + +void +Pl_LZWDecoder::handleCode(int code) +{ + if (this->eod) + { + return; + } + + if (code == 256) + { + if (! this->table.empty()) + { + QTC::TC("libtests", "Pl_LZWDecoder intermediate reset"); + } + this->table.clear(); + this->code_size = 9; + } + else if (code == 257) + { + this->eod = true; + } + else + { + if (this->last_code != 256) + { + // Add to the table from last time. New table entry would + // be what we read last plus the first character of what + // we're reading now. + unsigned char next = '\0'; + unsigned int table_size = (unsigned int) table.size(); + if (code < 256) + { + // just read < 256; last time's next was code + next = code; + } + else if (code > 257) + { + size_t idx = code - 258; + if (idx > table_size) + { + throw std::runtime_error("LZWDecoder: bad code received"); + } + else if (idx == table_size) + { + // The encoder would have just created this entry, + // so the first character of this entry would have + // been the same as the first character of the + // last entry. + QTC::TC("libtests", "Pl_LZWDecoder last was table size"); + next = getFirstChar(this->last_code); + } + else + { + next = getFirstChar(code); + } + } + unsigned int new_idx = 258 + table_size; + if (new_idx == 4096) + { + throw std::runtime_error("LZWDecoder: table full"); + } + addToTable(next); + unsigned int change_idx = new_idx + code_change_delta; + if ((change_idx == 511) || + (change_idx == 1023) || + (change_idx == 2047)) + { + ++this->code_size; + } + } + + if (code < 256) + { + unsigned char ch = (unsigned char) code; + getNext()->write(&ch, 1); + } + else + { + Buffer& b = table[code - 258]; + getNext()->write(b.getBuffer(), b.getSize()); + } + } + + this->last_code = code; +} diff --git a/libqpdf/Pl_MD5.cc b/libqpdf/Pl_MD5.cc new file mode 100644 index 0000000..44911b4 --- /dev/null +++ b/libqpdf/Pl_MD5.cc @@ -0,0 +1,55 @@ +#include +#include + +Pl_MD5::Pl_MD5(char const* identifier, Pipeline* next) : + Pipeline(identifier, next), + in_progress(false) +{ +} + +Pl_MD5::~Pl_MD5() +{ +} + +void +Pl_MD5::write(unsigned char* buf, size_t len) +{ + if (! this->in_progress) + { + this->md5.reset(); + this->in_progress = true; + } + + // Write in chunks in case len is too big to fit in an int. + // Assume int is at least 32 bits. + static size_t const max_bytes = 1 << 30; + size_t bytes_left = len; + unsigned char* data = buf; + while (bytes_left > 0) + { + size_t bytes = (bytes_left >= max_bytes ? max_bytes : bytes_left); + this->md5.encodeDataIncrementally((char*) data, (int)bytes); + bytes_left -= bytes; + data += bytes; + } + + this->getNext()->write(buf, len); +} + +void +Pl_MD5::finish() +{ + this->getNext()->finish(); + this->in_progress = false; +} + +std::string +Pl_MD5::getHexDigest() +{ + if (this->in_progress) + { + throw std::logic_error( + "digest requested for in-progress MD5 Pipeline"); + } + return this->md5.unparse(); +} diff --git a/libqpdf/Pl_PNGFilter.cc b/libqpdf/Pl_PNGFilter.cc new file mode 100644 index 0000000..19b90c0 --- /dev/null +++ b/libqpdf/Pl_PNGFilter.cc @@ -0,0 +1,146 @@ +#include +#include +#include + +Pl_PNGFilter::Pl_PNGFilter(char const* identifier, Pipeline* next, + action_e action, unsigned int columns, + unsigned int bytes_per_pixel) : + Pipeline(identifier, next), + action(action), + columns(columns), + cur_row(0), + prev_row(0), + buf1(0), + buf2(0), + pos(0) +{ + this->buf1 = new unsigned char[columns + 1]; + this->buf2 = new unsigned char[columns + 1]; + this->cur_row = buf1; + + // number of bytes per incoming row + this->incoming = (action == a_encode ? columns : columns + 1); +} + +Pl_PNGFilter::~Pl_PNGFilter() +{ + delete [] buf1; + delete [] buf2; +} + +void +Pl_PNGFilter::write(unsigned char* data, size_t len) +{ + size_t left = this->incoming - this->pos; + size_t offset = 0; + while (len >= left) + { + // finish off current row + memcpy(this->cur_row + this->pos, data + offset, left); + offset += left; + len -= left; + + processRow(); + + // Swap rows + unsigned char* t = this->prev_row; + this->prev_row = this->cur_row; + this->cur_row = t ? t : this->buf2; + memset(this->cur_row, 0, this->columns + 1); + left = this->incoming; + this->pos = 0; + } + if (len) + { + memcpy(this->cur_row + this->pos, data + offset, len); + } + this->pos += len; +} + +void +Pl_PNGFilter::processRow() +{ + if (this->action == a_encode) + { + encodeRow(); + } + else + { + decodeRow(); + } +} + +void +Pl_PNGFilter::decodeRow() +{ + int filter = (int) this->cur_row[0]; + if (this->prev_row) + { + switch (filter) + { + case 0: // none + break; + + case 1: // sub + throw std::logic_error("sub filter not implemented"); + break; + + case 2: // up + for (unsigned int i = 1; i <= this->columns; ++i) + { + this->cur_row[i] += this->prev_row[i]; + } + break; + + case 3: // average + throw std::logic_error("average filter not implemented"); + break; + + case 4: // Paeth + throw std::logic_error("Paeth filter not implemented"); + break; + + default: + // ignore + break; + } + } + + getNext()->write(this->cur_row + 1, this->columns); +} + +void +Pl_PNGFilter::encodeRow() +{ + // For now, hard-code to using UP filter. + unsigned char ch = 2; + getNext()->write(&ch, 1); + if (this->prev_row) + { + for (unsigned int i = 0; i < this->columns; ++i) + { + ch = this->cur_row[i] - this->prev_row[i]; + getNext()->write(&ch, 1); + } + } + else + { + getNext()->write(this->cur_row, this->columns); + } +} + +void +Pl_PNGFilter::finish() +{ + if (this->pos) + { + // write partial row + processRow(); + } + this->prev_row = 0; + this->cur_row = buf1; + this->pos = 0; + memset(this->cur_row, 0, this->columns + 1); + + getNext()->finish(); +} diff --git a/libqpdf/Pl_QPDFTokenizer.cc b/libqpdf/Pl_QPDFTokenizer.cc new file mode 100644 index 0000000..ea13fb7 --- /dev/null +++ b/libqpdf/Pl_QPDFTokenizer.cc @@ -0,0 +1,198 @@ +#include +#include +#include +#include +#include +#include + +Pl_QPDFTokenizer::Pl_QPDFTokenizer(char const* identifier, Pipeline* next) : + Pipeline(identifier, next), + newline_after_next_token(false), + just_wrote_nl(false), + last_char_was_cr(false), + unread_char(false), + char_to_unread('\0'), + in_inline_image(false) +{ + memset(this->image_buf, 0, IMAGE_BUF_SIZE); +} + +Pl_QPDFTokenizer::~Pl_QPDFTokenizer() +{ +} + +void +Pl_QPDFTokenizer::writeNext(char const* buf, size_t len) +{ + if (len) + { + unsigned char* t = new unsigned char[len]; + memcpy(t, buf, len); + getNext()->write(t, len); + delete [] t; + this->just_wrote_nl = (buf[len-1] == '\n'); + } +} + +void +Pl_QPDFTokenizer::writeToken(QPDFTokenizer::Token& token) +{ + std::string value = token.getRawValue(); + + switch (token.getType()) + { + case QPDFTokenizer::tt_string: + value = QPDF_String(token.getValue()).unparse(); + break; + + case QPDFTokenizer::tt_name: + value = QPDF_Name(token.getValue()).unparse(); + break; + + default: + break; + } + writeNext(value.c_str(), value.length()); +} + +void +Pl_QPDFTokenizer::processChar(char ch) +{ + if (this->in_inline_image) + { + // Scan through the input looking for EI surrounded by + // whitespace. If that pattern appears in the inline image's + // representation, we're hosed, but this situation seems + // excessively unlikely, and this code path is only followed + // during content stream normalization, which is pretty much + // used for debugging and human inspection of PDF files. + memmove(this->image_buf, + this->image_buf + 1, + IMAGE_BUF_SIZE - 1); + this->image_buf[IMAGE_BUF_SIZE - 1] = ch; + if (strchr(" \t\n\v\f\r", this->image_buf[0]) && + (this->image_buf[1] == 'E') && + (this->image_buf[2] == 'I') && + strchr(" \t\n\v\f\r", this->image_buf[3])) + { + // We've found an EI operator. We've already written the + // EI operator to output; terminate with a newline + // character and resume normal processing. + writeNext("\n", 1); + this->in_inline_image = false; + QTC::TC("qpdf", "Pl_QPDFTokenizer found EI"); + } + else + { + writeNext(&ch, 1); + } + return; + } + + tokenizer.presentCharacter(ch); + QPDFTokenizer::Token token; + if (tokenizer.getToken(token, this->unread_char, this->char_to_unread)) + { + writeToken(token); + if (this->newline_after_next_token) + { + writeNext("\n", 1); + this->newline_after_next_token = false; + } + if ((token.getType() == QPDFTokenizer::tt_word) && + (token.getValue() == "ID")) + { + // Suspend normal scanning until we find an EI token. + this->in_inline_image = true; + if (this->unread_char) + { + writeNext(&this->char_to_unread, 1); + this->unread_char = false; + } + } + } + else + { + bool suppress = false; + if ((ch == '\n') && (this->last_char_was_cr)) + { + // Always ignore \n following \r + suppress = true; + } + + if ((this->last_char_was_cr = (ch == '\r'))) + { + ch = '\n'; + } + + if (this->tokenizer.betweenTokens()) + { + if (! suppress) + { + writeNext(&ch, 1); + } + } + else + { + if (ch == '\n') + { + this->newline_after_next_token = true; + } + } + } +} + + +void +Pl_QPDFTokenizer::checkUnread() +{ + if (this->unread_char) + { + processChar(this->char_to_unread); + if (this->unread_char) + { + throw std::logic_error( + "INTERNAL ERROR: unread_char still true after processing " + "unread character"); + } + } +} + +void +Pl_QPDFTokenizer::write(unsigned char* buf, size_t len) +{ + checkUnread(); + for (size_t i = 0; i < len; ++i) + { + processChar(buf[i]); + checkUnread(); + } +} + +void +Pl_QPDFTokenizer::finish() +{ + this->tokenizer.presentEOF(); + if (! this->in_inline_image) + { + QPDFTokenizer::Token token; + if (tokenizer.getToken(token, this->unread_char, this->char_to_unread)) + { + writeToken(token); + if (unread_char) + { + if (this->char_to_unread == '\r') + { + this->char_to_unread = '\n'; + } + writeNext(&this->char_to_unread, 1); + } + } + } + if (! this->just_wrote_nl) + { + writeNext("\n", 1); + } + + getNext()->finish(); +} diff --git a/libqpdf/Pl_RC4.cc b/libqpdf/Pl_RC4.cc new file mode 100644 index 0000000..74bb16b --- /dev/null +++ b/libqpdf/Pl_RC4.cc @@ -0,0 +1,56 @@ +#include +#include + +Pl_RC4::Pl_RC4(char const* identifier, Pipeline* next, + unsigned char const* key_data, int key_len, + size_t out_bufsize) : + Pipeline(identifier, next), + out_bufsize(out_bufsize), + rc4(key_data, key_len) +{ + this->outbuf = new unsigned char[out_bufsize]; +} + +Pl_RC4::~Pl_RC4() +{ + if (this->outbuf) + { + delete [] this->outbuf; + this->outbuf = 0; + } +} + +void +Pl_RC4::write(unsigned char* data, size_t len) +{ + if (this->outbuf == 0) + { + throw std::logic_error( + this->identifier + + ": Pl_RC4: write() called after finish() called"); + } + + size_t bytes_left = len; + unsigned char* p = data; + + while (bytes_left > 0) + { + size_t bytes = + (bytes_left < this->out_bufsize ? bytes_left : out_bufsize); + bytes_left -= bytes; + rc4.process(p, (int)bytes, outbuf); + p += bytes; + getNext()->write(outbuf, bytes); + } +} + +void +Pl_RC4::finish() +{ + if (this->outbuf) + { + delete [] this->outbuf; + this->outbuf = 0; + } + this->getNext()->finish(); +} diff --git a/libqpdf/Pl_StdioFile.cc b/libqpdf/Pl_StdioFile.cc new file mode 100644 index 0000000..bd56ac6 --- /dev/null +++ b/libqpdf/Pl_StdioFile.cc @@ -0,0 +1,50 @@ +#include // include first for large file support +#include +#include +#include +#include + +Pl_StdioFile::Pl_StdioFile(char const* identifier, FILE* f) : + Pipeline(identifier, 0), + file(f) +{ +} + +Pl_StdioFile::~Pl_StdioFile() +{ +} + +void +Pl_StdioFile::write(unsigned char* buf, size_t len) +{ + size_t so_far = 0; + while (len > 0) + { + so_far = fwrite(buf, 1, len, this->file); + if (so_far == 0) + { + QUtil::throw_system_error( + this->identifier + ": Pl_StdioFile::write"); + } + else + { + buf += so_far; + len -= so_far; + } + } +} + +void +Pl_StdioFile::finish() +{ + if (fileno(this->file) != -1) + { + fflush(this->file); + } + else + { + throw std::logic_error( + this->identifier + + ": Pl_StdioFile::finish: stream already closed"); + } +} diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc new file mode 100644 index 0000000..efef337 --- /dev/null +++ b/libqpdf/QPDF.cc @@ -0,0 +1,2049 @@ +#include // include first for large file support +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +std::string QPDF::qpdf_version = "3.0.2"; + +static char const* EMPTY_PDF = + "%PDF-1.3\n" + "1 0 obj\n" + "<< /Type /Catalog /Pages 2 0 R >>\n" + "endobj\n" + "2 0 obj\n" + "<< /Type /Pages /Kids [] /Count 0 >>\n" + "endobj\n" + "xref\n" + "0 3\n" + "0000000000 65535 f \n" + "0000000009 00000 n \n" + "0000000058 00000 n \n" + "trailer << /Size 3 /Root 1 0 R >>\n" + "startxref\n" + "110\n" + "%%EOF\n"; + + +QPDF::ObjGen::ObjGen(int o = 0, int g = 0) : + obj(o), + gen(g) +{ +} + +bool +QPDF::ObjGen::operator<(ObjGen const& rhs) const +{ + return ((this->obj < rhs.obj) || + ((this->obj == rhs.obj) && (this->gen < rhs.gen))); +} + +void +QPDF::CopiedStreamDataProvider::provideStreamData( + int objid, int generation, Pipeline* pipeline) +{ + QPDFObjectHandle foreign_stream = + this->foreign_streams[ObjGen(objid, generation)]; + foreign_stream.pipeStreamData(pipeline, false, false, false); +} + +void +QPDF::CopiedStreamDataProvider::registerForeignStream( + ObjGen const& local_og, QPDFObjectHandle foreign_stream) +{ + this->foreign_streams[local_og] = foreign_stream; +} + +QPDF::StringDecrypter::StringDecrypter(QPDF* qpdf, int objid, int gen) : + qpdf(qpdf), + objid(objid), + gen(gen) +{ +} + +void +QPDF::StringDecrypter::decryptString(std::string& val) +{ + qpdf->decryptString(val, objid, gen); +} + +std::string const& +QPDF::QPDFVersion() +{ + return QPDF::qpdf_version; +} + +QPDF::QPDF() : + encrypted(false), + encryption_initialized(false), + ignore_xref_streams(false), + suppress_warnings(false), + out_stream(&std::cout), + err_stream(&std::cerr), + attempt_recovery(true), + encryption_V(0), + encrypt_metadata(true), + cf_stream(e_none), + cf_string(e_none), + cf_file(e_none), + cached_key_objid(0), + cached_key_generation(0), + pushed_inherited_attributes_to_pages(false), + copied_stream_data_provider(0), + first_xref_item_offset(0), + uncompressed_after_compressed(false) +{ +} + +QPDF::~QPDF() +{ + // If two objects are mutually referential (through each object + // having an array or dictionary that contains an indirect + // reference to the other), the circular references in the + // PointerHolder objects will prevent the objects from being + // deleted. Walk through all objects in the object cache, which + // is those objects that we read from the file, and break all + // resolved references. At this point, obviously no one is still + // using the QPDF object, but we'll explicitly clear the xref + // table anyway just to prevent any possibility of resolve() + // succeeding. Note that we can't break references like this at + // any time when the QPDF object is active. If we do, the next + // reference will reread the object from the file, which would + // have the effect of undoing any modifications that may have been + // made to any of the objects. + this->xref_table.clear(); + for (std::map::iterator iter = this->obj_cache.begin(); + iter != obj_cache.end(); ++iter) + { + QPDFObject::ObjAccessor::releaseResolved( + (*iter).second.object.getPointer()); + } +} + +void +QPDF::processFile(char const* filename, char const* password) +{ + FileInputSource* fi = new FileInputSource(); + this->file = fi; + fi->setFilename(filename); + parse(password); +} + +void +QPDF::processFile(char const* description, FILE* filep, + bool close_file, char const* password) +{ + FileInputSource* fi = new FileInputSource(); + this->file = fi; + fi->setFile(description, filep, close_file); + parse(password); +} + +void +QPDF::processMemoryFile(char const* description, + char const* buf, size_t length, + char const* password) +{ + this->file = + new BufferInputSource(description, + new Buffer((unsigned char*)buf, length), + true); + parse(password); +} + +void +QPDF::emptyPDF() +{ + processMemoryFile("empty PDF", EMPTY_PDF, strlen(EMPTY_PDF)); +} + +void +QPDF::setIgnoreXRefStreams(bool val) +{ + this->ignore_xref_streams = val; +} + +void +QPDF::setOutputStreams(std::ostream* out, std::ostream* err) +{ + this->out_stream = out ? out : &std::cout; + this->err_stream = err ? err : &std::cerr; +} + +void +QPDF::setSuppressWarnings(bool val) +{ + this->suppress_warnings = val; +} + +void +QPDF::setAttemptRecovery(bool val) +{ + this->attempt_recovery = val; +} + +std::vector +QPDF::getWarnings() +{ + std::vector result = this->warnings; + this->warnings.clear(); + return result; +} + +void +QPDF::parse(char const* password) +{ + PCRE header_re("^%PDF-(1.\\d+)\\b"); + PCRE eof_re("(?s:startxref\\s+(\\d+)\\s+%%EOF\\b)"); + + if (password) + { + this->provided_password = password; + } + + std::string line = this->file->readLine(20); + PCRE::Match m1 = header_re.match(line.c_str()); + if (m1) + { + this->pdf_version = m1.getMatch(1); + if (atof(this->pdf_version.c_str()) < 1.2) + { + this->tokenizer.allowPoundAnywhereInName(); + } + } + else + { + QTC::TC("qpdf", "QPDF not a pdf file"); + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "", 0, "not a PDF file"); + } + + // PDF spec says %%EOF must be found within the last 1024 bytes of + // the file. We add an extra 30 characters to leave room for the + // startxref stuff. + static int const tbuf_size = 1054; + this->file->seek(0, SEEK_END); + if (this->file->tell() > tbuf_size) + { + this->file->seek(-tbuf_size, SEEK_END); + } + else + { + this->file->rewind(); + } + char* buf = new char[tbuf_size + 1]; + // Put buf in an array-style PointerHolder to guarantee deletion + // of buf. + PointerHolder b(true, buf); + memset(buf, '\0', tbuf_size + 1); + this->file->read(buf, tbuf_size); + + // Since buf may contain null characters, we can't do a regexp + // search on buf directly. Find the last occurrence within buf + // where the regexp matches. + char* p = buf; + char const* candidate = ""; + while ((p = (char*)memchr(p, 's', tbuf_size - (p - buf))) != 0) + { + if (eof_re.match(p)) + { + candidate = p; + } + ++p; + } + + try + { + PCRE::Match m2 = eof_re.match(candidate); + if (! m2) + { + QTC::TC("qpdf", "QPDF can't find startxref"); + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), "", 0, + "can't find startxref"); + } + qpdf_offset_t xref_offset = QUtil::string_to_ll(m2.getMatch(1).c_str()); + read_xref(xref_offset); + } + catch (QPDFExc& e) + { + if (this->attempt_recovery) + { + reconstruct_xref(e); + QTC::TC("qpdf", "QPDF reconstructed xref table"); + } + else + { + throw e; + } + } + + initializeEncryption(); +} + +void +QPDF::warn(QPDFExc const& e) +{ + this->warnings.push_back(e); + if (! this->suppress_warnings) + { + *err_stream << "WARNING: " + << this->warnings.back().what() << std::endl; + } +} + +void +QPDF::setTrailer(QPDFObjectHandle obj) +{ + if (this->trailer.isInitialized()) + { + return; + } + this->trailer = obj; +} + +void +QPDF::reconstruct_xref(QPDFExc& e) +{ + PCRE obj_re("^\\s*(\\d+)\\s+(\\d+)\\s+obj\\b"); + PCRE endobj_re("^\\s*endobj\\b"); + PCRE trailer_re("^\\s*trailer\\b"); + + warn(QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), "", 0, + "file is damaged")); + warn(e); + warn(QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), "", 0, + "Attempting to reconstruct cross-reference table")); + + // Delete all references to type 1 (uncompressed) objects + std::set to_delete; + for (std::map::iterator iter = + this->xref_table.begin(); + iter != this->xref_table.end(); ++iter) + { + if (((*iter).second).getType() == 1) + { + to_delete.insert((*iter).first); + } + } + for (std::set::iterator iter = to_delete.begin(); + iter != to_delete.end(); ++iter) + { + this->xref_table.erase(*iter); + } + + this->file->seek(0, SEEK_END); + qpdf_offset_t eof = this->file->tell(); + this->file->seek(0, SEEK_SET); + bool in_obj = false; + while (this->file->tell() < eof) + { + std::string line = this->file->readLine(50); + if (in_obj) + { + if (endobj_re.match(line.c_str())) + { + in_obj = false; + } + } + else + { + PCRE::Match m = obj_re.match(line.c_str()); + if (m) + { + in_obj = true; + int obj = atoi(m.getMatch(1).c_str()); + int gen = atoi(m.getMatch(2).c_str()); + qpdf_offset_t offset = this->file->getLastOffset(); + insertXrefEntry(obj, 1, offset, gen, true); + } + else if ((! this->trailer.isInitialized()) && + trailer_re.match(line.c_str())) + { + // read "trailer" + this->file->seek(this->file->getLastOffset(), SEEK_SET); + readToken(this->file); + QPDFObjectHandle t = + readObject(this->file, "trailer", 0, 0, false); + if (! t.isDictionary()) + { + // Oh well. It was worth a try. + } + else + { + setTrailer(t); + } + } + } + } + + if (! this->trailer.isInitialized()) + { + // We could check the last encountered object to see if it was + // an xref stream. If so, we could try to get the trailer + // from there. This may make it possible to recover files + // with bad startxref pointers even when they have object + // streams. + + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), "", 0, + "unable to find trailer " + "dictionary while recovering damaged file"); + } + + // We could iterate through the objects looking for streams and + // try to find objects inside of them, but it's probably not worth + // the trouble. Acrobat can't recover files with any errors in an + // xref stream, and this would be a real long shot anyway. If we + // wanted to do anything that involved looking at stream contents, + // we'd also have to call initializeEncryption() here. It's safe + // to call it more than once. +} + +void +QPDF::read_xref(qpdf_offset_t xref_offset) +{ + std::map free_table; + while (xref_offset) + { + this->file->seek(xref_offset, SEEK_SET); + std::string line = this->file->readLine(50); + if (line == "xref") + { + xref_offset = read_xrefTable(this->file->tell()); + } + else + { + xref_offset = read_xrefStream(xref_offset); + } + } + + if (! this->trailer.isInitialized()) + { + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), "", 0, + "unable to find trailer while reading xref"); + } + int size = this->trailer.getKey("/Size").getIntValue(); + int max_obj = 0; + if (! xref_table.empty()) + { + max_obj = (*(xref_table.rbegin())).first.obj; + } + if (! this->deleted_objects.empty()) + { + max_obj = std::max(max_obj, *(this->deleted_objects.rbegin())); + } + if (size != max_obj + 1) + { + QTC::TC("qpdf", "QPDF xref size mismatch"); + warn(QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), "", 0, + std::string("reported number of objects (") + + QUtil::int_to_string(size) + + ") inconsistent with actual number of objects (" + + QUtil::int_to_string(max_obj + 1) + ")")); + } + + // We no longer need the deleted_objects table, so go ahead and + // clear it out to make sure we never depend on its being set. + this->deleted_objects.clear(); +} + +qpdf_offset_t +QPDF::read_xrefTable(qpdf_offset_t xref_offset) +{ + PCRE xref_first_re("^\\s*(\\d+)\\s+(\\d+)"); + PCRE xref_entry_re("(?s:(^\\d{10}) (\\d{5}) ([fn])[ \r\n]{2}$)"); + + std::vector deleted_items; + + this->file->seek(xref_offset, SEEK_SET); + bool done = false; + while (! done) + { + std::string line = this->file->readLine(50); + PCRE::Match m1 = xref_first_re.match(line.c_str()); + if (! m1) + { + QTC::TC("qpdf", "QPDF invalid xref"); + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "xref table", this->file->getLastOffset(), + "xref syntax invalid"); + } + int obj = atoi(m1.getMatch(1).c_str()); + int num = atoi(m1.getMatch(2).c_str()); + static int const xref_entry_size = 20; + char xref_entry[xref_entry_size + 1]; + for (int i = obj; i < obj + num; ++i) + { + if (i == 0) + { + // This is needed by checkLinearization() + this->first_xref_item_offset = this->file->tell(); + } + memset(xref_entry, 0, sizeof(xref_entry)); + this->file->read(xref_entry, xref_entry_size); + PCRE::Match m2 = xref_entry_re.match(xref_entry); + if (! m2) + { + QTC::TC("qpdf", "QPDF invalid xref entry"); + throw QPDFExc( + qpdf_e_damaged_pdf, this->file->getName(), + "xref table", this->file->getLastOffset(), + "invalid xref entry (obj=" + + QUtil::int_to_string(i) + ")"); + } + + // For xref_table, these will always be small enough to be ints + qpdf_offset_t f1 = QUtil::string_to_ll(m2.getMatch(1).c_str()); + int f2 = atoi(m2.getMatch(2).c_str()); + char type = m2.getMatch(3)[0]; + if (type == 'f') + { + // Save deleted items until after we've checked the + // XRefStm, if any. + deleted_items.push_back(ObjGen(i, f2)); + } + else + { + insertXrefEntry(i, 1, f1, f2); + } + } + qpdf_offset_t pos = this->file->tell(); + QPDFTokenizer::Token t = readToken(this->file); + if (t == QPDFTokenizer::Token(QPDFTokenizer::tt_word, "trailer")) + { + done = true; + } + else + { + this->file->seek(pos, SEEK_SET); + } + } + + // Set offset to previous xref table if any + QPDFObjectHandle cur_trailer = + readObject(this->file, "trailer", 0, 0, false); + if (! cur_trailer.isDictionary()) + { + QTC::TC("qpdf", "QPDF missing trailer"); + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "", this->file->getLastOffset(), + "expected trailer dictionary"); + } + + if (! this->trailer.isInitialized()) + { + setTrailer(cur_trailer); + + if (! this->trailer.hasKey("/Size")) + { + QTC::TC("qpdf", "QPDF trailer lacks size"); + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "trailer", this->file->getLastOffset(), + "trailer dictionary lacks /Size key"); + } + if (! this->trailer.getKey("/Size").isInteger()) + { + QTC::TC("qpdf", "QPDF trailer size not integer"); + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "trailer", this->file->getLastOffset(), + "/Size key in trailer dictionary is not " + "an integer"); + } + } + + if (cur_trailer.hasKey("/XRefStm")) + { + if (this->ignore_xref_streams) + { + QTC::TC("qpdf", "QPDF ignoring XRefStm in trailer"); + } + else + { + if (cur_trailer.getKey("/XRefStm").isInteger()) + { + // Read the xref stream but disregard any return value + // -- we'll use our trailer's /Prev key instead of the + // xref stream's. + (void) read_xrefStream( + cur_trailer.getKey("/XRefStm").getIntValue()); + } + else + { + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "xref stream", xref_offset, + "invalid /XRefStm"); + } + } + } + + // Handle any deleted items now that we've read the /XRefStm. + for (std::vector::iterator iter = deleted_items.begin(); + iter != deleted_items.end(); ++iter) + { + ObjGen& og = *iter; + insertXrefEntry(og.obj, 0, 0, og.gen); + } + + if (cur_trailer.hasKey("/Prev")) + { + if (! cur_trailer.getKey("/Prev").isInteger()) + { + QTC::TC("qpdf", "QPDF trailer prev not integer"); + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "trailer", this->file->getLastOffset(), + "/Prev key in trailer dictionary is not " + "an integer"); + } + QTC::TC("qpdf", "QPDF prev key in trailer dictionary"); + xref_offset = cur_trailer.getKey("/Prev").getIntValue(); + } + else + { + xref_offset = 0; + } + + return xref_offset; +} + +qpdf_offset_t +QPDF::read_xrefStream(qpdf_offset_t xref_offset) +{ + bool found = false; + if (! this->ignore_xref_streams) + { + int xobj; + int xgen; + QPDFObjectHandle xref_obj; + try + { + xref_obj = readObjectAtOffset( + false, xref_offset, "xref stream", -1, 0, xobj, xgen); + } + catch (QPDFExc& e) + { + // ignore -- report error below + } + if (xref_obj.isInitialized() && + xref_obj.isStream() && + xref_obj.getDict().getKey("/Type").isName() && + xref_obj.getDict().getKey("/Type").getName() == "/XRef") + { + QTC::TC("qpdf", "QPDF found xref stream"); + found = true; + xref_offset = processXRefStream(xref_offset, xref_obj); + } + } + + if (! found) + { + QTC::TC("qpdf", "QPDF can't find xref"); + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "", xref_offset, "xref not found"); + } + + return xref_offset; +} + +qpdf_offset_t +QPDF::processXRefStream(qpdf_offset_t xref_offset, QPDFObjectHandle& xref_obj) +{ + QPDFObjectHandle dict = xref_obj.getDict(); + QPDFObjectHandle W_obj = dict.getKey("/W"); + QPDFObjectHandle Index_obj = dict.getKey("/Index"); + if (! (W_obj.isArray() && + (W_obj.getArrayNItems() >= 3) && + W_obj.getArrayItem(0).isInteger() && + W_obj.getArrayItem(1).isInteger() && + W_obj.getArrayItem(2).isInteger() && + dict.getKey("/Size").isInteger() && + (Index_obj.isArray() || Index_obj.isNull()))) + { + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "xref stream", xref_offset, + "Cross-reference stream does not have" + " proper /W and /Index keys"); + } + std::vector indx; + if (Index_obj.isArray()) + { + int n_index = Index_obj.getArrayNItems(); + if ((n_index % 2) || (n_index < 2)) + { + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "xref stream", xref_offset, + "Cross-reference stream's /Index has an" + " invalid number of values"); + } + for (int i = 0; i < n_index; ++i) + { + if (Index_obj.getArrayItem(i).isInteger()) + { + indx.push_back(Index_obj.getArrayItem(i).getIntValue()); + } + else + { + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "xref stream", xref_offset, + "Cross-reference stream's /Index's item " + + QUtil::int_to_string(i) + + " is not an integer"); + } + } + QTC::TC("qpdf", "QPDF xref /Index is array", + n_index == 2 ? 0 : 1); + } + else + { + QTC::TC("qpdf", "QPDF xref /Index is null"); + int size = dict.getKey("/Size").getIntValue(); + indx.push_back(0); + indx.push_back(size); + } + + int num_entries = 0; + for (unsigned int i = 1; i < indx.size(); i += 2) + { + num_entries += indx[i]; + } + + int W[3]; + int entry_size = 0; + for (int i = 0; i < 3; ++i) + { + W[i] = W_obj.getArrayItem(i).getIntValue(); + entry_size += W[i]; + } + + size_t expected_size = entry_size * num_entries; + + PointerHolder bp = xref_obj.getStreamData(); + size_t actual_size = bp->getSize(); + + if (expected_size != actual_size) + { + QPDFExc x(qpdf_e_damaged_pdf, this->file->getName(), + "xref stream", xref_offset, + "Cross-reference stream data has the wrong size;" + " expected = " + QUtil::int_to_string(expected_size) + + "; actual = " + QUtil::int_to_string(actual_size)); + if (expected_size > actual_size) + { + throw x; + } + else + { + warn(x); + } + } + + int cur_chunk = 0; + int chunk_count = 0; + + bool saw_first_compressed_object = false; + + unsigned char const* data = bp->getBuffer(); + for (int i = 0; i < num_entries; ++i) + { + // Read this entry + unsigned char const* entry = data + (entry_size * i); + qpdf_offset_t fields[3]; + unsigned char const* p = entry; + for (int j = 0; j < 3; ++j) + { + fields[j] = 0; + if ((j == 0) && (W[0] == 0)) + { + QTC::TC("qpdf", "QPDF default for xref stream field 0"); + fields[0] = 1; + } + for (int k = 0; k < W[j]; ++k) + { + fields[j] <<= 8; + fields[j] += (int)(*p++); + } + } + + // Get the object and generation number. The object number is + // based on /Index. The generation number is 0 unless this is + // an uncompressed object record, in which case the generation + // number appears as the third field. + int obj = indx[cur_chunk] + chunk_count; + ++chunk_count; + if (chunk_count >= indx[cur_chunk + 1]) + { + cur_chunk += 2; + chunk_count = 0; + } + + if (saw_first_compressed_object) + { + if (fields[0] != 2) + { + this->uncompressed_after_compressed = true; + } + } + else if (fields[0] == 2) + { + saw_first_compressed_object = true; + } + if (obj == 0) + { + // This is needed by checkLinearization() + this->first_xref_item_offset = xref_offset; + } + insertXrefEntry(obj, (int)fields[0], fields[1], (int)fields[2]); + } + + if (! this->trailer.isInitialized()) + { + setTrailer(dict); + } + + if (dict.hasKey("/Prev")) + { + if (! dict.getKey("/Prev").isInteger()) + { + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "xref stream", this->file->getLastOffset(), + "/Prev key in xref stream dictionary is not " + "an integer"); + } + QTC::TC("qpdf", "QPDF prev key in xref stream dictionary"); + xref_offset = dict.getKey("/Prev").getIntValue(); + } + else + { + xref_offset = 0; + } + + return xref_offset; +} + +void +QPDF::insertXrefEntry(int obj, int f0, qpdf_offset_t f1, int f2, bool overwrite) +{ + // Populate the xref table in such a way that the first reference + // to an object that we see, which is the one in the latest xref + // table in which it appears, is the one that gets stored. This + // works because we are reading more recent appends before older + // ones. Exception: if overwrite is true, then replace any + // existing object. This is used in xref recovery mode, which + // reads the file from beginning to end. + + // If there is already an entry for this object and generation in + // the table, it means that a later xref table has registered this + // object. Disregard this one. + { // private scope + int gen = (f0 == 2 ? 0 : f2); + ObjGen og(obj, gen); + if (this->xref_table.count(og)) + { + if (overwrite) + { + QTC::TC("qpdf", "QPDF xref overwrite object"); + this->xref_table.erase(og); + } + else + { + QTC::TC("qpdf", "QPDF xref reused object"); + return; + } + } + if (this->deleted_objects.count(obj)) + { + QTC::TC("qpdf", "QPDF xref deleted object"); + return; + } + } + + switch (f0) + { + case 0: + this->deleted_objects.insert(obj); + break; + + case 1: + // f2 is generation + QTC::TC("qpdf", "QPDF xref gen > 0", ((f2 > 0) ? 1 : 0)); + this->xref_table[ObjGen(obj, f2)] = QPDFXRefEntry(f0, f1, f2); + break; + + case 2: + this->xref_table[ObjGen(obj, 0)] = QPDFXRefEntry(f0, f1, f2); + break; + + default: + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "xref stream", this->file->getLastOffset(), + "unknown xref stream entry type " + + QUtil::int_to_string(f0)); + break; + } +} + +void +QPDF::showXRefTable() +{ + for (std::map::iterator iter = + this->xref_table.begin(); + iter != this->xref_table.end(); ++iter) + { + ObjGen const& og = (*iter).first; + QPDFXRefEntry const& entry = (*iter).second; + *out_stream << og.obj << "/" << og.gen << ": "; + switch (entry.getType()) + { + case 1: + *out_stream << "uncompressed; offset = " << entry.getOffset(); + break; + + case 2: + *out_stream << "compressed; stream = " << entry.getObjStreamNumber() + << ", index = " << entry.getObjStreamIndex(); + break; + + default: + throw std::logic_error("unknown cross-reference table type while" + " showing xref_table"); + break; + } + *out_stream << std::endl; + } +} + +void +QPDF::setLastObjectDescription(std::string const& description, + int objid, int generation) +{ + this->last_object_description.clear(); + if (! description.empty()) + { + this->last_object_description += description; + if (objid > 0) + { + this->last_object_description += ": "; + } + } + if (objid > 0) + { + this->last_object_description += "object " + + QUtil::int_to_string(objid) + " " + + QUtil::int_to_string(generation); + } +} + +QPDFObjectHandle +QPDF::readObject(PointerHolder input, + std::string const& description, + int objid, int generation, bool in_object_stream) +{ + setLastObjectDescription(description, objid, generation); + qpdf_offset_t offset = input->tell(); + + bool empty = false; + PointerHolder decrypter_ph; + StringDecrypter* decrypter = 0; + if (this->encrypted && (! in_object_stream)) + { + decrypter_ph = new StringDecrypter(this, objid, generation); + decrypter = decrypter_ph.getPointer(); + } + QPDFObjectHandle object = QPDFObjectHandle::parse( + input, description, this->tokenizer, empty, decrypter, this); + if (empty) + { + // Nothing in the PDF spec appears to allow empty objects, but + // they have been encountered in actual PDF files and Adobe + // Reader appears to ignore them. + warn(QPDFExc(qpdf_e_damaged_pdf, input->getName(), + this->last_object_description, + input->getLastOffset(), + "empty object treated as null")); + } + else if (object.isDictionary() && (! in_object_stream)) + { + // check for stream + qpdf_offset_t cur_offset = input->tell(); + if (readToken(input) == + QPDFTokenizer::Token(QPDFTokenizer::tt_word, "stream")) + { + // The PDF specification states that the word "stream" + // should be followed by either a carriage return and + // a newline or by a newline alone. It specifically + // disallowed following it by a carriage return alone + // since, in that case, there would be no way to tell + // whether the NL in a CR NL sequence was part of the + // stream data. However, some readers, including + // Adobe reader, accept a carriage return by itself + // when followed by a non-newline character, so that's + // what we do here. + { + char ch; + if (input->read(&ch, 1) == 0) + { + // A premature EOF here will result in some + // other problem that will get reported at + // another time. + } + else if (ch == '\n') + { + // ready to read stream data + QTC::TC("qpdf", "QPDF stream with NL only"); + } + else if (ch == '\r') + { + // Read another character + if (input->read(&ch, 1) != 0) + { + if (ch == '\n') + { + // Ready to read stream data + QTC::TC("qpdf", "QPDF stream with CRNL"); + } + else + { + // Treat the \r by itself as the + // whitespace after endstream and + // start reading stream data in spite + // of not having seen a newline. + QTC::TC("qpdf", "QPDF stream with CR only"); + input->unreadCh(ch); + warn(QPDFExc( + qpdf_e_damaged_pdf, + input->getName(), + this->last_object_description, + input->tell(), + "stream keyword followed" + " by carriage return only")); + } + } + } + else + { + QTC::TC("qpdf", "QPDF stream without newline"); + warn(QPDFExc(qpdf_e_damaged_pdf, input->getName(), + this->last_object_description, + input->tell(), + "stream keyword not followed" + " by proper line terminator")); + } + } + + // Must get offset before accessing any additional + // objects since resolving a previously unresolved + // indirect object will change file position. + qpdf_offset_t stream_offset = input->tell(); + size_t length = 0; + + try + { + std::map dict = + object.getDictAsMap(); + + if (dict.count("/Length") == 0) + { + QTC::TC("qpdf", "QPDF stream without length"); + throw QPDFExc(qpdf_e_damaged_pdf, input->getName(), + this->last_object_description, offset, + "stream dictionary lacks /Length key"); + } + + QPDFObjectHandle length_obj = dict["/Length"]; + if (! length_obj.isInteger()) + { + QTC::TC("qpdf", "QPDF stream length not integer"); + throw QPDFExc(qpdf_e_damaged_pdf, input->getName(), + this->last_object_description, offset, + "/Length key in stream dictionary is not " + "an integer"); + } + + length = length_obj.getIntValue(); + input->seek( + stream_offset + (qpdf_offset_t)length, SEEK_SET); + if (! (readToken(input) == + QPDFTokenizer::Token( + QPDFTokenizer::tt_word, "endstream"))) + { + QTC::TC("qpdf", "QPDF missing endstream"); + throw QPDFExc(qpdf_e_damaged_pdf, input->getName(), + this->last_object_description, + input->getLastOffset(), + "expected endstream"); + } + } + catch (QPDFExc& e) + { + if (this->attempt_recovery) + { + // may throw an exception + length = recoverStreamLength( + input, objid, generation, stream_offset); + } + else + { + throw e; + } + } + object = QPDFObjectHandle::Factory::newStream( + this, objid, generation, object, stream_offset, length); + } + else + { + input->seek(cur_offset, SEEK_SET); + } + } + + // Override last_offset so that it points to the beginning of the + // object we just read + input->setLastOffset(offset); + return object; +} + +size_t +QPDF::recoverStreamLength(PointerHolder input, + int objid, int generation, + qpdf_offset_t stream_offset) +{ + PCRE endobj_re("^\\s*endobj\\b"); + + // Try to reconstruct stream length by looking for + // endstream(\r\n?|\n)endobj + warn(QPDFExc(qpdf_e_damaged_pdf, input->getName(), + this->last_object_description, stream_offset, + "attempting to recover stream length")); + + input->seek(0, SEEK_END); + qpdf_offset_t eof = input->tell(); + input->seek(stream_offset, SEEK_SET); + qpdf_offset_t last_line_offset = 0; + size_t length = 0; + static int const line_end_length = 12; // room for endstream\r\n\0 + char last_line_end[line_end_length]; + while (input->tell() < eof) + { + std::string line = input->readLine(50); + qpdf_offset_t line_offset = input->getLastOffset(); + if (endobj_re.match(line.c_str())) + { + qpdf_offset_t endstream_offset = 0; + if (last_line_offset >= line_end_length) + { + qpdf_offset_t cur_offset = input->tell(); + // Read from the end of the last line, guaranteeing + // null termination + qpdf_offset_t search_offset = + line_offset - (line_end_length - 1); + input->seek(search_offset, SEEK_SET); + memset(last_line_end, '\0', line_end_length); + input->read(last_line_end, line_end_length - 1); + input->seek(cur_offset, SEEK_SET); + // if endstream[\r\n] will fit in last_line_end, the + // 'e' has to be in one of the first three spots. + // Check explicitly rather than using strstr directly + // in case there are nulls right before endstream. + char* p = ((last_line_end[0] == 'e') ? last_line_end : + (last_line_end[1] == 'e') ? last_line_end + 1 : + (last_line_end[2] == 'e') ? last_line_end + 2 : + 0); + char* endstream_p = 0; + if (p) + { + char* p1 = strstr(p, "endstream\n"); + char* p2 = strstr(p, "endstream\r"); + endstream_p = (p1 ? p1 : p2); + } + if (endstream_p) + { + endstream_offset = + search_offset + (endstream_p - last_line_end); + } + } + if (endstream_offset > 0) + { + // Stream probably ends right before "endstream" + length = endstream_offset - stream_offset; + // Go back to where we would have been if we had just + // read the endstream. + input->seek(line_offset, SEEK_SET); + break; + } + } + last_line_offset = line_offset; + } + + if (length) + { + int this_obj_offset = 0; + ObjGen this_obj(0, 0); + + // Make sure this is inside this object + for (std::map::iterator iter = + this->xref_table.begin(); + iter != this->xref_table.end(); ++iter) + { + ObjGen const& og = (*iter).first; + QPDFXRefEntry const& entry = (*iter).second; + if (entry.getType() == 1) + { + qpdf_offset_t obj_offset = entry.getOffset(); + if ((obj_offset > stream_offset) && + ((this_obj_offset == 0) || + (this_obj_offset > obj_offset))) + { + this_obj_offset = obj_offset; + this_obj = og; + } + } + } + if (this_obj_offset && + (this_obj.obj == objid) && + (this_obj.gen == generation)) + { + // Well, we found endstream\nendobj within the space + // allowed for this object, so we're probably in good + // shape. + } + else + { + QTC::TC("qpdf", "QPDF found wrong endstream in recovery"); + } + } + + if (length == 0) + { + throw QPDFExc(qpdf_e_damaged_pdf, input->getName(), + this->last_object_description, stream_offset, + "unable to recover stream data"); + } + + QTC::TC("qpdf", "QPDF recovered stream length"); + return length; +} + +QPDFTokenizer::Token +QPDF::readToken(PointerHolder input) +{ + return this->tokenizer.readToken(input, this->last_object_description); +} + +QPDFObjectHandle +QPDF::readObjectAtOffset(bool try_recovery, + qpdf_offset_t offset, std::string const& description, + int exp_objid, int exp_generation, + int& objid, int& generation) +{ + setLastObjectDescription(description, exp_objid, exp_generation); + this->file->seek(offset, SEEK_SET); + + QPDFTokenizer::Token tobjid = readToken(this->file); + QPDFTokenizer::Token tgen = readToken(this->file); + QPDFTokenizer::Token tobj = readToken(this->file); + + bool objidok = (tobjid.getType() == QPDFTokenizer::tt_integer); + int genok = (tgen.getType() == QPDFTokenizer::tt_integer); + int objok = (tobj == QPDFTokenizer::Token(QPDFTokenizer::tt_word, "obj")); + + QTC::TC("qpdf", "QPDF check objid", objidok ? 1 : 0); + QTC::TC("qpdf", "QPDF check generation", genok ? 1 : 0); + QTC::TC("qpdf", "QPDF check obj", objok ? 1 : 0); + + try + { + if (! (objidok && genok && objok)) + { + QTC::TC("qpdf", "QPDF expected n n obj"); + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + this->last_object_description, offset, + "expected n n obj"); + } + objid = atoi(tobjid.getValue().c_str()); + generation = atoi(tgen.getValue().c_str()); + + if ((exp_objid >= 0) && + (! ((objid == exp_objid) && (generation == exp_generation)))) + { + QTC::TC("qpdf", "QPDF err wrong objid/generation"); + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + this->last_object_description, offset, + std::string("expected ") + + QUtil::int_to_string(exp_objid) + " " + + QUtil::int_to_string(exp_generation) + " obj"); + } + } + catch (QPDFExc& e) + { + if ((exp_objid >= 0) && try_recovery && this->attempt_recovery) + { + // Try again after reconstructing xref table + reconstruct_xref(e); + ObjGen og(exp_objid, exp_generation); + if (this->xref_table.count(og) && + (this->xref_table[og].getType() == 1)) + { + qpdf_offset_t new_offset = this->xref_table[og].getOffset(); + QPDFObjectHandle result = readObjectAtOffset( + false, new_offset, description, + exp_objid, exp_generation, objid, generation); + QTC::TC("qpdf", "QPDF recovered in readObjectAtOffset"); + return result; + } + else + { + QTC::TC("qpdf", "QPDF object gone after xref reconstruction"); + warn(QPDFExc( + qpdf_e_damaged_pdf, this->file->getName(), + "", 0, + std::string( + "object " + + QUtil::int_to_string(exp_objid) + + " " + + QUtil::int_to_string(exp_generation) + + " not found in file after regenerating" + " cross reference table"))); + return QPDFObjectHandle::newNull(); + } + } + else + { + throw e; + } + } + + QPDFObjectHandle oh = readObject( + this->file, description, objid, generation, false); + + if (! (readToken(this->file) == + QPDFTokenizer::Token(QPDFTokenizer::tt_word, "endobj"))) + { + QTC::TC("qpdf", "QPDF err expected endobj"); + warn(QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + this->last_object_description, this->file->getLastOffset(), + "expected endobj")); + } + + ObjGen og(objid, generation); + if (! this->obj_cache.count(og)) + { + // Store the object in the cache here so it gets cached + // whether we first know the offset or whether we first know + // the object ID and generation (in which we case we would get + // here through resolve). + + // Determine the end offset of this object before and after + // white space. We use these numbers to validate + // linearization hint tables. Offsets and lengths of objects + // may imply the end of an object to be anywhere between these + // values. + qpdf_offset_t end_before_space = this->file->tell(); + + // skip over spaces + while (true) + { + char ch; + if (this->file->read(&ch, 1)) + { + if (! isspace((unsigned char)ch)) + { + this->file->seek(-1, SEEK_CUR); + break; + } + } + else + { + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + this->last_object_description, offset, + "EOF after endobj"); + } + } + qpdf_offset_t end_after_space = this->file->tell(); + + this->obj_cache[og] = + ObjCache(QPDFObjectHandle::ObjAccessor::getObject(oh), + end_before_space, end_after_space); + } + + return oh; +} + +PointerHolder +QPDF::resolve(int objid, int generation) +{ + // Check object cache before checking xref table. This allows us + // to insert things into the object cache that don't actually + // exist in the file. + ObjGen og(objid, generation); + if (! this->obj_cache.count(og)) + { + if (! this->xref_table.count(og)) + { + // PDF spec says unknown objects resolve to the null object. + return new QPDF_Null; + } + + QPDFXRefEntry const& entry = this->xref_table[og]; + switch (entry.getType()) + { + case 1: + { + qpdf_offset_t offset = entry.getOffset(); + // Object stored in cache by readObjectAtOffset + int aobjid; + int ageneration; + QPDFObjectHandle oh = + readObjectAtOffset(true, offset, "", objid, generation, + aobjid, ageneration); + } + break; + + case 2: + resolveObjectsInStream(entry.getObjStreamNumber()); + break; + + default: + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), "", 0, + "object " + + QUtil::int_to_string(objid) + "/" + + QUtil::int_to_string(generation) + + " has unexpected xref entry type"); + } + } + + return this->obj_cache[og].object; +} + +void +QPDF::resolveObjectsInStream(int obj_stream_number) +{ + // Force resolution of object stream + QPDFObjectHandle obj_stream = getObjectByID(obj_stream_number, 0); + if (! obj_stream.isStream()) + { + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + this->last_object_description, + this->file->getLastOffset(), + "supposed object stream " + + QUtil::int_to_string(obj_stream_number) + + " is not a stream"); + } + + // For linearization data in the object, use the data from the + // object stream for the objects in the stream. + ObjGen stream_og(obj_stream_number, 0); + qpdf_offset_t end_before_space = + this->obj_cache[stream_og].end_before_space; + qpdf_offset_t end_after_space = + this->obj_cache[stream_og].end_after_space; + + QPDFObjectHandle dict = obj_stream.getDict(); + if (! (dict.getKey("/Type").isName() && + dict.getKey("/Type").getName() == "/ObjStm")) + { + QTC::TC("qpdf", "QPDF ERR object stream with wrong type"); + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + this->last_object_description, + this->file->getLastOffset(), + "supposed object stream " + + QUtil::int_to_string(obj_stream_number) + + " has wrong type"); + } + + if (! (dict.getKey("/N").isInteger() && + dict.getKey("/First").isInteger())) + { + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + this->last_object_description, + this->file->getLastOffset(), + "object stream " + + QUtil::int_to_string(obj_stream_number) + + " has incorrect keys"); + } + + int n = dict.getKey("/N").getIntValue(); + int first = dict.getKey("/First").getIntValue(); + + std::map offsets; + + PointerHolder bp = obj_stream.getStreamData(); + PointerHolder input = new BufferInputSource( + "object stream " + QUtil::int_to_string(obj_stream_number), + bp.getPointer()); + + for (int i = 0; i < n; ++i) + { + QPDFTokenizer::Token tnum = readToken(input); + QPDFTokenizer::Token toffset = readToken(input); + if (! ((tnum.getType() == QPDFTokenizer::tt_integer) && + (toffset.getType() == QPDFTokenizer::tt_integer))) + { + throw QPDFExc(qpdf_e_damaged_pdf, input->getName(), + this->last_object_description, input->getLastOffset(), + "expected integer in object stream header"); + } + + int num = atoi(tnum.getValue().c_str()); + int offset = QUtil::string_to_ll(toffset.getValue().c_str()); + offsets[num] = offset + first; + } + + for (std::map::iterator iter = offsets.begin(); + iter != offsets.end(); ++iter) + { + int obj = (*iter).first; + int offset = (*iter).second; + input->seek(offset, SEEK_SET); + QPDFObjectHandle oh = readObject(input, "", obj, 0, true); + + // Store in cache + ObjGen og(obj, 0); + + this->obj_cache[og] = + ObjCache(QPDFObjectHandle::ObjAccessor::getObject(oh), + end_before_space, end_after_space); + } +} + +QPDFObjectHandle +QPDF::makeIndirectObject(QPDFObjectHandle oh) +{ + ObjGen o1(0, 0); + if (! this->obj_cache.empty()) + { + o1 = (*(this->obj_cache.rbegin())).first; + } + ObjGen o2 = (*(this->xref_table.rbegin())).first; + QTC::TC("qpdf", "QPDF indirect last obj from xref", + (o2.obj > o1.obj) ? 1 : 0); + int max_objid = std::max(o1.obj, o2.obj); + ObjGen next(max_objid + 1, 0); + this->obj_cache[next] = + ObjCache(QPDFObjectHandle::ObjAccessor::getObject(oh), -1, -1); + return QPDFObjectHandle::Factory::newIndirect(this, next.obj, next.gen); +} + +QPDFObjectHandle +QPDF::getObjectByID(int objid, int generation) +{ + return QPDFObjectHandle::Factory::newIndirect(this, objid, generation); +} + +void +QPDF::replaceObject(int objid, int generation, QPDFObjectHandle oh) +{ + if (oh.isIndirect()) + { + QTC::TC("qpdf", "QPDF replaceObject called with indirect object"); + throw std::logic_error( + "QPDF::replaceObject called with indirect object handle"); + } + + // Force new object to appear in the cache + resolve(objid, generation); + + // Replace the object in the object cache + ObjGen og(objid, generation); + this->obj_cache[og] = + ObjCache(QPDFObjectHandle::ObjAccessor::getObject(oh), -1, -1); +} + +void +QPDF::replaceReserved(QPDFObjectHandle reserved, + QPDFObjectHandle replacement) +{ + QTC::TC("qpdf", "QPDF replaceReserved"); + reserved.assertReserved(); + replaceObject(reserved.getObjectID(), + reserved.getGeneration(), + replacement); +} + +QPDFObjectHandle +QPDF::copyForeignObject(QPDFObjectHandle foreign) +{ + return copyForeignObject(foreign, false); +} + +QPDFObjectHandle +QPDF::copyForeignObject(QPDFObjectHandle foreign, bool allow_page) +{ + if (! foreign.isIndirect()) + { + QTC::TC("qpdf", "QPDF copyForeign direct"); + throw std::logic_error( + "QPDF::copyForeign called with direct object handle"); + } + QPDF* other = foreign.getOwningQPDF(); + if (other == this) + { + QTC::TC("qpdf", "QPDF copyForeign not foreign"); + throw std::logic_error( + "QPDF::copyForeign called with object from this QPDF"); + } + + ObjCopier& obj_copier = this->object_copiers[other]; + if (! obj_copier.visiting.empty()) + { + throw std::logic_error("obj_copier.visiting is not empty" + " at the beginning of copyForeignObject"); + } + + // Make sure we have an object in this file for every referenced + // object in the old file. obj_copier.object_map maps foreign + // ObjGen to local objects. For everything new that we have to + // copy, the local object will be a reservation, unless it is a + // stream, in which case the local object will already be a + // stream. + reserveObjects(foreign, obj_copier, true); + + if (! obj_copier.visiting.empty()) + { + throw std::logic_error("obj_copier.visiting is not empty" + " after reserving objects"); + } + + // Copy any new objects and replace the reservations. + for (std::vector::iterator iter = + obj_copier.to_copy.begin(); + iter != obj_copier.to_copy.end(); ++iter) + { + QPDFObjectHandle& to_copy = *iter; + QPDFObjectHandle copy = + replaceForeignIndirectObjects(to_copy, obj_copier, true); + if (! to_copy.isStream()) + { + ObjGen og(to_copy.getObjectID(), to_copy.getGeneration()); + replaceReserved(obj_copier.object_map[og], copy); + } + } + obj_copier.to_copy.clear(); + + return obj_copier.object_map[ObjGen(foreign.getObjectID(), + foreign.getGeneration())]; +} + +void +QPDF::reserveObjects(QPDFObjectHandle foreign, ObjCopier& obj_copier, + bool top) +{ + if (foreign.isReserved()) + { + throw std::logic_error( + "QPDF: attempting to copy a foreign reserved object"); + } + + if (foreign.isPagesObject()) + { + QTC::TC("qpdf", "QPDF not copying pages object"); + return; + } + + if ((! top) && foreign.isPageObject()) + { + QTC::TC("qpdf", "QPDF not crossing page boundary"); + return; + } + + if (foreign.isIndirect()) + { + ObjGen foreign_og(foreign.getObjectID(), foreign.getGeneration()); + if (obj_copier.visiting.find(foreign_og) != obj_copier.visiting.end()) + { + QTC::TC("qpdf", "QPDF loop reserving objects"); + return; + } + QTC::TC("qpdf", "QPDF copy indirect"); + obj_copier.visiting.insert(foreign_og); + std::map::iterator mapping = + obj_copier.object_map.find(foreign_og); + if (mapping == obj_copier.object_map.end()) + { + obj_copier.to_copy.push_back(foreign); + QPDFObjectHandle reservation; + if (foreign.isStream()) + { + reservation = QPDFObjectHandle::newStream(this); + } + else + { + reservation = QPDFObjectHandle::newReserved(this); + } + obj_copier.object_map[foreign_og] = reservation; + } + } + + if (foreign.isArray()) + { + QTC::TC("qpdf", "QPDF reserve array"); + int n = foreign.getArrayNItems(); + for (int i = 0; i < n; ++i) + { + reserveObjects(foreign.getArrayItem(i), obj_copier, false); + } + } + else if (foreign.isDictionary()) + { + QTC::TC("qpdf", "QPDF reserve dictionary"); + std::set keys = foreign.getKeys(); + for (std::set::iterator iter = keys.begin(); + iter != keys.end(); ++iter) + { + reserveObjects(foreign.getKey(*iter), obj_copier, false); + } + } + else if (foreign.isStream()) + { + QTC::TC("qpdf", "QPDF reserve stream"); + reserveObjects(foreign.getDict(), obj_copier, false); + } + + if (foreign.isIndirect()) + { + ObjGen foreign_og(foreign.getObjectID(), foreign.getGeneration()); + obj_copier.visiting.erase(foreign_og); + } +} + +QPDFObjectHandle +QPDF::replaceForeignIndirectObjects( + QPDFObjectHandle foreign, ObjCopier& obj_copier, bool top) +{ + QPDFObjectHandle result; + if ((! top) && foreign.isIndirect()) + { + QTC::TC("qpdf", "QPDF replace indirect"); + ObjGen foreign_og(foreign.getObjectID(), foreign.getGeneration()); + std::map::iterator mapping = + obj_copier.object_map.find(foreign_og); + if (mapping == obj_copier.object_map.end()) + { + // This case would occur if this is a reference to a Page + // or Pages object that we didn't traverse into. + QTC::TC("qpdf", "QPDF replace foreign indirect with null"); + result = QPDFObjectHandle::newNull(); + } + else + { + result = obj_copier.object_map[foreign_og]; + } + } + else if (foreign.isArray()) + { + QTC::TC("qpdf", "QPDF replace array"); + result = QPDFObjectHandle::newArray(); + int n = foreign.getArrayNItems(); + for (int i = 0; i < n; ++i) + { + result.appendItem( + replaceForeignIndirectObjects( + foreign.getArrayItem(i), obj_copier, false)); + } + } + else if (foreign.isDictionary()) + { + QTC::TC("qpdf", "QPDF replace dictionary"); + result = QPDFObjectHandle::newDictionary(); + std::set keys = foreign.getKeys(); + for (std::set::iterator iter = keys.begin(); + iter != keys.end(); ++iter) + { + result.replaceKey( + *iter, + replaceForeignIndirectObjects( + foreign.getKey(*iter), obj_copier, false)); + } + } + else if (foreign.isStream()) + { + QTC::TC("qpdf", "QPDF replace stream"); + ObjGen foreign_og(foreign.getObjectID(), foreign.getGeneration()); + result = obj_copier.object_map[foreign_og]; + result.assertStream(); + QPDFObjectHandle dict = result.getDict(); + QPDFObjectHandle old_dict = foreign.getDict(); + std::set keys = old_dict.getKeys(); + for (std::set::iterator iter = keys.begin(); + iter != keys.end(); ++iter) + { + dict.replaceKey( + *iter, + replaceForeignIndirectObjects( + old_dict.getKey(*iter), obj_copier, false)); + } + if (this->copied_stream_data_provider == 0) + { + this->copied_stream_data_provider = new CopiedStreamDataProvider(); + this->copied_streams = this->copied_stream_data_provider; + } + ObjGen local_og(result.getObjectID(), result.getGeneration()); + this->copied_stream_data_provider->registerForeignStream( + local_og, foreign); + result.replaceStreamData(this->copied_streams, + dict.getKey("/Filter"), + dict.getKey("/DecodeParms")); + } + else + { + foreign.assertScalar(); + result = foreign; + result.makeDirect(); + } + + if (top && (! result.isStream()) && result.isIndirect()) + { + throw std::logic_error("replacement for foreign object is indirect"); + } + + return result; +} + +void +QPDF::swapObjects(int objid1, int generation1, int objid2, int generation2) +{ + // Force objects to be loaded into cache; then swap them in the + // cache. + resolve(objid1, generation1); + resolve(objid2, generation2); + ObjGen og1(objid1, generation1); + ObjGen og2(objid2, generation2); + ObjCache t = this->obj_cache[og1]; + this->obj_cache[og1] = this->obj_cache[og2]; + this->obj_cache[og2] = t; +} + +void +QPDF::trimTrailerForWrite() +{ + // Note that removing the encryption dictionary does not interfere + // with reading encrypted files. QPDF loads all the information + // it needs from the encryption dictionary at the beginning and + // never looks at it again. + this->trailer.removeKey("/ID"); + this->trailer.removeKey("/Encrypt"); + this->trailer.removeKey("/Prev"); + + // Remove all trailer keys that potentially come from a + // cross-reference stream + this->trailer.removeKey("/Index"); + this->trailer.removeKey("/W"); + this->trailer.removeKey("/Length"); + this->trailer.removeKey("/Filter"); + this->trailer.removeKey("/DecodeParms"); + this->trailer.removeKey("/Type"); + this->trailer.removeKey("/XRefStm"); +} + +std::string +QPDF::getFilename() const +{ + return this->file->getName(); +} + +std::string +QPDF::getPDFVersion() const +{ + return this->pdf_version; +} + +QPDFObjectHandle +QPDF::getTrailer() +{ + return this->trailer; +} + +QPDFObjectHandle +QPDF::getRoot() +{ + return this->trailer.getKey("/Root"); +} + +void +QPDF::getObjectStreamData(std::map& omap) +{ + for (std::map::iterator iter = + this->xref_table.begin(); + iter != this->xref_table.end(); ++iter) + { + ObjGen const& og = (*iter).first; + QPDFXRefEntry const& entry = (*iter).second; + if (entry.getType() == 2) + { + omap[og.obj] = entry.getObjStreamNumber(); + } + } +} + +std::vector +QPDF::getCompressibleObjects() +{ + // Return a set of object numbers of objects that are allowed to + // be in object streams. We disregard generation numbers here + // since this is a helper function for QPDFWriter which is going + // to renumber objects anyway. This code will do weird things if + // we have two objects with the same object number and different + // generations, but so do virtually all PDF consumers, + // particularly since this is not a permitted condition. + + // We walk through the objects by traversing the document from the + // root, including a traversal of the pages tree. This makes that + // objects that are on the same page are more likely to be in the + // same object stream, which is slightly more efficient, + // particularly with linearized files. This is better than + // iterating through the xref table since it avoids preserving + // orphaned items. + + // Exclude encryption dictionary, if any + int encryption_dict_id = 0; + QPDFObjectHandle encryption_dict = trailer.getKey("/Encrypt"); + if (encryption_dict.isIndirect()) + { + encryption_dict_id = encryption_dict.getObjectID(); + } + + std::set visited; + std::list queue; + queue.push_front(this->trailer); + std::vector result; + while (! queue.empty()) + { + QPDFObjectHandle obj = queue.front(); + queue.pop_front(); + if (obj.isIndirect()) + { + int objid = obj.getObjectID(); + if (visited.count(objid)) + { + QTC::TC("qpdf", "QPDF loop detected traversing objects"); + continue; + } + if (objid == encryption_dict_id) + { + QTC::TC("qpdf", "QPDF exclude encryption dictionary"); + } + else if (! obj.isStream()) + { + result.push_back(objid); + } + visited.insert(objid); + } + if (obj.isStream()) + { + QPDFObjectHandle dict = obj.getDict(); + std::set keys = dict.getKeys(); + for (std::set::reverse_iterator iter = keys.rbegin(); + iter != keys.rend(); ++iter) + { + std::string const& key = *iter; + QPDFObjectHandle value = dict.getKey(key); + if (key == "/Length") + { + // omit stream lengths + if (value.isIndirect()) + { + QTC::TC("qpdf", "QPDF exclude indirect length"); + } + } + else + { + queue.push_front(value); + } + } + } + else if (obj.isDictionary()) + { + std::set keys = obj.getKeys(); + for (std::set::reverse_iterator iter = keys.rbegin(); + iter != keys.rend(); ++iter) + { + queue.push_front(obj.getKey(*iter)); + } + } + else if (obj.isArray()) + { + int n = obj.getArrayNItems(); + for (int i = 1; i <= n; ++i) + { + queue.push_front(obj.getArrayItem(n - i)); + } + } + } + + return result; +} + +void +QPDF::pipeStreamData(int objid, int generation, + qpdf_offset_t offset, size_t length, + QPDFObjectHandle stream_dict, + Pipeline* pipeline) +{ + std::vector > to_delete; + if (this->encrypted) + { + decryptStream(pipeline, objid, generation, stream_dict, to_delete); + } + + try + { + this->file->seek(offset, SEEK_SET); + char buf[10240]; + while (length > 0) + { + size_t to_read = (sizeof(buf) < length ? sizeof(buf) : length); + size_t len = this->file->read(buf, to_read); + if (len == 0) + { + throw QPDFExc(qpdf_e_damaged_pdf, + this->file->getName(), + this->last_object_description, + this->file->getLastOffset(), + "unexpected EOF reading stream data"); + } + length -= len; + pipeline->write((unsigned char*)buf, len); + } + } + catch (QPDFExc& e) + { + warn(e); + } + catch (std::runtime_error& e) + { + QTC::TC("qpdf", "QPDF decoding error warning"); + warn(QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "", this->file->getLastOffset(), + "error decoding stream data for object " + + QUtil::int_to_string(objid) + " " + + QUtil::int_to_string(generation) + ": " + e.what())); + } + pipeline->finish(); +} + +void +QPDF::decodeStreams() +{ + for (std::map::iterator iter = + this->xref_table.begin(); + iter != this->xref_table.end(); ++iter) + { + ObjGen const& og = (*iter).first; + QPDFObjectHandle obj = getObjectByID(og.obj, og.gen); + if (obj.isStream()) + { + Pl_Discard pl; + obj.pipeStreamData(&pl, true, false, false); + } + } +} diff --git a/libqpdf/QPDFExc.cc b/libqpdf/QPDFExc.cc new file mode 100644 index 0000000..8bbfb0b --- /dev/null +++ b/libqpdf/QPDFExc.cc @@ -0,0 +1,86 @@ +#include +#include + +QPDFExc::QPDFExc(qpdf_error_code_e error_code, + std::string const& filename, + std::string const& object, + qpdf_offset_t offset, + std::string const& message) : + std::runtime_error(createWhat(filename, object, offset, message)), + error_code(error_code), + filename(filename), + object(object), + offset(offset), + message(message) +{ +} + +QPDFExc::~QPDFExc() throw () +{ +} + +std::string +QPDFExc::createWhat(std::string const& filename, + std::string const& object, + qpdf_offset_t offset, + std::string const& message) +{ + std::string result; + if (! filename.empty()) + { + result += filename; + } + if (! (object.empty() && offset == 0)) + { + result += " ("; + if (! object.empty()) + { + result += object; + if (offset > 0) + { + result += ", "; + } + } + if (offset > 0) + { + result += "file position " + QUtil::int_to_string(offset); + } + result += ")"; + } + if (! result.empty()) + { + result += ": "; + } + result += message; + return result; +} + +qpdf_error_code_e +QPDFExc::getErrorCode() const +{ + return this->error_code; +} + +std::string const& +QPDFExc::getFilename() const +{ + return this->filename; +} + +std::string const& +QPDFExc::getObject() const +{ + return this->object; +} + +qpdf_offset_t +QPDFExc::getFilePosition() const +{ + return this->offset; +} + +std::string const& +QPDFExc::getMessageDetail() const +{ + return this->message; +} diff --git a/libqpdf/QPDFObject.cc b/libqpdf/QPDFObject.cc new file mode 100644 index 0000000..8df2b48 --- /dev/null +++ b/libqpdf/QPDFObject.cc @@ -0,0 +1 @@ +#include diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc new file mode 100644 index 0000000..54897b8 --- /dev/null +++ b/libqpdf/QPDFObjectHandle.cc @@ -0,0 +1,1306 @@ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +QPDFObjectHandle::QPDFObjectHandle() : + initialized(false), + objid(0), + generation(0), + reserved(false) +{ +} + +QPDFObjectHandle::QPDFObjectHandle(QPDF* qpdf, int objid, int generation) : + initialized(true), + qpdf(qpdf), + objid(objid), + generation(generation), + reserved(false) +{ +} + +QPDFObjectHandle::QPDFObjectHandle(QPDFObject* data) : + initialized(true), + qpdf(0), + objid(0), + generation(0), + obj(data), + reserved(false) +{ +} + +void +QPDFObjectHandle::releaseResolved() +{ + // Recursively break any resolved references to indirect objects. + // Do not cross over indirect object boundaries to avoid an + // infinite loop. This method may only be called during final + // destruction. See comments in QPDF::~QPDF(). + if (isIndirect()) + { + if (this->obj.getPointer()) + { + this->obj = 0; + } + } + else + { + QPDFObject::ObjAccessor::releaseResolved(this->obj.getPointer()); + } +} + +bool +QPDFObjectHandle::isInitialized() const +{ + return this->initialized; +} + +template +class QPDFObjectTypeAccessor +{ + public: + static bool check(QPDFObject* o) + { + return (o && dynamic_cast(o)); + } +}; + +bool +QPDFObjectHandle::isBool() +{ + dereference(); + return QPDFObjectTypeAccessor::check(obj.getPointer()); +} + +bool +QPDFObjectHandle::isNull() +{ + dereference(); + return QPDFObjectTypeAccessor::check(obj.getPointer()); +} + +bool +QPDFObjectHandle::isInteger() +{ + dereference(); + return QPDFObjectTypeAccessor::check(obj.getPointer()); +} + +bool +QPDFObjectHandle::isReal() +{ + dereference(); + return QPDFObjectTypeAccessor::check(obj.getPointer()); +} + +bool +QPDFObjectHandle::isNumber() +{ + return (isInteger() || isReal()); +} + +double +QPDFObjectHandle::getNumericValue() +{ + double result = 0.0; + if (isInteger()) + { + result = getIntValue(); + } + else if (isReal()) + { + result = atof(getRealValue().c_str()); + } + else + { + throw std::logic_error("getNumericValue called for non-numeric object"); + } + return result; +} + +bool +QPDFObjectHandle::isName() +{ + dereference(); + return QPDFObjectTypeAccessor::check(obj.getPointer()); +} + +bool +QPDFObjectHandle::isString() +{ + dereference(); + return QPDFObjectTypeAccessor::check(obj.getPointer()); +} + +bool +QPDFObjectHandle::isArray() +{ + dereference(); + return QPDFObjectTypeAccessor::check(obj.getPointer()); +} + +bool +QPDFObjectHandle::isDictionary() +{ + dereference(); + return QPDFObjectTypeAccessor::check(obj.getPointer()); +} + +bool +QPDFObjectHandle::isStream() +{ + dereference(); + return QPDFObjectTypeAccessor::check(obj.getPointer()); +} + +bool +QPDFObjectHandle::isReserved() +{ + // dereference will clear reserved if this has been replaced + dereference(); + return this->reserved; +} + +bool +QPDFObjectHandle::isIndirect() +{ + assertInitialized(); + return (this->objid != 0); +} + +bool +QPDFObjectHandle::isScalar() +{ + return (! (isArray() || isDictionary() || isStream())); +} + +// Bool accessors + +bool +QPDFObjectHandle::getBoolValue() +{ + assertBool(); + return dynamic_cast(obj.getPointer())->getVal(); +} + +// Integer accessors + +long long +QPDFObjectHandle::getIntValue() +{ + assertInteger(); + return dynamic_cast(obj.getPointer())->getVal(); +} + +// Real accessors + +std::string +QPDFObjectHandle::getRealValue() +{ + assertReal(); + return dynamic_cast(obj.getPointer())->getVal(); +} + +// Name accessors + +std::string +QPDFObjectHandle::getName() +{ + assertName(); + return dynamic_cast(obj.getPointer())->getName(); +} + +// String accessors + +std::string +QPDFObjectHandle::getStringValue() +{ + assertString(); + return dynamic_cast(obj.getPointer())->getVal(); +} + +std::string +QPDFObjectHandle::getUTF8Value() +{ + assertString(); + return dynamic_cast(obj.getPointer())->getUTF8Val(); +} + +// Array accessors + +int +QPDFObjectHandle::getArrayNItems() +{ + assertArray(); + return dynamic_cast(obj.getPointer())->getNItems(); +} + +QPDFObjectHandle +QPDFObjectHandle::getArrayItem(int n) +{ + assertArray(); + return dynamic_cast(obj.getPointer())->getItem(n); +} + +std::vector +QPDFObjectHandle::getArrayAsVector() +{ + assertArray(); + return dynamic_cast(obj.getPointer())->getAsVector(); +} + +// Array mutators + +void +QPDFObjectHandle::setArrayItem(int n, QPDFObjectHandle const& item) +{ + assertArray(); + return dynamic_cast(obj.getPointer())->setItem(n, item); +} + +void +QPDFObjectHandle::setArrayFromVector(std::vector const& items) +{ + assertArray(); + return dynamic_cast(obj.getPointer())->setFromVector(items); +} + +void +QPDFObjectHandle::insertItem(int at, QPDFObjectHandle const& item) +{ + assertArray(); + return dynamic_cast(obj.getPointer())->insertItem(at, item); +} + +void +QPDFObjectHandle::appendItem(QPDFObjectHandle const& item) +{ + assertArray(); + return dynamic_cast(obj.getPointer())->appendItem(item); +} + +void +QPDFObjectHandle::eraseItem(int at) +{ + assertArray(); + return dynamic_cast(obj.getPointer())->eraseItem(at); +} + +// Dictionary accessors + +bool +QPDFObjectHandle::hasKey(std::string const& key) +{ + assertDictionary(); + return dynamic_cast(obj.getPointer())->hasKey(key); +} + +QPDFObjectHandle +QPDFObjectHandle::getKey(std::string const& key) +{ + assertDictionary(); + return dynamic_cast(obj.getPointer())->getKey(key); +} + +std::set +QPDFObjectHandle::getKeys() +{ + assertDictionary(); + return dynamic_cast(obj.getPointer())->getKeys(); +} + +std::map +QPDFObjectHandle::getDictAsMap() +{ + assertDictionary(); + return dynamic_cast(obj.getPointer())->getAsMap(); +} + +// Array and Name accessors +bool +QPDFObjectHandle::isOrHasName(std::string const& value) +{ + if (isName() && (getName() == value)) + { + return true; + } + else if (isArray()) + { + int n = getArrayNItems(); + for (int i = 0; i < n; ++i) + { + QPDFObjectHandle item = getArrayItem(0); + if (item.isName() && (item.getName() == value)) + { + return true; + } + } + } + return false; +} + +// Indirect object accessors +QPDF* +QPDFObjectHandle::getOwningQPDF() +{ + // Will be null for direct objects + return this->qpdf; +} + +// Dictionary mutators + +void +QPDFObjectHandle::replaceKey(std::string const& key, + QPDFObjectHandle const& value) +{ + assertDictionary(); + return dynamic_cast( + obj.getPointer())->replaceKey(key, value); +} + +void +QPDFObjectHandle::removeKey(std::string const& key) +{ + assertDictionary(); + return dynamic_cast(obj.getPointer())->removeKey(key); +} + +void +QPDFObjectHandle::replaceOrRemoveKey(std::string const& key, + QPDFObjectHandle value) +{ + assertDictionary(); + return dynamic_cast( + obj.getPointer())->replaceOrRemoveKey(key, value); +} + +// Stream accessors +QPDFObjectHandle +QPDFObjectHandle::getDict() +{ + assertStream(); + return dynamic_cast(obj.getPointer())->getDict(); +} + +void +QPDFObjectHandle::replaceDict(QPDFObjectHandle new_dict) +{ + assertStream(); + dynamic_cast(obj.getPointer())->replaceDict(new_dict); +} + +PointerHolder +QPDFObjectHandle::getStreamData() +{ + assertStream(); + return dynamic_cast(obj.getPointer())->getStreamData(); +} + +PointerHolder +QPDFObjectHandle::getRawStreamData() +{ + assertStream(); + return dynamic_cast(obj.getPointer())->getRawStreamData(); +} + +bool +QPDFObjectHandle::pipeStreamData(Pipeline* p, bool filter, + bool normalize, bool compress) +{ + assertStream(); + return dynamic_cast(obj.getPointer())->pipeStreamData( + p, filter, normalize, compress); +} + +void +QPDFObjectHandle::replaceStreamData(PointerHolder data, + QPDFObjectHandle const& filter, + QPDFObjectHandle const& decode_parms) +{ + assertStream(); + dynamic_cast(obj.getPointer())->replaceStreamData( + data, filter, decode_parms); +} + +void +QPDFObjectHandle::replaceStreamData(std::string const& data, + QPDFObjectHandle const& filter, + QPDFObjectHandle const& decode_parms) +{ + assertStream(); + PointerHolder b = new Buffer(data.length()); + unsigned char* bp = b->getBuffer(); + memcpy(bp, (char*)data.c_str(), data.length()); + dynamic_cast(obj.getPointer())->replaceStreamData( + b, filter, decode_parms); +} + +void +QPDFObjectHandle::replaceStreamData(PointerHolder provider, + QPDFObjectHandle const& filter, + QPDFObjectHandle const& decode_parms) +{ + assertStream(); + dynamic_cast(obj.getPointer())->replaceStreamData( + provider, filter, decode_parms); +} + +int +QPDFObjectHandle::getObjectID() const +{ + return this->objid; +} + +int +QPDFObjectHandle::getGeneration() const +{ + return this->generation; +} + +std::map +QPDFObjectHandle::getPageImages() +{ + assertPageObject(); + + // Note: this code doesn't handle inherited resources. If this + // page dictionary doesn't have a /Resources key or has one whose + // value is null or an empty dictionary, you are supposed to walk + // up the page tree until you find a /Resources dictionary. As of + // this writing, I don't have any test files that use inherited + // resources, and hand-generating one won't be a good test because + // any mistakes in my understanding would be present in both the + // code and the test file. + + // NOTE: If support of inherited resources (see above comment) is + // implemented, edit comment in QPDFObjectHandle.hh for this + // function. Also remove call to pushInheritedAttributesToPage + // from qpdf.cc when show_page_images is true. + + std::map result; + if (this->hasKey("/Resources")) + { + QPDFObjectHandle resources = this->getKey("/Resources"); + if (resources.hasKey("/XObject")) + { + QPDFObjectHandle xobject = resources.getKey("/XObject"); + std::set keys = xobject.getKeys(); + for (std::set::iterator iter = keys.begin(); + iter != keys.end(); ++iter) + { + std::string key = (*iter); + QPDFObjectHandle value = xobject.getKey(key); + if (value.isStream()) + { + QPDFObjectHandle dict = value.getDict(); + if (dict.hasKey("/Subtype") && + (dict.getKey("/Subtype").getName() == "/Image") && + (! dict.hasKey("/ImageMask"))) + { + result[key] = value; + } + } + } + } + } + + return result; +} + +std::vector +QPDFObjectHandle::getPageContents() +{ + assertPageObject(); + + std::vector result; + QPDFObjectHandle contents = this->getKey("/Contents"); + if (contents.isArray()) + { + int n_items = contents.getArrayNItems(); + for (int i = 0; i < n_items; ++i) + { + QPDFObjectHandle item = contents.getArrayItem(i); + if (item.isStream()) + { + result.push_back(item); + } + else + { + throw std::runtime_error( + "unknown item type while inspecting " + "element of /Contents array in page " + "dictionary"); + } + } + } + else if (contents.isStream()) + { + result.push_back(contents); + } + else + { + throw std::runtime_error("unknown object type inspecting /Contents " + "key in page dictionary"); + } + + return result; +} + +void +QPDFObjectHandle::addPageContents(QPDFObjectHandle new_contents, bool first) +{ + assertPageObject(); + new_contents.assertStream(); + + std::vector orig_contents = getPageContents(); + + std::vector content_streams; + if (first) + { + QTC::TC("qpdf", "QPDFObjectHandle prepend page contents"); + content_streams.push_back(new_contents); + } + for (std::vector::iterator iter = orig_contents.begin(); + iter != orig_contents.end(); ++iter) + { + QTC::TC("qpdf", "QPDFObjectHandle append page contents"); + content_streams.push_back(*iter); + } + if (! first) + { + content_streams.push_back(new_contents); + } + + QPDFObjectHandle contents = QPDFObjectHandle::newArray(content_streams); + this->replaceKey("/Contents", contents); +} + +std::string +QPDFObjectHandle::unparse() +{ + std::string result; + if (this->isIndirect()) + { + result = QUtil::int_to_string(this->objid) + " " + + QUtil::int_to_string(this->generation) + " R"; + } + else + { + result = unparseResolved(); + } + return result; +} + +std::string +QPDFObjectHandle::unparseResolved() +{ + if (this->reserved) + { + throw std::logic_error( + "QPDFObjectHandle: attempting to unparse a reserved object"); + } + dereference(); + return this->obj->unparse(); +} + +QPDFObjectHandle +QPDFObjectHandle::parse(std::string const& object_str, + std::string const& object_description) +{ + PointerHolder input = + new BufferInputSource("parsed object", object_str); + QPDFTokenizer tokenizer; + bool empty = false; + QPDFObjectHandle result = + parse(input, object_description, tokenizer, empty, 0, 0); + size_t offset = (size_t) input->tell(); + while (offset < object_str.length()) + { + if (! isspace(object_str[offset])) + { + QTC::TC("qpdf", "QPDFObjectHandle trailing data in parse"); + throw QPDFExc(qpdf_e_damaged_pdf, input->getName(), + object_description, + input->getLastOffset(), + "trailing data found parsing object from string"); + } + ++offset; + } + return result; +} + +QPDFObjectHandle +QPDFObjectHandle::parse(PointerHolder input, + std::string const& object_description, + QPDFTokenizer& tokenizer, bool& empty, + StringDecrypter* decrypter, QPDF* context) +{ + return parseInternal(input, object_description, tokenizer, empty, + decrypter, context, false, false); +} + +QPDFObjectHandle +QPDFObjectHandle::parseInternal(PointerHolder input, + std::string const& object_description, + QPDFTokenizer& tokenizer, bool& empty, + StringDecrypter* decrypter, QPDF* context, + bool in_array, bool in_dictionary) +{ + empty = false; + if (in_dictionary && in_array) + { + // Although dictionaries and arrays arbitrarily nest, these + // variables indicate what is at the top of the stack right + // now, so they can, by definition, never both be true. + throw std::logic_error( + "INTERNAL ERROR: parseInternal: in_dict && in_array"); + } + + QPDFObjectHandle object; + + qpdf_offset_t offset = input->tell(); + std::vector olist; + bool done = false; + while (! done) + { + object = QPDFObjectHandle(); + + QPDFTokenizer::Token token = + tokenizer.readToken(input, object_description); + + switch (token.getType()) + { + case QPDFTokenizer::tt_brace_open: + case QPDFTokenizer::tt_brace_close: + // Don't know what to do with these for now + QTC::TC("qpdf", "QPDFObjectHandle bad brace"); + throw QPDFExc(qpdf_e_damaged_pdf, input->getName(), + object_description, + input->getLastOffset(), + "unexpected brace token"); + break; + + case QPDFTokenizer::tt_array_close: + if (in_array) + { + done = true; + } + else + { + QTC::TC("qpdf", "QPDFObjectHandle bad array close"); + throw QPDFExc(qpdf_e_damaged_pdf, input->getName(), + object_description, + input->getLastOffset(), + "unexpected array close token"); + } + break; + + case QPDFTokenizer::tt_dict_close: + if (in_dictionary) + { + done = true; + } + else + { + QTC::TC("qpdf", "QPDFObjectHandle bad dictionary close"); + throw QPDFExc(qpdf_e_damaged_pdf, input->getName(), + object_description, + input->getLastOffset(), + "unexpected dictionary close token"); + } + break; + + case QPDFTokenizer::tt_array_open: + object = parseInternal( + input, object_description, tokenizer, empty, + decrypter, context, true, false); + break; + + case QPDFTokenizer::tt_dict_open: + object = parseInternal( + input, object_description, tokenizer, empty, + decrypter, context, false, true); + break; + + case QPDFTokenizer::tt_bool: + object = newBool((token.getValue() == "true")); + break; + + case QPDFTokenizer::tt_null: + object = newNull(); + break; + + case QPDFTokenizer::tt_integer: + object = newInteger(QUtil::string_to_ll(token.getValue().c_str())); + break; + + case QPDFTokenizer::tt_real: + object = newReal(token.getValue()); + break; + + case QPDFTokenizer::tt_name: + object = newName(token.getValue()); + break; + + case QPDFTokenizer::tt_word: + { + std::string const& value = token.getValue(); + if ((value == "R") && (in_array || in_dictionary) && + (olist.size() >= 2) && + (olist[olist.size() - 1].isInteger()) && + (olist[olist.size() - 2].isInteger())) + { + if (context == 0) + { + QTC::TC("qpdf", "QPDFObjectHandle indirect without context"); + throw std::logic_error( + "QPDFObjectHandle::parse called without context" + " on an object with indirect references"); + } + // Try to resolve indirect objects + object = newIndirect( + context, + olist[olist.size() - 2].getIntValue(), + olist[olist.size() - 1].getIntValue()); + olist.pop_back(); + olist.pop_back(); + } + else if ((value == "endobj") && + (! (in_array || in_dictionary))) + { + // We just saw endobj without having read + // anything. Treat this as a null and do not move + // the input source's offset. + object = newNull(); + input->seek(input->getLastOffset(), SEEK_SET); + empty = true; + } + else + { + throw QPDFExc(qpdf_e_damaged_pdf, input->getName(), + object_description, + input->getLastOffset(), + "unknown token while reading object (" + + value + ")"); + } + } + break; + + case QPDFTokenizer::tt_string: + { + std::string val = token.getValue(); + if (decrypter) + { + decrypter->decryptString(val); + } + object = QPDFObjectHandle::newString(val); + } + + break; + + default: + throw QPDFExc(qpdf_e_damaged_pdf, input->getName(), + object_description, + input->getLastOffset(), + "unknown token type while reading object"); + break; + } + + if (in_dictionary || in_array) + { + if (! done) + { + olist.push_back(object); + } + } + else if (! object.isInitialized()) + { + throw std::logic_error( + "INTERNAL ERROR: uninitialized object (token = " + + QUtil::int_to_string(token.getType()) + + ", " + token.getValue() + ")"); + } + else + { + done = true; + } + } + + if (in_array) + { + object = newArray(olist); + } + else if (in_dictionary) + { + // Convert list to map. Alternating elements are keys. + std::map dict; + if (olist.size() % 2) + { + QTC::TC("qpdf", "QPDFObjectHandle dictionary odd number of elements"); + throw QPDFExc( + qpdf_e_damaged_pdf, input->getName(), + object_description, input->getLastOffset(), + "dictionary ending here has an odd number of elements"); + } + for (unsigned int i = 0; i < olist.size(); i += 2) + { + QPDFObjectHandle key_obj = olist[i]; + QPDFObjectHandle val = olist[i + 1]; + if (! key_obj.isName()) + { + throw QPDFExc( + qpdf_e_damaged_pdf, + input->getName(), object_description, offset, + std::string("dictionary key not name (") + + key_obj.unparse() + ")"); + } + dict[key_obj.getName()] = val; + } + object = newDictionary(dict); + } + + return object; +} + +QPDFObjectHandle +QPDFObjectHandle::newIndirect(QPDF* qpdf, int objid, int generation) +{ + return QPDFObjectHandle(qpdf, objid, generation); +} + +QPDFObjectHandle +QPDFObjectHandle::newBool(bool value) +{ + return QPDFObjectHandle(new QPDF_Bool(value)); +} + +QPDFObjectHandle +QPDFObjectHandle::newNull() +{ + return QPDFObjectHandle(new QPDF_Null()); +} + +QPDFObjectHandle +QPDFObjectHandle::newInteger(long long value) +{ + return QPDFObjectHandle(new QPDF_Integer(value)); +} + +QPDFObjectHandle +QPDFObjectHandle::newReal(std::string const& value) +{ + return QPDFObjectHandle(new QPDF_Real(value)); +} + +QPDFObjectHandle +QPDFObjectHandle::newReal(double value, int decimal_places) +{ + return QPDFObjectHandle(new QPDF_Real(value, decimal_places)); +} + +QPDFObjectHandle +QPDFObjectHandle::newName(std::string const& name) +{ + return QPDFObjectHandle(new QPDF_Name(name)); +} + +QPDFObjectHandle +QPDFObjectHandle::newString(std::string const& str) +{ + return QPDFObjectHandle(new QPDF_String(str)); +} + +QPDFObjectHandle +QPDFObjectHandle::newArray() +{ + return newArray(std::vector()); +} + +QPDFObjectHandle +QPDFObjectHandle::newArray(std::vector const& items) +{ + return QPDFObjectHandle(new QPDF_Array(items)); +} + +QPDFObjectHandle +QPDFObjectHandle::newDictionary() +{ + return newDictionary(std::map()); +} + +QPDFObjectHandle +QPDFObjectHandle::newDictionary( + std::map const& items) +{ + return QPDFObjectHandle(new QPDF_Dictionary(items)); +} + + +QPDFObjectHandle +QPDFObjectHandle::newStream(QPDF* qpdf, int objid, int generation, + QPDFObjectHandle stream_dict, + qpdf_offset_t offset, size_t length) +{ + return QPDFObjectHandle(new QPDF_Stream( + qpdf, objid, generation, + stream_dict, offset, length)); +} + +QPDFObjectHandle +QPDFObjectHandle::newStream(QPDF* qpdf) +{ + QTC::TC("qpdf", "QPDFObjectHandle newStream"); + QPDFObjectHandle stream_dict = newDictionary(); + QPDFObjectHandle result = qpdf->makeIndirectObject( + QPDFObjectHandle( + new QPDF_Stream(qpdf, 0, 0, stream_dict, 0, 0))); + result.dereference(); + QPDF_Stream* stream = dynamic_cast(result.obj.getPointer()); + stream->setObjGen(result.getObjectID(), result.getGeneration()); + return result; +} + +QPDFObjectHandle +QPDFObjectHandle::newStream(QPDF* qpdf, PointerHolder data) +{ + QTC::TC("qpdf", "QPDFObjectHandle newStream with data"); + QPDFObjectHandle result = newStream(qpdf); + result.replaceStreamData(data, newNull(), newNull()); + return result; +} + +QPDFObjectHandle +QPDFObjectHandle::newStream(QPDF* qpdf, std::string const& data) +{ + QTC::TC("qpdf", "QPDFObjectHandle newStream with string"); + QPDFObjectHandle result = newStream(qpdf); + result.replaceStreamData(data, newNull(), newNull()); + return result; +} + +QPDFObjectHandle +QPDFObjectHandle::newReserved(QPDF* qpdf) +{ + // Reserve a spot for this object by assigning it an object + // number, but then return an unresolved handle to the object. + QPDFObjectHandle reserved = qpdf->makeIndirectObject( + QPDFObjectHandle(new QPDF_Reserved())); + QPDFObjectHandle result = + newIndirect(qpdf, reserved.objid, reserved.generation); + result.reserved = true; + return result; +} + +QPDFObjectHandle +QPDFObjectHandle::shallowCopy() +{ + assertInitialized(); + + if (isStream()) + { + QTC::TC("qpdf", "QPDFObjectHandle ERR shallow copy stream"); + throw std::runtime_error( + "attempt to make a shallow copy of a stream"); + } + + QPDFObjectHandle new_obj; + if (isArray()) + { + QTC::TC("qpdf", "QPDFObjectHandle shallow copy array"); + new_obj = newArray(getArrayAsVector()); + } + else if (isDictionary()) + { + QTC::TC("qpdf", "QPDFObjectHandle shallow copy dictionary"); + new_obj = newDictionary(getDictAsMap()); + } + else + { + QTC::TC("qpdf", "QPDFObjectHandle shallow copy scalar"); + new_obj = *this; + } + + return new_obj; +} + +void +QPDFObjectHandle::makeDirectInternal(std::set& visited) +{ + assertInitialized(); + + if (isStream()) + { + QTC::TC("qpdf", "QPDFObjectHandle ERR clone stream"); + throw std::runtime_error( + "attempt to make a stream into a direct object"); + } + + int cur_objid = this->objid; + if (cur_objid != 0) + { + if (visited.count(cur_objid)) + { + QTC::TC("qpdf", "QPDFObjectHandle makeDirect loop"); + throw std::runtime_error( + "loop detected while converting object from " + "indirect to direct"); + } + visited.insert(cur_objid); + } + + if (isReserved()) + { + throw std::logic_error( + "QPDFObjectHandle: attempting to make a" + " reserved object handle direct"); + } + + dereference(); + this->qpdf = 0; + this->objid = 0; + this->generation = 0; + + PointerHolder new_obj; + + if (isBool()) + { + QTC::TC("qpdf", "QPDFObjectHandle clone bool"); + new_obj = new QPDF_Bool(getBoolValue()); + } + else if (isNull()) + { + QTC::TC("qpdf", "QPDFObjectHandle clone null"); + new_obj = new QPDF_Null(); + } + else if (isInteger()) + { + QTC::TC("qpdf", "QPDFObjectHandle clone integer"); + new_obj = new QPDF_Integer(getIntValue()); + } + else if (isReal()) + { + QTC::TC("qpdf", "QPDFObjectHandle clone real"); + new_obj = new QPDF_Real(getRealValue()); + } + else if (isName()) + { + QTC::TC("qpdf", "QPDFObjectHandle clone name"); + new_obj = new QPDF_Name(getName()); + } + else if (isString()) + { + QTC::TC("qpdf", "QPDFObjectHandle clone string"); + new_obj = new QPDF_String(getStringValue()); + } + else if (isArray()) + { + QTC::TC("qpdf", "QPDFObjectHandle clone array"); + std::vector items; + int n = getArrayNItems(); + for (int i = 0; i < n; ++i) + { + items.push_back(getArrayItem(i)); + items.back().makeDirectInternal(visited); + } + new_obj = new QPDF_Array(items); + } + else if (isDictionary()) + { + QTC::TC("qpdf", "QPDFObjectHandle clone dictionary"); + std::set keys = getKeys(); + std::map items; + for (std::set::iterator iter = keys.begin(); + iter != keys.end(); ++iter) + { + items[*iter] = getKey(*iter); + items[*iter].makeDirectInternal(visited); + } + new_obj = new QPDF_Dictionary(items); + } + else + { + throw std::logic_error("QPDFObjectHandle::makeDirectInternal: " + "unknown object type"); + } + + this->obj = new_obj; + + if (cur_objid) + { + visited.erase(cur_objid); + } +} + +void +QPDFObjectHandle::makeDirect() +{ + std::set visited; + makeDirectInternal(visited); +} + +void +QPDFObjectHandle::assertInitialized() const +{ + if (! this->initialized) + { + throw std::logic_error("operation attempted on uninitialized " + "QPDFObjectHandle"); + } +} + +void +QPDFObjectHandle::assertType(char const* type_name, bool istype) const +{ + if (! istype) + { + throw std::logic_error(std::string("operation for ") + type_name + + " object attempted on object of wrong type"); + } +} + +void +QPDFObjectHandle::assertNull() +{ + assertType("Null", isNull()); +} + +void +QPDFObjectHandle::assertBool() +{ + assertType("Boolean", isBool()); +} + +void +QPDFObjectHandle::assertInteger() +{ + assertType("Integer", isInteger()); +} + +void +QPDFObjectHandle::assertReal() +{ + assertType("Real", isReal()); +} + +void +QPDFObjectHandle::assertName() +{ + assertType("Name", isName()); +} + +void +QPDFObjectHandle::assertString() +{ + assertType("String", isString()); +} + +void +QPDFObjectHandle::assertArray() +{ + assertType("Array", isArray()); +} + +void +QPDFObjectHandle::assertDictionary() +{ + assertType("Dictionary", isDictionary()); +} + +void +QPDFObjectHandle::assertStream() +{ + assertType("Stream", isStream()); +} + +void +QPDFObjectHandle::assertReserved() +{ + assertType("Reserved", isReserved()); +} + +void +QPDFObjectHandle::assertIndirect() +{ + if (! isIndirect()) + { + throw std::logic_error( + "operation for indirect object attempted on direct object"); + } +} + +void +QPDFObjectHandle::assertScalar() +{ + assertType("Scalar", isScalar()); +} + +void +QPDFObjectHandle::assertNumber() +{ + assertType("Number", isNumber()); +} + +bool +QPDFObjectHandle::isPageObject() +{ + return (this->isDictionary() && this->hasKey("/Type") && + (this->getKey("/Type").getName() == "/Page")); +} + +bool +QPDFObjectHandle::isPagesObject() +{ + return (this->isDictionary() && this->hasKey("/Type") && + (this->getKey("/Type").getName() == "/Pages")); +} + +void +QPDFObjectHandle::assertPageObject() +{ + if (! isPageObject()) + { + throw std::logic_error("page operation called on non-Page object"); + } +} + +void +QPDFObjectHandle::dereference() +{ + if (this->obj.getPointer() == 0) + { + PointerHolder obj = QPDF::Resolver::resolve( + this->qpdf, this->objid, this->generation); + if (obj.getPointer() == 0) + { + QTC::TC("qpdf", "QPDFObjectHandle indirect to unknown"); + this->obj = new QPDF_Null(); + } + else if (dynamic_cast(obj.getPointer())) + { + // Do not resolve + } + else + { + this->reserved = false; + this->obj = obj; + } + } +} diff --git a/libqpdf/QPDFTokenizer.cc b/libqpdf/QPDFTokenizer.cc new file mode 100644 index 0000000..1a20bb5 --- /dev/null +++ b/libqpdf/QPDFTokenizer.cc @@ -0,0 +1,522 @@ +#include + +// DO NOT USE ctype -- it is locale dependent for some things, and +// it's not worth the risk of including it in case it may accidentally +// be used. + +#include +#include +#include + +#include +#include + +// See note above about ctype. +static bool is_hex_digit(char ch) +{ + return (strchr("0123456789abcdefABCDEF", ch) != 0); +} +static bool is_space(char ch) +{ + return (strchr(" \f\n\r\t\v", ch) != 0); +} + +QPDFTokenizer::QPDFTokenizer() : + pound_special_in_name(true) +{ + reset(); +} + +void +QPDFTokenizer::allowPoundAnywhereInName() +{ + QTC::TC("qpdf", "QPDFTokenizer allow pound anywhere in name"); + this->pound_special_in_name = false; +} + +void +QPDFTokenizer::reset() +{ + state = st_top; + type = tt_bad; + val = ""; + raw_val = ""; + error_message = ""; + unread_char = false; + char_to_unread = '\0'; + string_depth = 0; + string_ignoring_newline = false; + last_char_was_bs = false; +} + +void +QPDFTokenizer::resolveLiteral() +{ + PCRE num_re("^[\\+\\-]?(?:\\.\\d+|\\d+(?:\\.\\d+)?)$"); + + if ((val.length() > 0) && (val[0] == '/')) + { + type = tt_name; + // Deal with # in name token. Note: '/' by itself is a + // valid name, so don't strip leading /. That way we + // don't have to deal with the empty string as a name. + std::string nval = "/"; + char const* valstr = val.c_str() + 1; + for (char const* p = valstr; *p; ++p) + { + if ((*p == '#') && this->pound_special_in_name) + { + if (p[1] && p[2] && + is_hex_digit(p[1]) && is_hex_digit(p[2])) + { + char num[3]; + num[0] = p[1]; + num[1] = p[2]; + num[2] = '\0'; + char ch = (char)(strtol(num, 0, 16)); + if (ch == '\0') + { + type = tt_bad; + QTC::TC("qpdf", "QPDF_Tokenizer null in name"); + error_message = + "null character not allowed in name token"; + nval += "#00"; + } + else + { + nval += ch; + } + p += 2; + } + else + { + QTC::TC("qpdf", "QPDF_Tokenizer bad name"); + type = tt_bad; + error_message = "invalid name token"; + nval += *p; + } + } + else + { + nval += *p; + } + } + val = nval; + } + else if (num_re.match(val.c_str())) + { + if (val.find('.') != std::string::npos) + { + type = tt_real; + } + else + { + type = tt_integer; + } + } + else if ((val == "true") || (val == "false")) + { + type = tt_bool; + } + else if (val == "null") + { + type = tt_null; + } + else + { + // I don't really know what it is, so leave it as tt_word. + // Lots of cases ($, #, etc.) other than actual words fall + // into this category, but that's okay at least for now. + type = tt_word; + } +} + +void +QPDFTokenizer::presentCharacter(char ch) +{ + if (state == st_token_ready) + { + throw std::logic_error( + "INTERNAL ERROR: QPDF tokenizer presented character " + "while token is waiting"); + } + + char orig_ch = ch; + + // State machine is implemented such that some characters may be + // handled more than once. This happens whenever you have to use + // the character that caused a state change in the new state. + + bool handled = true; + if (state == st_top) + { + // Note: we specifically do not use ctype here. It is + // locale-dependent. + if (strchr(" \t\n\v\f\r", ch)) + { + // ignore + } + else if (ch == '%') + { + // Discard comments + state = st_in_comment; + } + else if (ch == '(') + { + string_depth = 1; + string_ignoring_newline = false; + memset(bs_num_register, '\0', sizeof(bs_num_register)); + last_char_was_bs = false; + state = st_in_string; + } + else if (ch == '<') + { + state = st_lt; + } + else if (ch == '>') + { + state = st_gt; + } + else + { + val += ch; + if (ch == ')') + { + type = tt_bad; + QTC::TC("qpdf", "QPDF_Tokenizer bad )"); + error_message = "unexpected )"; + state = st_token_ready; + } + else if (ch == '[') + { + type = tt_array_open; + state = st_token_ready; + } + else if (ch == ']') + { + type = tt_array_close; + state = st_token_ready; + } + else if (ch == '{') + { + type = tt_brace_open; + state = st_token_ready; + } + else if (ch == '}') + { + type = tt_brace_close; + state = st_token_ready; + } + else + { + state = st_literal; + } + } + } + else if (state == st_in_comment) + { + if ((ch == '\r') || (ch == '\n')) + { + state = st_top; + } + } + else if (state == st_lt) + { + if (ch == '<') + { + val = "<<"; + type = tt_dict_open; + state = st_token_ready; + } + else + { + handled = false; + state = st_in_hexstring; + } + } + else if (state == st_gt) + { + if (ch == '>') + { + val = ">>"; + type = tt_dict_close; + state = st_token_ready; + } + else + { + val = ">"; + type = tt_bad; + QTC::TC("qpdf", "QPDF_Tokenizer bad >"); + error_message = "unexpected >"; + unread_char = true; + char_to_unread = ch; + state = st_token_ready; + } + } + else if (state == st_in_string) + { + if (string_ignoring_newline && (! ((ch == '\r') || (ch == '\n')))) + { + string_ignoring_newline = false; + } + + size_t bs_num_count = strlen(bs_num_register); + bool ch_is_octal = ((ch >= '0') && (ch <= '7')); + if ((bs_num_count == 3) || ((bs_num_count > 0) && (! ch_is_octal))) + { + // We've accumulated \ddd. PDF Spec says to ignore + // high-order overflow. + val += (char) strtol(bs_num_register, 0, 8); + memset(bs_num_register, '\0', sizeof(bs_num_register)); + bs_num_count = 0; + } + + if (string_ignoring_newline && ((ch == '\r') || (ch == '\n'))) + { + // ignore + } + else if (ch_is_octal && (last_char_was_bs || (bs_num_count > 0))) + { + bs_num_register[bs_num_count++] = ch; + } + else if (last_char_was_bs) + { + switch (ch) + { + case 'n': + val += '\n'; + break; + + case 'r': + val += '\r'; + break; + + case 't': + val += '\t'; + break; + + case 'b': + val += '\b'; + break; + + case 'f': + val += '\f'; + break; + + case '\r': + case '\n': + string_ignoring_newline = true; + break; + + default: + // PDF spec says backslash is ignored before anything else + val += ch; + break; + } + } + else if (ch == '\\') + { + // last_char_was_bs is set/cleared below as appropriate + if (bs_num_count) + { + throw std::logic_error( + "INTERNAL ERROR: QPDFTokenizer: bs_num_count != 0 " + "when ch == '\\'"); + } + } + else if (ch == '(') + { + val += ch; + ++string_depth; + } + else if ((ch == ')') && (--string_depth == 0)) + { + type = tt_string; + state = st_token_ready; + } + else + { + val += ch; + } + + last_char_was_bs = ((! last_char_was_bs) && (ch == '\\')); + } + else if (state == st_literal) + { + if (strchr(" \t\n\v\f\r()<>[]{}/%", ch) != 0) + { + // A C-locale whitespace character or delimiter terminates + // token. It is important to unread the whitespace + // character even though it is ignored since it may be the + // newline after a stream keyword. Removing it here could + // make the stream-reading code break on some files, + // though not on any files in the test suite as of this + // writing. + + type = tt_word; + unread_char = true; + char_to_unread = ch; + state = st_token_ready; + } + else + { + val += ch; + } + } + else + { + handled = false; + } + + + if (handled) + { + // okay + } + else if (state == st_in_hexstring) + { + if (ch == '>') + { + type = tt_string; + state = st_token_ready; + if (val.length() % 2) + { + // PDF spec says odd hexstrings have implicit + // trailing 0. + val += '0'; + } + char num[3]; + num[2] = '\0'; + std::string nval; + for (unsigned int i = 0; i < val.length(); i += 2) + { + num[0] = val[i]; + num[1] = val[i+1]; + char nch = (char)(strtol(num, 0, 16)); + nval += nch; + } + val = nval; + } + else if (is_hex_digit(ch)) + { + val += ch; + } + else if (strchr(" \t\n\v\f\r", ch)) + { + // ignore + } + else + { + type = tt_bad; + QTC::TC("qpdf", "QPDF_Tokenizer bad ("); + error_message = std::string("invalid character (") + + ch + ") in hexstring"; + state = st_token_ready; + } + } + else + { + throw std::logic_error( + "INTERNAL ERROR: invalid state while reading token"); + } + + if ((state == st_token_ready) && (type == tt_word)) + { + resolveLiteral(); + } + + if (! (betweenTokens() || ((state == st_token_ready) && unread_char))) + { + this->raw_val += orig_ch; + } +} + +void +QPDFTokenizer::presentEOF() +{ + if (state == st_literal) + { + QTC::TC("qpdf", "QPDF_Tokenizer EOF reading appendable token"); + resolveLiteral(); + } + else if (state != st_token_ready) + { + QTC::TC("qpdf", "QPDF_Tokenizer EOF reading token"); + type = tt_bad; + error_message = "EOF while reading token"; + } + + state = st_token_ready; +} + +bool +QPDFTokenizer::getToken(Token& token, bool& unread_char, char& ch) +{ + bool ready = (this->state == st_token_ready); + unread_char = this->unread_char; + ch = this->char_to_unread; + if (ready) + { + token = Token(type, val, raw_val, error_message); + reset(); + } + return ready; +} + +bool +QPDFTokenizer::betweenTokens() +{ + return ((state == st_top) || (state == st_in_comment)); +} + +QPDFTokenizer::Token +QPDFTokenizer::readToken(PointerHolder input, + std::string const& context) +{ + qpdf_offset_t offset = input->tell(); + Token token; + bool unread_char; + char char_to_unread; + bool presented_eof = false; + while (! getToken(token, unread_char, char_to_unread)) + { + char ch; + if (input->read(&ch, 1) == 0) + { + if (! presented_eof) + { + presentEOF(); + presented_eof = true; + } + else + { + throw std::logic_error( + "getToken returned false after presenting EOF"); + } + } + else + { + if (is_space((unsigned char)ch) && + (input->getLastOffset() == offset)) + { + ++offset; + } + presentCharacter(ch); + } + } + + if (unread_char) + { + input->unreadCh(char_to_unread); + } + + if (token.getType() == tt_bad) + { + throw QPDFExc(qpdf_e_damaged_pdf, input->getName(), + context, offset, token.getErrorMessage()); + } + + input->setLastOffset(offset); + + return token; +} diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc new file mode 100644 index 0000000..eb08488 --- /dev/null +++ b/libqpdf/QPDFWriter.cc @@ -0,0 +1,2476 @@ +#include // include first for large file support +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +QPDFWriter::QPDFWriter(QPDF& pdf) : + pdf(pdf) +{ + init(); +} + +QPDFWriter::QPDFWriter(QPDF& pdf, char const* filename) : + pdf(pdf) +{ + init(); + setOutputFilename(filename); +} + +QPDFWriter::QPDFWriter(QPDF& pdf, char const* description, + FILE *file, bool close_file) : + pdf(pdf) +{ + init(); + setOutputFile(description, file, close_file); +} + +void +QPDFWriter::init() +{ + filename = 0; + file = 0; + close_file = false; + buffer_pipeline = 0; + output_buffer = 0; + normalize_content_set = false; + normalize_content = false; + stream_data_mode_set = false; + stream_data_mode = qpdf_s_compress; + qdf_mode = false; + static_id = false; + suppress_original_object_ids = false; + direct_stream_lengths = true; + encrypted = false; + preserve_encryption = true; + linearized = false; + object_stream_mode = qpdf_o_preserve; + encrypt_metadata = true; + encrypt_use_aes = false; + encryption_dict_objid = 0; + next_objid = 1; + cur_stream_length_id = 0; + cur_stream_length = 0; + added_newline = false; + max_ostream_index = 0; +} + +QPDFWriter::~QPDFWriter() +{ + if (file && close_file) + { + fclose(file); + } + if (output_buffer) + { + delete output_buffer; + } +} + +void +QPDFWriter::setOutputFilename(char const* filename) +{ + char const* description = filename; + FILE* f = 0; + if (filename == 0) + { + description = "standard output"; + QTC::TC("qpdf", "QPDFWriter write to stdout"); + f = stdout; + QUtil::binary_stdout(); + } + else + { + QTC::TC("qpdf", "QPDFWriter write to file"); + f = QUtil::fopen_wrapper(std::string("open ") + filename, + fopen(filename, "wb+")); + close_file = true; + } + setOutputFile(description, f, close_file); +} + +void +QPDFWriter::setOutputFile(char const* description, FILE* file, bool close_file) +{ + this->filename = description; + this->file = file; + this->close_file = close_file; + Pipeline* p = new Pl_StdioFile("qpdf output", file); + to_delete.push_back(p); + initializePipelineStack(p); +} + +void +QPDFWriter::setOutputMemory() +{ + this->filename = "memory buffer"; + this->buffer_pipeline = new Pl_Buffer("qpdf output"); + to_delete.push_back(this->buffer_pipeline); + initializePipelineStack(this->buffer_pipeline); +} + +Buffer* +QPDFWriter::getBuffer() +{ + Buffer* result = this->output_buffer; + this->output_buffer = 0; + return result; +} + +void +QPDFWriter::setObjectStreamMode(qpdf_object_stream_e mode) +{ + this->object_stream_mode = mode; +} + +void +QPDFWriter::setStreamDataMode(qpdf_stream_data_e mode) +{ + this->stream_data_mode_set = true; + this->stream_data_mode = mode; +} + +void +QPDFWriter::setContentNormalization(bool val) +{ + this->normalize_content_set = true; + this->normalize_content = val; +} + +void +QPDFWriter::setQDFMode(bool val) +{ + this->qdf_mode = val; +} + +void +QPDFWriter::setMinimumPDFVersion(std::string const& version) +{ + bool set_version = false; + if (this->min_pdf_version.empty()) + { + set_version = true; + } + else + { + int old_major = 0; + int old_minor = 0; + int min_major = 0; + int min_minor = 0; + parseVersion(version, old_major, old_minor); + parseVersion(this->min_pdf_version, min_major, min_minor); + if (compareVersions(old_major, old_minor, min_major, min_minor) > 0) + { + QTC::TC("qpdf", "QPDFWriter increasing minimum version"); + set_version = true; + } + } + + if (set_version) + { + this->min_pdf_version = version; + } +} + +void +QPDFWriter::forcePDFVersion(std::string const& version) +{ + this->forced_pdf_version = version; +} + +void +QPDFWriter::setExtraHeaderText(std::string const& text) +{ + this->extra_header_text = text; + if ((this->extra_header_text.length() > 0) && + (*(this->extra_header_text.rbegin()) != '\n')) + { + QTC::TC("qpdf", "QPDFWriter extra header text add newline"); + this->extra_header_text += "\n"; + } + else + { + QTC::TC("qpdf", "QPDFWriter extra header text no newline"); + } +} + +void +QPDFWriter::setStaticID(bool val) +{ + this->static_id = val; +} + +void +QPDFWriter::setStaticAesIV(bool val) +{ + if (val) + { + Pl_AES_PDF::useStaticIV(); + } +} + +void +QPDFWriter::setSuppressOriginalObjectIDs(bool val) +{ + this->suppress_original_object_ids = val; +} + +void +QPDFWriter::setPreserveEncryption(bool val) +{ + this->preserve_encryption = val; +} + +void +QPDFWriter::setLinearization(bool val) +{ + this->linearized = val; +} + +void +QPDFWriter::setR2EncryptionParameters( + char const* user_password, char const* owner_password, + bool allow_print, bool allow_modify, + bool allow_extract, bool allow_annotate) +{ + std::set clear; + if (! allow_print) + { + clear.insert(3); + } + if (! allow_modify) + { + clear.insert(4); + } + if (! allow_extract) + { + clear.insert(5); + } + if (! allow_annotate) + { + clear.insert(6); + } + + setEncryptionParameters(user_password, owner_password, 1, 2, 5, clear); +} + +void +QPDFWriter::setR3EncryptionParameters( + char const* user_password, char const* owner_password, + bool allow_accessibility, bool allow_extract, + qpdf_r3_print_e print, qpdf_r3_modify_e modify) +{ + std::set clear; + interpretR3EncryptionParameters( + clear, user_password, owner_password, + allow_accessibility, allow_extract, print, modify); + setEncryptionParameters(user_password, owner_password, 2, 3, 16, clear); +} + +void +QPDFWriter::setR4EncryptionParameters( + char const* user_password, char const* owner_password, + bool allow_accessibility, bool allow_extract, + qpdf_r3_print_e print, qpdf_r3_modify_e modify, + bool encrypt_metadata, bool use_aes) +{ + std::set clear; + interpretR3EncryptionParameters( + clear, user_password, owner_password, + allow_accessibility, allow_extract, print, modify); + this->encrypt_use_aes = use_aes; + this->encrypt_metadata = encrypt_metadata; + setEncryptionParameters(user_password, owner_password, 4, 4, 16, clear); +} + +void +QPDFWriter::interpretR3EncryptionParameters( + std::set& clear, + char const* user_password, char const* owner_password, + bool allow_accessibility, bool allow_extract, + qpdf_r3_print_e print, qpdf_r3_modify_e modify) +{ + // Acrobat 5 security options: + + // Checkboxes: + // Enable Content Access for the Visually Impaired + // Allow Content Copying and Extraction + + // Allowed changes menu: + // None + // Only Document Assembly + // Only Form Field Fill-in or Signing + // Comment Authoring, Form Field Fill-in or Signing + // General Editing, Comment and Form Field Authoring + + // Allowed printing menu: + // None + // Low Resolution + // Full printing + + if (! allow_accessibility) + { + clear.insert(10); + } + if (! allow_extract) + { + clear.insert(5); + } + + // Note: these switch statements all "fall through" (no break + // statements). Each option clears successively more access bits. + switch (print) + { + case qpdf_r3p_none: + clear.insert(3); // any printing + + case qpdf_r3p_low: + clear.insert(12); // high resolution printing + + case qpdf_r3p_full: + break; + + // no default so gcc warns for missing cases + } + + switch (modify) + { + case qpdf_r3m_none: + clear.insert(11); // document assembly + + case qpdf_r3m_assembly: + clear.insert(9); // filling in form fields + + case qpdf_r3m_form: + clear.insert(6); // modify annotations, fill in form fields + + case qpdf_r3m_annotate: + clear.insert(4); // other modifications + + case qpdf_r3m_all: + break; + + // no default so gcc warns for missing cases + } +} + +void +QPDFWriter::setEncryptionParameters( + char const* user_password, char const* owner_password, + int V, int R, int key_len, std::set& bits_to_clear) +{ + // PDF specification refers to bits with the low bit numbered 1. + // We have to convert this into a bit field. + + // Specification always requires bits 1 and 2 to be cleared. + bits_to_clear.insert(1); + bits_to_clear.insert(2); + + int P = 0; + // Create the complement of P, then invert. + for (std::set::iterator iter = bits_to_clear.begin(); + iter != bits_to_clear.end(); ++iter) + { + P |= (1 << ((*iter) - 1)); + } + P = ~P; + + generateID(); + std::string O; + std::string U; + QPDF::compute_encryption_O_U( + user_password, owner_password, V, R, key_len, P, + this->encrypt_metadata, this->id1, O, U); + setEncryptionParametersInternal( + V, R, key_len, P, O, U, this->id1, user_password); +} + +void +QPDFWriter::copyEncryptionParameters(QPDF& qpdf) +{ + this->preserve_encryption = false; + generateID(); + QPDFObjectHandle trailer = qpdf.getTrailer(); + if (trailer.hasKey("/Encrypt")) + { + this->id1 = + trailer.getKey("/ID").getArrayItem(0).getStringValue(); + QPDFObjectHandle encrypt = trailer.getKey("/Encrypt"); + int V = encrypt.getKey("/V").getIntValue(); + int key_len = 5; + if (V > 1) + { + key_len = encrypt.getKey("/Length").getIntValue() / 8; + } + if (encrypt.hasKey("/EncryptMetadata") && + encrypt.getKey("/EncryptMetadata").isBool()) + { + this->encrypt_metadata = + encrypt.getKey("/EncryptMetadata").getBoolValue(); + } + if (V >= 4) + { + if (encrypt.hasKey("/CF") && + encrypt.getKey("/CF").isDictionary() && + encrypt.hasKey("/StmF") && + encrypt.getKey("/StmF").isName()) + { + // Determine whether to use AES from StmF. QPDFWriter + // can't write files with different StrF and StmF. + QPDFObjectHandle CF = encrypt.getKey("/CF"); + QPDFObjectHandle StmF = encrypt.getKey("/StmF"); + if (CF.hasKey(StmF.getName()) && + CF.getKey(StmF.getName()).isDictionary()) + { + QPDFObjectHandle StmF_data = CF.getKey(StmF.getName()); + if (StmF_data.hasKey("/CFM") && + StmF_data.getKey("/CFM").isName() && + StmF_data.getKey("/CFM").getName() == "/AESV2") + { + this->encrypt_use_aes = true; + } + } + } + } + QTC::TC("qpdf", "QPDFWriter copy encrypt metadata", + this->encrypt_metadata ? 0 : 1); + QTC::TC("qpdf", "QPDFWriter copy use_aes", + this->encrypt_use_aes ? 0 : 1); + setEncryptionParametersInternal( + V, + encrypt.getKey("/R").getIntValue(), + key_len, + encrypt.getKey("/P").getIntValue(), + encrypt.getKey("/O").getStringValue(), + encrypt.getKey("/U").getStringValue(), + this->id1, // this->id1 == the other file's id1 + qpdf.getPaddedUserPassword()); + } +} + +void +QPDFWriter::disableIncompatibleEncryption(int major, int minor) +{ + if (! this->encrypted) + { + return; + } + + bool disable = false; + if (compareVersions(major, minor, 1, 3) < 0) + { + disable = true; + } + else + { + int V = atoi(encryption_dictionary["/V"].c_str()); + int R = atoi(encryption_dictionary["/R"].c_str()); + if (compareVersions(major, minor, 1, 4) < 0) + { + if ((V > 1) || (R > 2)) + { + disable = true; + } + } + else if (compareVersions(major, minor, 1, 5) < 0) + { + if ((V > 2) || (R > 3)) + { + disable = true; + } + } + else if (compareVersions(major, minor, 1, 6) < 0) + { + if (this->encrypt_use_aes) + { + disable = true; + } + } + } + if (disable) + { + QTC::TC("qpdf", "QPDFWriter forced version disabled encryption"); + this->encrypted = false; + } +} + +void +QPDFWriter::parseVersion(std::string const& version, + int& major, int& minor) const +{ + major = atoi(version.c_str()); + minor = 0; + size_t p = version.find('.'); + if ((p != std::string::npos) && (version.length() > p)) + { + minor = atoi(version.substr(p + 1).c_str()); + } + std::string tmp = QUtil::int_to_string(major) + "." + + QUtil::int_to_string(minor); + if (tmp != version) + { + throw std::logic_error( + "INTERNAL ERROR: QPDFWriter::parseVersion" + " called with invalid version number " + version); + } +} + +int +QPDFWriter::compareVersions(int major1, int minor1, + int major2, int minor2) const +{ + if (major1 < major2) + { + return -1; + } + else if (major1 > major2) + { + return 1; + } + else if (minor1 < minor2) + { + return -1; + } + else if (minor1 > minor2) + { + return 1; + } + else + { + return 0; + } +} + +void +QPDFWriter::setEncryptionParametersInternal( + int V, int R, int key_len, long P, + std::string const& O, std::string const& U, + std::string const& id1, std::string const& user_password) +{ + encryption_dictionary["/Filter"] = "/Standard"; + encryption_dictionary["/V"] = QUtil::int_to_string(V); + encryption_dictionary["/Length"] = QUtil::int_to_string(key_len * 8); + encryption_dictionary["/R"] = QUtil::int_to_string(R); + encryption_dictionary["/P"] = QUtil::int_to_string(P); + encryption_dictionary["/O"] = QPDF_String(O).unparse(true); + encryption_dictionary["/U"] = QPDF_String(U).unparse(true); + setMinimumPDFVersion("1.3"); + if (R == 3) + { + setMinimumPDFVersion("1.4"); + } + else if (R >= 4) + { + setMinimumPDFVersion(this->encrypt_use_aes ? "1.6" : "1.5"); + } + + if ((R >= 4) && (! encrypt_metadata)) + { + encryption_dictionary["/EncryptMetadata"] = "false"; + } + if (V == 4) + { + // The spec says the value for the crypt filter key can be + // anything, and xpdf seems to agree. However, Adobe Reader + // won't open our files unless we use /StdCF. + encryption_dictionary["/StmF"] = "/StdCF"; + encryption_dictionary["/StrF"] = "/StdCF"; + std::string method = (this->encrypt_use_aes ? "/AESV2" : "/V2"); + encryption_dictionary["/CF"] = + "<< /StdCF << /AuthEvent /DocOpen /CFM " + method + " >> >>"; + } + + this->encrypted = true; + QPDF::EncryptionData encryption_data( + V, R, key_len, P, O, U, id1, this->encrypt_metadata); + this->encryption_key = QPDF::compute_encryption_key( + user_password, encryption_data); +} + +void +QPDFWriter::setDataKey(int objid) +{ + this->cur_data_key = QPDF::compute_data_key( + this->encryption_key, objid, 0, this->encrypt_use_aes); +} + +int +QPDFWriter::bytesNeeded(unsigned long long n) +{ + int bytes = 0; + while (n) + { + ++bytes; + n >>= 8; + } + return bytes; +} + +void +QPDFWriter::writeBinary(unsigned long long val, unsigned int bytes) +{ + assert(bytes <= sizeof(unsigned long long)); + unsigned char data[sizeof(unsigned long long)]; + for (unsigned int i = 0; i < bytes; ++i) + { + data[bytes - i - 1] = (unsigned char)(val & 0xff); + val >>= 8; + } + this->pipeline->write(data, bytes); +} + +void +QPDFWriter::writeString(std::string const& str) +{ + this->pipeline->write((unsigned char*)str.c_str(), str.length()); +} + +void +QPDFWriter::writeBuffer(PointerHolder& b) +{ + this->pipeline->write(b->getBuffer(), b->getSize()); +} + +void +QPDFWriter::writeStringQDF(std::string const& str) +{ + if (this->qdf_mode) + { + writeString(str); + } +} + +void +QPDFWriter::writeStringNoQDF(std::string const& str) +{ + if (! this->qdf_mode) + { + writeString(str); + } +} + +void +QPDFWriter::writePad(int nspaces) +{ + for (int i = 0; i < nspaces; ++i) + { + writeString(" "); + } +} + +Pipeline* +QPDFWriter::pushPipeline(Pipeline* p) +{ + assert(dynamic_cast(p) == 0); + this->pipeline_stack.push_back(p); + return p; +} + +void +QPDFWriter::initializePipelineStack(Pipeline *p) +{ + this->pipeline = new Pl_Count("qpdf count", p); + to_delete.push_back(this->pipeline); + this->pipeline_stack.push_back(this->pipeline); +} + +void +QPDFWriter::activatePipelineStack() +{ + Pl_Count* c = new Pl_Count("count", this->pipeline_stack.back()); + this->pipeline_stack.push_back(c); + this->pipeline = c; +} + +void +QPDFWriter::popPipelineStack(PointerHolder* bp) +{ + assert(this->pipeline_stack.size() >= 2); + this->pipeline->finish(); + assert(dynamic_cast(this->pipeline_stack.back()) == + this->pipeline); + delete this->pipeline_stack.back(); + this->pipeline_stack.pop_back(); + while (dynamic_cast(this->pipeline_stack.back()) == 0) + { + Pipeline* p = this->pipeline_stack.back(); + this->pipeline_stack.pop_back(); + Pl_Buffer* buf = dynamic_cast(p); + if (bp && buf) + { + *bp = buf->getBuffer(); + } + delete p; + } + this->pipeline = dynamic_cast(this->pipeline_stack.back()); +} + +void +QPDFWriter::adjustAESStreamLength(size_t& length) +{ + if (this->encrypted && (! this->cur_data_key.empty()) && + this->encrypt_use_aes) + { + // Stream length will be padded with 1 to 16 bytes to end up + // as a multiple of 16. It will also be prepended by 16 bits + // of random data. + length += 32 - (length & 0xf); + } +} + +void +QPDFWriter::pushEncryptionFilter() +{ + if (this->encrypted && (! this->cur_data_key.empty())) + { + Pipeline* p = 0; + if (this->encrypt_use_aes) + { + p = new Pl_AES_PDF( + "aes stream encryption", this->pipeline, true, + (unsigned char*) this->cur_data_key.c_str()); + } + else + { + p = new Pl_RC4("rc4 stream encryption", this->pipeline, + (unsigned char*) this->cur_data_key.c_str(), + (int)this->cur_data_key.length()); + } + pushPipeline(p); + } + // Must call this unconditionally so we can call popPipelineStack + // to balance pushEncryptionFilter(). + activatePipelineStack(); +} + +void +QPDFWriter::pushDiscardFilter() +{ + pushPipeline(new Pl_Discard()); + activatePipelineStack(); +} + +int +QPDFWriter::openObject(int objid) +{ + if (objid == 0) + { + objid = this->next_objid++; + } + this->xref[objid] = QPDFXRefEntry(1, pipeline->getCount(), 0); + writeString(QUtil::int_to_string(objid)); + writeString(" 0 obj\n"); + return objid; +} + +void +QPDFWriter::closeObject(int objid) +{ + // Write a newline before endobj as it makes the file easier to + // repair. + writeString("\nendobj\n"); + writeStringQDF("\n"); + this->lengths[objid] = pipeline->getCount() - this->xref[objid].getOffset(); +} + +void +QPDFWriter::assignCompressedObjectNumbers(int objid) +{ + if (this->object_stream_to_objects.count(objid) == 0) + { + return; + } + + // Reserve numbers for the objects that belong to this object + // stream. + for (std::set::iterator iter = + this->object_stream_to_objects[objid].begin(); + iter != this->object_stream_to_objects[objid].end(); + ++iter) + { + obj_renumber[*iter] = next_objid++; + } +} + +void +QPDFWriter::enqueueObject(QPDFObjectHandle object) +{ + if (object.isIndirect()) + { + if (object.getOwningQPDF() != &(this->pdf)) + { + QTC::TC("qpdf", "QPDFWriter foreign object"); + throw std::logic_error( + "QPDFObjectHandle from different QPDF found while writing." + " Use QPDF::copyForeignObject to add objects from" + " another file."); + } + + if (object.isNull()) + { + // This is a place-holder object for an object stream + } + else if (object.isScalar()) + { + // flattenScalarReferences is supposed to have removed all + // indirect scalars. + throw std::logic_error( + "INTERNAL ERROR: QPDFWriter::enqueueObject: indirect scalar: " + + std::string(this->filename) + " " + + QUtil::int_to_string(object.getObjectID()) + " " + + QUtil::int_to_string(object.getGeneration())); + } + int objid = object.getObjectID(); + + if (obj_renumber.count(objid) == 0) + { + if (this->object_to_object_stream.count(objid)) + { + // This is in an object stream. Don't process it + // here. Instead, enqueue the object stream. + int stream_id = this->object_to_object_stream[objid]; + enqueueObject(this->pdf.getObjectByID(stream_id, 0)); + } + else + { + object_queue.push_back(object); + obj_renumber[objid] = next_objid++; + + if (this->object_stream_to_objects.count(objid)) + { + // For linearized files, uncompressed objects go + // at end, and we take care of assigning numbers + // to them elsewhere. + if (! this->linearized) + { + assignCompressedObjectNumbers(objid); + } + } + else if ((! this->direct_stream_lengths) && object.isStream()) + { + // reserve next object ID for length + ++next_objid; + } + } + } + } + else if (object.isArray()) + { + int n = object.getArrayNItems(); + for (int i = 0; i < n; ++i) + { + if (! this->linearized) + { + enqueueObject(object.getArrayItem(i)); + } + } + } + else if (object.isDictionary()) + { + std::set keys = object.getKeys(); + for (std::set::iterator iter = keys.begin(); + iter != keys.end(); ++iter) + { + if (! this->linearized) + { + enqueueObject(object.getKey(*iter)); + } + } + } + else + { + // ignore + } +} + +void +QPDFWriter::unparseChild(QPDFObjectHandle child, int level, int flags) +{ + if (! this->linearized) + { + enqueueObject(child); + } + if (child.isIndirect()) + { + if (child.isScalar()) + { + // flattenScalarReferences is supposed to have removed all + // indirect scalars. + throw std::logic_error( + "INTERNAL ERROR: QPDFWriter::unparseChild: indirect scalar: " + + QUtil::int_to_string(child.getObjectID()) + " " + + QUtil::int_to_string(child.getGeneration())); + } + int old_id = child.getObjectID(); + int new_id = obj_renumber[old_id]; + writeString(QUtil::int_to_string(new_id)); + writeString(" 0 R"); + } + else + { + unparseObject(child, level, flags); + } +} + +void +QPDFWriter::writeTrailer(trailer_e which, int size, bool xref_stream, + qpdf_offset_t prev) +{ + QPDFObjectHandle trailer = pdf.getTrailer(); + if (! xref_stream) + { + writeString("trailer <<"); + } + writeStringQDF("\n"); + if (which == t_lin_second) + { + writeString(" /Size "); + writeString(QUtil::int_to_string(size)); + } + else + { + std::set keys = trailer.getKeys(); + for (std::set::iterator iter = keys.begin(); + iter != keys.end(); ++iter) + { + std::string const& key = *iter; + writeStringQDF(" "); + writeStringNoQDF(" "); + writeString(QPDF_Name::normalizeName(key)); + writeString(" "); + if (key == "/Size") + { + writeString(QUtil::int_to_string(size)); + if (which == t_lin_first) + { + writeString(" /Prev "); + qpdf_offset_t pos = this->pipeline->getCount(); + writeString(QUtil::int_to_string(prev)); + int nspaces = (int)(pos - this->pipeline->getCount() + 21); + assert(nspaces >= 0); + writePad(nspaces); + } + } + else + { + unparseChild(trailer.getKey(key), 1, 0); + } + writeStringQDF("\n"); + } + } + + // Write ID + writeStringQDF(" "); + writeString(" /ID ["); + writeString(QPDF_String(this->id1).unparse(true)); + writeString(QPDF_String(this->id2).unparse(true)); + writeString("]"); + + if (which != t_lin_second) + { + // Write reference to encryption dictionary + if (this->encrypted) + { + writeString(" /Encrypt "); + writeString(QUtil::int_to_string(this->encryption_dict_objid)); + writeString(" 0 R"); + } + } + + writeStringQDF("\n"); + writeStringNoQDF(" "); + writeString(">>"); +} + +void +QPDFWriter::unparseObject(QPDFObjectHandle object, int level, + unsigned int flags) +{ + unparseObject(object, level, flags, 0, false); +} + +void +QPDFWriter::unparseObject(QPDFObjectHandle object, int level, + unsigned int flags, size_t stream_length, + bool compress) +{ + unsigned int child_flags = flags & ~f_stream; + + std::string indent; + for (int i = 0; i < level; ++i) + { + indent += " "; + } + + if (object.isArray()) + { + // Note: PDF spec 1.4 implementation note 121 states that + // Acrobat requires a space after the [ in the /H key of the + // linearization parameter dictionary. We'll do this + // unconditionally for all arrays because it looks nicer and + // doesn't make the files that much bigger. + writeString("["); + writeStringQDF("\n"); + int n = object.getArrayNItems(); + for (int i = 0; i < n; ++i) + { + writeStringQDF(indent); + writeStringQDF(" "); + writeStringNoQDF(" "); + unparseChild(object.getArrayItem(i), level + 1, child_flags); + writeStringQDF("\n"); + } + writeStringQDF(indent); + writeStringNoQDF(" "); + writeString("]"); + } + else if (object.isDictionary()) + { + writeString("<<"); + writeStringQDF("\n"); + std::set keys = object.getKeys(); + for (std::set::iterator iter = keys.begin(); + iter != keys.end(); ++iter) + { + // I'm not fully clear on /Crypt keys in /DecodeParms. If + // one is found, we refuse to filter, so we should be + // safe. + std::string const& key = *iter; + if ((flags & f_filtered) && + ((key == "/Filter") || + (key == "/DecodeParms"))) + { + continue; + } + if ((flags & f_stream) && (key == "/Length")) + { + continue; + } + writeStringQDF(indent); + writeStringQDF(" "); + writeStringNoQDF(" "); + writeString(QPDF_Name::normalizeName(key)); + writeString(" "); + unparseChild(object.getKey(key), level + 1, child_flags); + writeStringQDF("\n"); + } + + if (flags & f_stream) + { + writeStringQDF(indent); + writeStringQDF(" "); + writeString(" /Length "); + + if (this->direct_stream_lengths) + { + writeString(QUtil::int_to_string(stream_length)); + } + else + { + writeString( + QUtil::int_to_string(this->cur_stream_length_id)); + writeString(" 0 R"); + } + writeStringQDF("\n"); + if (compress && (flags & f_filtered)) + { + writeStringQDF(indent); + writeStringQDF(" "); + writeString(" /Filter /FlateDecode"); + writeStringQDF("\n"); + } + } + + writeStringQDF(indent); + writeStringNoQDF(" "); + writeString(">>"); + } + else if (object.isStream()) + { + // Write stream data to a buffer. + int old_id = object.getObjectID(); + int new_id = obj_renumber[old_id]; + if (! this->direct_stream_lengths) + { + this->cur_stream_length_id = new_id + 1; + } + QPDFObjectHandle stream_dict = object.getDict(); + + bool is_metadata = false; + if (stream_dict.getKey("/Type").isName() && + (stream_dict.getKey("/Type").getName() == "/Metadata")) + { + is_metadata = true; + } + bool filter = (this->stream_data_mode != qpdf_s_preserve); + if (this->stream_data_mode == qpdf_s_compress) + { + // Don't filter if the stream is already compressed with + // FlateDecode. We don't want to make it worse by getting + // rid of a predictor or otherwise messing with it. We + // should also avoid messing with anything that's + // compressed with a lossy compression scheme, but we + // don't support any of those right now. + QPDFObjectHandle filter_obj = stream_dict.getKey("/Filter"); + if (filter_obj.isName() && + ((filter_obj.getName() == "/FlateDecode") || + (filter_obj.getName() == "/Fl"))) + { + QTC::TC("qpdf", "QPDFWriter not recompressing /FlateDecode"); + filter = false; + } + } + bool normalize = false; + bool compress = false; + if (is_metadata && + ((! this->encrypted) || (this->encrypt_metadata == false))) + { + QTC::TC("qpdf", "QPDFWriter not compressing metadata"); + filter = true; + compress = false; + } + else if (this->normalize_content && normalized_streams.count(old_id)) + { + normalize = true; + filter = true; + } + else if (filter && (this->stream_data_mode == qpdf_s_compress)) + { + compress = true; + QTC::TC("qpdf", "QPDFWriter compressing uncompressed stream"); + } + + flags |= f_stream; + + pushPipeline(new Pl_Buffer("stream data")); + activatePipelineStack(); + bool filtered = + object.pipeStreamData(this->pipeline, filter, normalize, compress); + PointerHolder stream_data; + popPipelineStack(&stream_data); + if (filtered) + { + flags |= f_filtered; + } + else + { + compress = false; + } + + this->cur_stream_length = stream_data->getSize(); + if (is_metadata && this->encrypted && (! this->encrypt_metadata)) + { + // Don't encrypt stream data for the metadata stream + this->cur_data_key.clear(); + } + adjustAESStreamLength(this->cur_stream_length); + unparseObject(stream_dict, 0, flags, this->cur_stream_length, compress); + writeString("\nstream\n"); + pushEncryptionFilter(); + writeBuffer(stream_data); + char last_char = this->pipeline->getLastChar(); + popPipelineStack(); + + if (this->qdf_mode) + { + if (last_char != '\n') + { + writeString("\n"); + this->added_newline = true; + } + else + { + this->added_newline = false; + } + } + writeString("endstream"); + } + else if (object.isString()) + { + std::string val; + if (this->encrypted && + (! (flags & f_in_ostream)) && + (! this->cur_data_key.empty())) + { + val = object.getStringValue(); + if (this->encrypt_use_aes) + { + Pl_Buffer bufpl("encrypted string"); + Pl_AES_PDF pl("aes encrypt string", &bufpl, true, + (unsigned char const*)this->cur_data_key.c_str()); + pl.write((unsigned char*) val.c_str(), val.length()); + pl.finish(); + Buffer* buf = bufpl.getBuffer(); + val = QPDF_String( + std::string((char*)buf->getBuffer(), + buf->getSize())).unparse(true); + delete buf; + } + else + { + char* tmp = QUtil::copy_string(val); + size_t vlen = val.length(); + RC4 rc4((unsigned char const*)this->cur_data_key.c_str(), + (int)this->cur_data_key.length()); + rc4.process((unsigned char*)tmp, (int)vlen); + val = QPDF_String(std::string(tmp, vlen)).unparse(); + delete [] tmp; + } + } + else + { + val = object.unparseResolved(); + } + writeString(val); + } + else + { + writeString(object.unparseResolved()); + } +} + +void +QPDFWriter::writeObjectStreamOffsets(std::vector& offsets, + int first_obj) +{ + for (unsigned int i = 0; i < offsets.size(); ++i) + { + if (i != 0) + { + writeStringQDF("\n"); + writeStringNoQDF(" "); + } + writeString(QUtil::int_to_string(i + first_obj)); + writeString(" "); + writeString(QUtil::int_to_string(offsets[i])); + } + writeString("\n"); +} + +void +QPDFWriter::writeObjectStream(QPDFObjectHandle object) +{ + // Note: object might be null if this is a place-holder for an + // object stream that we are generating from scratch. + + int old_id = object.getObjectID(); + int new_id = obj_renumber[old_id]; + + std::vector offsets; + qpdf_offset_t first = 0; + + // Generate stream itself. We have to do this in two passes so we + // can calculate offsets in the first pass. + PointerHolder stream_buffer; + int first_obj = -1; + bool compressed = false; + for (int pass = 1; pass <= 2; ++pass) + { + if (pass == 1) + { + pushDiscardFilter(); + } + else + { + // Adjust offsets to skip over comment before first object + + first = offsets[0]; + for (std::vector::iterator iter = offsets.begin(); + iter != offsets.end(); ++iter) + { + *iter -= first; + } + + // Take one pass at writing pairs of numbers so we can get + // their size information + pushDiscardFilter(); + writeObjectStreamOffsets(offsets, first_obj); + first += this->pipeline->getCount(); + popPipelineStack(); + + // Set up a stream to write the stream data into a buffer. + Pipeline* next = pushPipeline(new Pl_Buffer("object stream")); + if (! ((this->stream_data_mode == qpdf_s_uncompress) || + this->qdf_mode)) + { + compressed = true; + next = pushPipeline( + new Pl_Flate("compress object stream", next, + Pl_Flate::a_deflate)); + } + activatePipelineStack(); + writeObjectStreamOffsets(offsets, first_obj); + } + + int count = 0; + for (std::set::iterator iter = + this->object_stream_to_objects[old_id].begin(); + iter != this->object_stream_to_objects[old_id].end(); + ++iter, ++count) + { + int obj = *iter; + int new_obj = this->obj_renumber[obj]; + if (first_obj == -1) + { + first_obj = new_obj; + } + if (this->qdf_mode) + { + writeString("%% Object stream: object " + + QUtil::int_to_string(new_obj) + ", index " + + QUtil::int_to_string(count)); + if (! this->suppress_original_object_ids) + { + writeString("; original object ID: " + + QUtil::int_to_string(obj)); + } + writeString("\n"); + } + if (pass == 1) + { + offsets.push_back(this->pipeline->getCount()); + } + writeObject(this->pdf.getObjectByID(obj, 0), count); + + this->xref[new_obj] = QPDFXRefEntry(2, new_id, count); + } + + // stream_buffer will be initialized only for pass 2 + popPipelineStack(&stream_buffer); + } + + // Write the object + openObject(new_id); + setDataKey(new_id); + writeString("<<"); + writeStringQDF("\n "); + writeString(" /Type /ObjStm"); + writeStringQDF("\n "); + size_t length = stream_buffer->getSize(); + adjustAESStreamLength(length); + writeString(" /Length " + QUtil::int_to_string(length)); + writeStringQDF("\n "); + if (compressed) + { + writeString(" /Filter /FlateDecode"); + } + writeString(" /N " + QUtil::int_to_string(offsets.size())); + writeStringQDF("\n "); + writeString(" /First " + QUtil::int_to_string(first)); + if (! object.isNull()) + { + // If the original object has an /Extends key, preserve it. + QPDFObjectHandle dict = object.getDict(); + QPDFObjectHandle extends = dict.getKey("/Extends"); + if (extends.isIndirect()) + { + QTC::TC("qpdf", "QPDFWriter copy Extends"); + writeStringQDF("\n "); + writeString(" /Extends "); + unparseChild(extends, 1, f_in_ostream); + } + } + writeStringQDF("\n"); + writeStringNoQDF(" "); + writeString(">>\nstream\n"); + if (this->encrypted) + { + QTC::TC("qpdf", "QPDFWriter encrypt object stream"); + } + pushEncryptionFilter(); + writeBuffer(stream_buffer); + popPipelineStack(); + writeString("endstream"); + this->cur_data_key.clear(); + closeObject(new_id); +} + +void +QPDFWriter::writeObject(QPDFObjectHandle object, int object_stream_index) +{ + int old_id = object.getObjectID(); + + if ((object_stream_index == -1) && + (this->object_stream_to_objects.count(old_id))) + { + writeObjectStream(object); + return; + } + + int new_id = obj_renumber[old_id]; + if (this->qdf_mode) + { + if (this->page_object_to_seq.count(old_id)) + { + writeString("%% Page "); + writeString( + QUtil::int_to_string( + this->page_object_to_seq[old_id])); + writeString("\n"); + } + if (this->contents_to_page_seq.count(old_id)) + { + writeString("%% Contents for page "); + writeString( + QUtil::int_to_string( + this->contents_to_page_seq[old_id])); + writeString("\n"); + } + } + if (object_stream_index == -1) + { + if (this->qdf_mode && (! this->suppress_original_object_ids)) + { + writeString("%% Original object ID: " + + QUtil::int_to_string(object.getObjectID()) + " " + + QUtil::int_to_string(object.getGeneration()) + "\n"); + } + openObject(new_id); + setDataKey(new_id); + unparseObject(object, 0, 0); + this->cur_data_key.clear(); + closeObject(new_id); + } + else + { + unparseObject(object, 0, f_in_ostream); + writeString("\n"); + } + + if ((! this->direct_stream_lengths) && object.isStream()) + { + if (this->qdf_mode) + { + if (this->added_newline) + { + writeString("%QDF: ignore_newline\n"); + } + } + openObject(new_id + 1); + writeString(QUtil::int_to_string(this->cur_stream_length)); + closeObject(new_id + 1); + } +} + +void +QPDFWriter::generateID() +{ + // Note: we can't call generateID() at the time of construction + // since the caller hasn't yet had a chance to call setStaticID(), + // but we need to generate it before computing encryption + // dictionary parameters. This is why we call this function both + // from setEncryptionParameters() and from write() and return + // immediately if the ID has already been generated. + + if (! this->id2.empty()) + { + return; + } + + QPDFObjectHandle trailer = pdf.getTrailer(); + + std::string result; + + if (this->static_id) + { + // For test suite use only... + static unsigned char tmp[] = {0x31, 0x41, 0x59, 0x26, + 0x53, 0x58, 0x97, 0x93, + 0x23, 0x84, 0x62, 0x64, + 0x33, 0x83, 0x27, 0x95, + 0x00}; + result = (char*)tmp; + } + else + { + // The PDF specification has guidelines for creating IDs, but it + // states clearly that the only thing that's really important is + // that it is very likely to be unique. We can't really follow + // the guidelines in the spec exactly because we haven't written + // the file yet. This scheme should be fine though. + + std::string seed; + seed += QUtil::int_to_string((int)QUtil::get_current_time()); + seed += " QPDF "; + seed += this->filename; + seed += " "; + if (trailer.hasKey("/Info")) + { + QPDFObjectHandle info = trailer.getKey("/Info"); + std::set keys = info.getKeys(); + for (std::set::iterator iter = keys.begin(); + iter != keys.end(); ++iter) + { + QPDFObjectHandle obj = info.getKey(*iter); + if (obj.isString()) + { + seed += " "; + seed += obj.getStringValue(); + } + } + } + + MD5 m; + m.encodeString(seed.c_str()); + MD5::Digest digest; + m.digest(digest); + result = std::string((char*)digest, sizeof(MD5::Digest)); + } + + // If /ID already exists, follow the spec: use the original first + // word and generate a new second word. Otherwise, we'll use the + // generated ID for both. + + this->id2 = result; + if (trailer.hasKey("/ID")) + { + // Note: keep /ID from old file even if --static-id was given. + this->id1 = trailer.getKey("/ID").getArrayItem(0).getStringValue(); + } + else + { + this->id1 = this->id2; + } +} + +void +QPDFWriter::initializeSpecialStreams() +{ + // Mark all page content streams in case we are filtering or + // normalizing. + std::vector pages = pdf.getAllPages(); + int num = 0; + for (std::vector::iterator iter = pages.begin(); + iter != pages.end(); ++iter) + { + QPDFObjectHandle& page = *iter; + this->page_object_to_seq[page.getObjectID()] = ++num; + QPDFObjectHandle contents = page.getKey("/Contents"); + std::vector contents_objects; + if (contents.isArray()) + { + int n = contents.getArrayNItems(); + for (int i = 0; i < n; ++i) + { + contents_objects.push_back( + contents.getArrayItem(i).getObjectID()); + } + } + else if (contents.isStream()) + { + contents_objects.push_back(contents.getObjectID()); + } + + for (std::vector::iterator iter = contents_objects.begin(); + iter != contents_objects.end(); ++iter) + { + this->contents_to_page_seq[*iter] = num; + this->normalized_streams.insert(*iter); + } + } +} + +void +QPDFWriter::preserveObjectStreams() +{ + this->pdf.getObjectStreamData(this->object_to_object_stream); +} + +void +QPDFWriter::generateObjectStreams() +{ + // Basic strategy: make a list of objects that can go into an + // object stream. Then figure out how many object streams are + // needed so that we can distribute objects approximately evenly + // without having any object stream exceed 100 members. We don't + // have to worry about linearized files here -- if the file is + // linearized, we take care of excluding things that aren't + // allowed here later. + + // This code doesn't do anything with /Extends. + + std::vector const& eligible = this->pdf.getCompressibleObjects(); + unsigned int n_object_streams = + (unsigned int)((eligible.size() + 99) / 100); + unsigned int n_per = (unsigned int)(eligible.size() / n_object_streams); + if (n_per * n_object_streams < eligible.size()) + { + ++n_per; + } + unsigned int n = 0; + int cur_ostream = 0; + for (std::vector::const_iterator iter = eligible.begin(); + iter != eligible.end(); ++iter) + { + if ((n % n_per) == 0) + { + if (n > 0) + { + QTC::TC("qpdf", "QPDFWriter generate >1 ostream"); + } + n = 0; + } + if (n == 0) + { + // Construct a new null object as the "original" object + // stream. The rest of the code knows that this means + // we're creating the object stream from scratch. + cur_ostream = this->pdf.makeIndirectObject( + QPDFObjectHandle::newNull()).getObjectID(); + } + this->object_to_object_stream[*iter] = cur_ostream; + ++n; + } +} + +void +QPDFWriter::write() +{ + // Do preliminary setup + + if (this->linearized) + { + this->qdf_mode = false; + } + + if (this->qdf_mode) + { + if (! this->normalize_content_set) + { + this->normalize_content = true; + } + if (! this->stream_data_mode_set) + { + this->stream_data_mode = qpdf_s_uncompress; + } + } + + if (this->encrypted) + { + // Encryption has been explicitly set + this->preserve_encryption = false; + } + else if (this->normalize_content || + (this->stream_data_mode == qpdf_s_uncompress) || + this->qdf_mode) + { + // Encryption makes looking at contents pretty useless. If + // the user explicitly encrypted though, we still obey that. + this->preserve_encryption = false; + } + + if (preserve_encryption) + { + copyEncryptionParameters(this->pdf); + } + + if (! this->forced_pdf_version.empty()) + { + int major = 0; + int minor = 0; + parseVersion(this->forced_pdf_version, major, minor); + disableIncompatibleEncryption(major, minor); + if (compareVersions(major, minor, 1, 5) < 0) + { + QTC::TC("qpdf", "QPDFWriter forcing object stream disable"); + this->object_stream_mode = qpdf_o_disable; + } + } + + if (this->qdf_mode || this->normalize_content || + (this->stream_data_mode == qpdf_s_uncompress)) + { + initializeSpecialStreams(); + } + + if (this->qdf_mode) + { + // Generate indirect stream lengths for qdf mode since fix-qdf + // uses them for storing recomputed stream length data. + // Certain streams such as object streams, xref streams, and + // hint streams always get direct stream lengths. + this->direct_stream_lengths = false; + } + + switch (this->object_stream_mode) + { + case qpdf_o_disable: + // no action required + break; + + case qpdf_o_preserve: + preserveObjectStreams(); + break; + + case qpdf_o_generate: + generateObjectStreams(); + break; + + // no default so gcc will warn for missing case tag + } + + if (this->linearized) + { + // Page dictionaries are not allowed to be compressed objects. + std::vector pages = pdf.getAllPages(); + for (std::vector::iterator iter = pages.begin(); + iter != pages.end(); ++iter) + { + QPDFObjectHandle& page = *iter; + int objid = page.getObjectID(); + if (this->object_to_object_stream.count(objid)) + { + QTC::TC("qpdf", "QPDFWriter uncompressing page dictionary"); + this->object_to_object_stream.erase(objid); + } + } + } + + if (this->linearized || this->encrypted) + { + // The document catalog is not allowed to be compressed in + // linearized files either. It also appears that Adobe Reader + // 8.0.0 has a bug that prevents it from being able to handle + // encrypted files with compressed document catalogs, so we + // disable them in that case as well. + int objid = pdf.getRoot().getObjectID(); + if (this->object_to_object_stream.count(objid)) + { + QTC::TC("qpdf", "QPDFWriter uncompressing root"); + this->object_to_object_stream.erase(objid); + } + } + + // Generate reverse mapping from object stream to objects + for (std::map::iterator iter = + this->object_to_object_stream.begin(); + iter != this->object_to_object_stream.end(); ++iter) + { + int obj = (*iter).first; + int stream = (*iter).second; + this->object_stream_to_objects[stream].insert(obj); + this->max_ostream_index = + std::max(this->max_ostream_index, + (int)this->object_stream_to_objects[stream].size() - 1); + } + + if (! this->object_stream_to_objects.empty()) + { + setMinimumPDFVersion("1.5"); + } + + generateID(); + + pdf.trimTrailerForWrite(); + pdf.flattenScalarReferences(); + + if (this->linearized) + { + writeLinearized(); + } + else + { + writeStandard(); + } + + this->pipeline->finish(); + if (this->close_file) + { + fclose(this->file); + } + this->file = 0; + if (this->buffer_pipeline) + { + this->output_buffer = this->buffer_pipeline->getBuffer(); + this->buffer_pipeline = 0; + } +} + +void +QPDFWriter::enqueuePart(std::vector& part) +{ + for (std::vector::iterator iter = part.begin(); + iter != part.end(); ++iter) + { + enqueueObject(*iter); + } +} + +void +QPDFWriter::writeEncryptionDictionary() +{ + this->encryption_dict_objid = openObject(this->encryption_dict_objid); + writeString("<<"); + for (std::map::iterator iter = + this->encryption_dictionary.begin(); + iter != this->encryption_dictionary.end(); ++iter) + { + writeString(" "); + writeString((*iter).first); + writeString(" "); + writeString((*iter).second); + } + writeString(" >>"); + closeObject(this->encryption_dict_objid); +} + +void +QPDFWriter::writeHeader() +{ + setMinimumPDFVersion(pdf.getPDFVersion()); + std::string version = this->min_pdf_version; + if (! this->forced_pdf_version.empty()) + { + QTC::TC("qpdf", "QPDFWriter using forced PDF version"); + version = this->forced_pdf_version; + } + + writeString("%PDF-"); + writeString(version); + // This string of binary characters would not be valid UTF-8, so + // it really should be treated as binary. + writeString("\n%\xbf\xf7\xa2\xfe\n"); + writeStringQDF("%QDF-1.0\n\n"); + + // Note: do not write extra header text here. Linearized PDFs + // must include the entire linearization parameter dictionary + // within the first 1024 characters of the PDF file, so for + // linearized files, we have to write extra header text after the + // linearization parameter dictionary. +} + +void +QPDFWriter::writeHintStream(int hint_id) +{ + PointerHolder hint_buffer; + int S = 0; + int O = 0; + pdf.generateHintStream( + this->xref, this->lengths, this->obj_renumber, hint_buffer, S, O); + + openObject(hint_id); + setDataKey(hint_id); + + size_t hlen = hint_buffer->getSize(); + + writeString("<< /Filter /FlateDecode /S "); + writeString(QUtil::int_to_string(S)); + if (O) + { + writeString(" /O "); + writeString(QUtil::int_to_string(O)); + } + writeString(" /Length "); + adjustAESStreamLength(hlen); + writeString(QUtil::int_to_string(hlen)); + writeString(" >>\nstream\n"); + + if (this->encrypted) + { + QTC::TC("qpdf", "QPDFWriter encrypted hint stream"); + } + pushEncryptionFilter(); + writeBuffer(hint_buffer); + char last_char = this->pipeline->getLastChar(); + popPipelineStack(); + + if (last_char != '\n') + { + writeString("\n"); + } + writeString("endstream"); + closeObject(hint_id); +} + +qpdf_offset_t +QPDFWriter::writeXRefTable(trailer_e which, int first, int last, int size) +{ + return writeXRefTable(which, first, last, size, 0, false, 0, 0, 0); +} + +qpdf_offset_t +QPDFWriter::writeXRefTable(trailer_e which, int first, int last, int size, + qpdf_offset_t prev, bool suppress_offsets, + int hint_id, qpdf_offset_t hint_offset, + qpdf_offset_t hint_length) +{ + writeString("xref\n"); + writeString(QUtil::int_to_string(first)); + writeString(" "); + writeString(QUtil::int_to_string(last - first + 1)); + qpdf_offset_t space_before_zero = this->pipeline->getCount(); + writeString("\n"); + for (int i = first; i <= last; ++i) + { + if (i == 0) + { + writeString("0000000000 65535 f \n"); + } + else + { + qpdf_offset_t offset = 0; + if (! suppress_offsets) + { + offset = this->xref[i].getOffset(); + if ((hint_id != 0) && + (i != hint_id) && + (offset >= hint_offset)) + { + offset += hint_length; + } + } + writeString(QUtil::int_to_string(offset, 10)); + writeString(" 00000 n \n"); + } + } + writeTrailer(which, size, false, prev); + writeString("\n"); + return space_before_zero; +} + +qpdf_offset_t +QPDFWriter::writeXRefStream(int objid, int max_id, qpdf_offset_t max_offset, + trailer_e which, int first, int last, int size) +{ + return writeXRefStream(objid, max_id, max_offset, + which, first, last, size, 0, 0, 0, 0, false); +} + +qpdf_offset_t +QPDFWriter::writeXRefStream(int xref_id, int max_id, qpdf_offset_t max_offset, + trailer_e which, int first, int last, int size, + qpdf_offset_t prev, int hint_id, + qpdf_offset_t hint_offset, + qpdf_offset_t hint_length, + bool skip_compression) +{ + qpdf_offset_t xref_offset = this->pipeline->getCount(); + qpdf_offset_t space_before_zero = xref_offset - 1; + + // field 1 contains offsets and object stream identifiers + int f1_size = std::max(bytesNeeded(max_offset), + bytesNeeded(max_id)); + + // field 2 contains object stream indices + int f2_size = bytesNeeded(this->max_ostream_index); + + unsigned int esize = 1 + f1_size + f2_size; + + // Must store in xref table in advance of writing the actual data + // rather than waiting for openObject to do it. + this->xref[xref_id] = QPDFXRefEntry(1, pipeline->getCount(), 0); + + Pipeline* p = pushPipeline(new Pl_Buffer("xref stream")); + bool compressed = false; + if (! ((this->stream_data_mode == qpdf_s_uncompress) || this->qdf_mode)) + { + compressed = true; + if (! skip_compression) + { + // Write the stream dictionary for compression but don't + // actually compress. This helps us with computation of + // padding for pass 1 of linearization. + p = pushPipeline( + new Pl_Flate("compress xref", p, Pl_Flate::a_deflate)); + } + p = pushPipeline( + new Pl_PNGFilter( + "pngify xref", p, Pl_PNGFilter::a_encode, esize, 0)); + } + activatePipelineStack(); + for (int i = first; i <= last; ++i) + { + QPDFXRefEntry& e = this->xref[i]; + switch (e.getType()) + { + case 0: + writeBinary(0, 1); + writeBinary(0, f1_size); + writeBinary(0, f2_size); + break; + + case 1: + { + qpdf_offset_t offset = e.getOffset(); + if ((hint_id != 0) && + (i != hint_id) && + (offset >= hint_offset)) + { + offset += hint_length; + } + writeBinary(1, 1); + writeBinary(offset, f1_size); + writeBinary(0, f2_size); + } + break; + + case 2: + writeBinary(2, 1); + writeBinary(e.getObjStreamNumber(), f1_size); + writeBinary(e.getObjStreamIndex(), f2_size); + break; + + default: + throw std::logic_error("invalid type writing xref stream"); + break; + } + } + PointerHolder xref_data; + popPipelineStack(&xref_data); + + openObject(xref_id); + writeString("<<"); + writeStringQDF("\n "); + writeString(" /Type /XRef"); + writeStringQDF("\n "); + writeString(" /Length " + QUtil::int_to_string(xref_data->getSize())); + if (compressed) + { + writeStringQDF("\n "); + writeString(" /Filter /FlateDecode"); + writeStringQDF("\n "); + writeString(" /DecodeParms << /Columns " + + QUtil::int_to_string(esize) + " /Predictor 12 >>"); + } + writeStringQDF("\n "); + writeString(" /W [ 1 " + + QUtil::int_to_string(f1_size) + " " + + QUtil::int_to_string(f2_size) + " ]"); + if (! ((first == 0) && (last == size - 1))) + { + writeString(" /Index [ " + + QUtil::int_to_string(first) + " " + + QUtil::int_to_string(last - first + 1) + " ]"); + } + writeTrailer(which, size, true, prev); + writeString("\nstream\n"); + writeBuffer(xref_data); + writeString("\nendstream"); + closeObject(xref_id); + return space_before_zero; +} + +int +QPDFWriter::calculateXrefStreamPadding(int xref_bytes) +{ + // This routine is called right after a linearization first pass + // xref stream has been written without compression. Calculate + // the amount of padding that would be required in the worst case, + // assuming the number of uncompressed bytes remains the same. + // The worst case for zlib is that the output is larger than the + // input by 6 bytes plus 5 bytes per 16K, and then we'll add 10 + // extra bytes for number length increases. + + return 16 + (5 * ((xref_bytes + 16383) / 16384)); +} + +void +QPDFWriter::writeLinearized() +{ + // Optimize file and enqueue objects in order + + bool need_xref_stream = (! this->object_to_object_stream.empty()); + pdf.optimize(this->object_to_object_stream); + + std::vector part4; + std::vector part6; + std::vector part7; + std::vector part8; + std::vector part9; + pdf.getLinearizedParts(this->object_to_object_stream, + part4, part6, part7, part8, part9); + + // Object number sequence: + // + // second half + // second half uncompressed objects + // second half xref stream, if any + // second half compressed objects + // first half + // linearization dictionary + // first half xref stream, if any + // part 4 uncompresesd objects + // encryption dictionary, if any + // hint stream + // part 6 uncompressed objects + // first half compressed objects + // + + // Second half objects + int second_half_uncompressed = + (int)(part7.size() + part8.size() + part9.size()); + int second_half_first_obj = 1; + int after_second_half = 1 + second_half_uncompressed; + this->next_objid = after_second_half; + int second_half_xref = 0; + if (need_xref_stream) + { + second_half_xref = this->next_objid++; + } + // Assign numbers to all compressed objects in the second half. + std::vector* vecs2[] = {&part7, &part8, &part9}; + for (int i = 0; i < 3; ++i) + { + for (std::vector::iterator iter = (*vecs2[i]).begin(); + iter != (*vecs2[i]).end(); ++iter) + { + assignCompressedObjectNumbers((*iter).getObjectID()); + } + } + int second_half_end = this->next_objid - 1; + int second_trailer_size = this->next_objid; + + // First half objects + int first_half_start = this->next_objid; + int lindict_id = this->next_objid++; + int first_half_xref = 0; + if (need_xref_stream) + { + first_half_xref = this->next_objid++; + } + int part4_first_obj = this->next_objid; + this->next_objid += part4.size(); + int after_part4 = this->next_objid; + if (this->encrypted) + { + this->encryption_dict_objid = this->next_objid++; + } + int hint_id = this->next_objid++; + int part6_first_obj = this->next_objid; + this->next_objid += part6.size(); + int after_part6 = this->next_objid; + // Assign numbers to all compressed objects in the first half + std::vector* vecs1[] = {&part4, &part6}; + for (int i = 0; i < 2; ++i) + { + for (std::vector::iterator iter = (*vecs1[i]).begin(); + iter != (*vecs1[i]).end(); ++iter) + { + assignCompressedObjectNumbers((*iter).getObjectID()); + } + } + int first_half_end = this->next_objid - 1; + int first_trailer_size = this->next_objid; + + int part4_end_marker = part4.back().getObjectID(); + int part6_end_marker = part6.back().getObjectID(); + qpdf_offset_t space_before_zero = 0; + qpdf_offset_t file_size = 0; + qpdf_offset_t part6_end_offset = 0; + qpdf_offset_t first_half_max_obj_offset = 0; + qpdf_offset_t second_xref_offset = 0; + qpdf_offset_t first_xref_end = 0; + qpdf_offset_t second_xref_end = 0; + + this->next_objid = part4_first_obj; + enqueuePart(part4); + assert(this->next_objid = after_part4); + this->next_objid = part6_first_obj; + enqueuePart(part6); + assert(this->next_objid == after_part6); + this->next_objid = second_half_first_obj; + enqueuePart(part7); + enqueuePart(part8); + enqueuePart(part9); + assert(this->next_objid == after_second_half); + + qpdf_offset_t hint_length = 0; + PointerHolder hint_buffer; + + // Write file in two passes. Part numbers refer to PDF spec 1.4. + + for (int pass = 1; pass <= 2; ++pass) + { + if (pass == 1) + { + pushDiscardFilter(); + } + + // Part 1: header + + writeHeader(); + + // Part 2: linearization parameter dictionary. Save enough + // space to write real dictionary. 200 characters is enough + // space if all numerical values in the parameter dictionary + // that contain offsets are 20 digits long plus a few extra + // characters for safety. The entire linearization parameter + // dictionary must appear within the first 1024 characters of + // the file. + + qpdf_offset_t pos = this->pipeline->getCount(); + openObject(lindict_id); + writeString("<<"); + if (pass == 2) + { + std::vector const& pages = pdf.getAllPages(); + int first_page_object = obj_renumber[pages[0].getObjectID()]; + int npages = (int)pages.size(); + + writeString(" /Linearized 1 /L "); + writeString(QUtil::int_to_string(file_size + hint_length)); + // Implementation note 121 states that a space is + // mandatory after this open bracket. + writeString(" /H [ "); + writeString(QUtil::int_to_string(this->xref[hint_id].getOffset())); + writeString(" "); + writeString(QUtil::int_to_string(hint_length)); + writeString(" ] /O "); + writeString(QUtil::int_to_string(first_page_object)); + writeString(" /E "); + writeString(QUtil::int_to_string(part6_end_offset + hint_length)); + writeString(" /N "); + writeString(QUtil::int_to_string(npages)); + writeString(" /T "); + writeString(QUtil::int_to_string(space_before_zero + hint_length)); + } + writeString(" >>"); + closeObject(lindict_id); + static int const pad = 200; + int spaces = (pos - this->pipeline->getCount() + pad); + assert(spaces >= 0); + writePad(spaces); + writeString("\n"); + + // If the user supplied any additional header text, write it + // here after the linearization parameter dictionary. + writeString(this->extra_header_text); + + // Part 3: first page cross reference table and trailer. + + qpdf_offset_t first_xref_offset = this->pipeline->getCount(); + qpdf_offset_t hint_offset = 0; + if (pass == 2) + { + hint_offset = this->xref[hint_id].getOffset(); + } + if (need_xref_stream) + { + // Must pad here too. + if (pass == 1) + { + // Set first_half_max_obj_offset to a value large + // enough to force four bytes to be reserved for each + // file offset. This would provide adequate space for + // the xref stream as long as the last object in page + // 1 starts with in the first 4 GB of the file, which + // is extremely likely. In the second pass, we will + // know the actual value for this, but it's okay if + // it's smaller. + first_half_max_obj_offset = 1 << 25; + } + pos = this->pipeline->getCount(); + writeXRefStream(first_half_xref, first_half_end, + first_half_max_obj_offset, + t_lin_first, first_half_start, first_half_end, + first_trailer_size, + hint_length + second_xref_offset, + hint_id, hint_offset, hint_length, + (pass == 1)); + qpdf_offset_t endpos = this->pipeline->getCount(); + if (pass == 1) + { + // Pad so we have enough room for the real xref + // stream. + writePad(calculateXrefStreamPadding(endpos - pos)); + first_xref_end = this->pipeline->getCount(); + } + else + { + // Pad so that the next object starts at the same + // place as in pass 1. + writePad(first_xref_end - endpos); + + // A failure of this insertion means we didn't allow + // enough padding for the first pass xref stream. + assert(this->pipeline->getCount() == first_xref_end); + } + writeString("\n"); + } + else + { + writeXRefTable(t_lin_first, first_half_start, first_half_end, + first_trailer_size, hint_length + second_xref_offset, + (pass == 1), hint_id, hint_offset, hint_length); + writeString("startxref\n0\n%%EOF\n"); + } + + // Parts 4 through 9 + + for (std::list::iterator iter = + this->object_queue.begin(); + iter != this->object_queue.end(); ++iter) + { + QPDFObjectHandle cur_object = (*iter); + if (cur_object.getObjectID() == part6_end_marker) + { + first_half_max_obj_offset = this->pipeline->getCount(); + } + writeObject(cur_object); + if (cur_object.getObjectID() == part4_end_marker) + { + if (this->encrypted) + { + writeEncryptionDictionary(); + } + if (pass == 1) + { + this->xref[hint_id] = + QPDFXRefEntry(1, this->pipeline->getCount(), 0); + } + else + { + // Part 5: hint stream + writeBuffer(hint_buffer); + } + } + if (cur_object.getObjectID() == part6_end_marker) + { + part6_end_offset = this->pipeline->getCount(); + } + } + + // Part 10: overflow hint stream -- not used + + // Part 11: main cross reference table and trailer + + second_xref_offset = this->pipeline->getCount(); + if (need_xref_stream) + { + pos = this->pipeline->getCount(); + space_before_zero = + writeXRefStream(second_half_xref, + second_half_end, second_xref_offset, + t_lin_second, 0, second_half_end, + second_trailer_size, + 0, 0, 0, 0, (pass == 1)); + qpdf_offset_t endpos = this->pipeline->getCount(); + + if (pass == 1) + { + // Pad so we have enough room for the real xref + // stream. See comments for previous xref stream on + // how we calculate the padding. + writePad(calculateXrefStreamPadding(endpos - pos)); + writeString("\n"); + second_xref_end = this->pipeline->getCount(); + } + else + { + // Make the file size the same. + qpdf_offset_t pos = this->pipeline->getCount(); + writePad(second_xref_end + hint_length - 1 - pos); + writeString("\n"); + + // If this assertion fails, maybe we didn't have + // enough padding above. + assert(this->pipeline->getCount() == + (qpdf_offset_t)(second_xref_end + hint_length)); + } + } + else + { + space_before_zero = + writeXRefTable(t_lin_second, 0, second_half_end, + second_trailer_size); + } + writeString("startxref\n"); + writeString(QUtil::int_to_string(first_xref_offset)); + writeString("\n%%EOF\n"); + + if (pass == 1) + { + // Close first pass pipeline + file_size = this->pipeline->getCount(); + popPipelineStack(); + + // Save hint offset since it will be set to zero by + // calling openObject. + qpdf_offset_t hint_offset = this->xref[hint_id].getOffset(); + + // Write hint stream to a buffer + pushPipeline(new Pl_Buffer("hint buffer")); + activatePipelineStack(); + writeHintStream(hint_id); + popPipelineStack(&hint_buffer); + hint_length = (qpdf_offset_t)hint_buffer->getSize(); + + // Restore hint offset + this->xref[hint_id] = QPDFXRefEntry(1, hint_offset, 0); + } + } +} + +void +QPDFWriter::writeStandard() +{ + // Start writing + + writeHeader(); + writeString(this->extra_header_text); + + // Put root first on queue. + QPDFObjectHandle trailer = pdf.getTrailer(); + enqueueObject(trailer.getKey("/Root")); + + // Next place any other objects referenced from the trailer + // dictionary into the queue, handling direct objects recursively. + // Root is already there, so enqueuing it a second time is a + // no-op. + std::set keys = trailer.getKeys(); + for (std::set::iterator iter = keys.begin(); + iter != keys.end(); ++iter) + { + enqueueObject(trailer.getKey(*iter)); + } + + // Now start walking queue, output each object + while (this->object_queue.size()) + { + QPDFObjectHandle cur_object = this->object_queue.front(); + this->object_queue.pop_front(); + writeObject(cur_object); + } + + // Write out the encryption dictionary, if any + if (this->encrypted) + { + writeEncryptionDictionary(); + } + + // Now write out xref. next_objid is now the number of objects. + qpdf_offset_t xref_offset = this->pipeline->getCount(); + if (this->object_stream_to_objects.empty()) + { + // Write regular cross-reference table + // Write regular cross-reference table + writeXRefTable(t_normal, 0, this->next_objid - 1, this->next_objid); + } + else + { + // Write cross-reference stream. + int xref_id = this->next_objid++; + writeXRefStream(xref_id, xref_id, xref_offset, t_normal, + 0, this->next_objid - 1, this->next_objid); + } + writeString("startxref\n"); + writeString(QUtil::int_to_string(xref_offset)); + writeString("\n%%EOF\n"); +} diff --git a/libqpdf/QPDFXRefEntry.cc b/libqpdf/QPDFXRefEntry.cc new file mode 100644 index 0000000..847fc8e --- /dev/null +++ b/libqpdf/QPDFXRefEntry.cc @@ -0,0 +1,61 @@ +#include +#include +#include + +QPDFXRefEntry::QPDFXRefEntry() : + type(0), + field1(0), + field2(0) +{ +} + +QPDFXRefEntry::QPDFXRefEntry(int type, qpdf_offset_t field1, int field2) : + type(type), + field1(field1), + field2(field2) +{ + if ((type < 1) || (type > 2)) + { + throw std::logic_error( + "invalid xref type " + QUtil::int_to_string(type)); + } +} + +int +QPDFXRefEntry::getType() const +{ + return this->type; +} + +qpdf_offset_t +QPDFXRefEntry::getOffset() const +{ + if (this->type != 1) + { + throw std::logic_error( + "getOffset called for xref entry of type != 1"); + } + return this->field1; +} + +int +QPDFXRefEntry::getObjStreamNumber() const +{ + if (this->type != 2) + { + throw std::logic_error( + "getObjStreamNumber called for xref entry of type != 2"); + } + return (int) this->field1; +} + +int +QPDFXRefEntry::getObjStreamIndex() const +{ + if (this->type != 2) + { + throw std::logic_error( + "getObjStreamIndex called for xref entry of type != 2"); + } + return this->field2; +} diff --git a/libqpdf/QPDF_Array.cc b/libqpdf/QPDF_Array.cc new file mode 100644 index 0000000..9f72028 --- /dev/null +++ b/libqpdf/QPDF_Array.cc @@ -0,0 +1,98 @@ +#include +#include + +QPDF_Array::QPDF_Array(std::vector const& items) : + items(items) +{ +} + +QPDF_Array::~QPDF_Array() +{ +} + +void +QPDF_Array::releaseResolved() +{ + for (std::vector::iterator iter = this->items.begin(); + iter != this->items.end(); ++iter) + { + QPDFObjectHandle::ReleaseResolver::releaseResolved(*iter); + } +} + +std::string +QPDF_Array::unparse() +{ + std::string result = "[ "; + for (std::vector::iterator iter = this->items.begin(); + iter != this->items.end(); ++iter) + { + result += (*iter).unparse(); + result += " "; + } + result += "]"; + return result; +} + +int +QPDF_Array::getNItems() const +{ + return (int)this->items.size(); +} + +QPDFObjectHandle +QPDF_Array::getItem(int n) const +{ + if ((n < 0) || (n >= (int)this->items.size())) + { + throw std::logic_error( + "INTERNAL ERROR: bounds error accessing QPDF_Array element"); + } + return this->items[n]; +} + +std::vector const& +QPDF_Array::getAsVector() const +{ + return this->items; +} + +void +QPDF_Array::setItem(int n, QPDFObjectHandle const& oh) +{ + // Call getItem for bounds checking + (void) getItem(n); + this->items[n] = oh; +} + +void +QPDF_Array::setFromVector(std::vector const& items) +{ + this->items = items; +} + +void +QPDF_Array::insertItem(int at, QPDFObjectHandle const& item) +{ + // As special case, also allow insert beyond the end + if ((at < 0) || (at > (int)this->items.size())) + { + throw std::logic_error( + "INTERNAL ERROR: bounds error accessing QPDF_Array element"); + } + this->items.insert(this->items.begin() + at, item); +} + +void +QPDF_Array::appendItem(QPDFObjectHandle const& item) +{ + this->items.push_back(item); +} + +void +QPDF_Array::eraseItem(int at) +{ + // Call getItem for bounds checking + (void) getItem(at); + this->items.erase(this->items.begin() + at); +} diff --git a/libqpdf/QPDF_Bool.cc b/libqpdf/QPDF_Bool.cc new file mode 100644 index 0000000..4bcbfc3 --- /dev/null +++ b/libqpdf/QPDF_Bool.cc @@ -0,0 +1,22 @@ +#include + +QPDF_Bool::QPDF_Bool(bool val) : + val(val) +{ +} + +QPDF_Bool::~QPDF_Bool() +{ +} + +std::string +QPDF_Bool::unparse() +{ + return (val ? "true" : "false"); +} + +bool +QPDF_Bool::getVal() const +{ + return this->val; +} diff --git a/libqpdf/QPDF_Dictionary.cc b/libqpdf/QPDF_Dictionary.cc new file mode 100644 index 0000000..3be138a --- /dev/null +++ b/libqpdf/QPDF_Dictionary.cc @@ -0,0 +1,115 @@ +#include + +#include +#include + +QPDF_Dictionary::QPDF_Dictionary( + std::map const& items) : + items(items) +{ +} + +QPDF_Dictionary::~QPDF_Dictionary() +{ +} + +void +QPDF_Dictionary::releaseResolved() +{ + for (std::map::iterator iter = + this->items.begin(); + iter != this->items.end(); ++iter) + { + QPDFObjectHandle::ReleaseResolver::releaseResolved((*iter).second); + } +} + +std::string +QPDF_Dictionary::unparse() +{ + std::string result = "<< "; + for (std::map::iterator iter = + this->items.begin(); + iter != this->items.end(); ++iter) + { + result += QPDF_Name::normalizeName((*iter).first) + + " " + (*iter).second.unparse() + " "; + } + result += ">>"; + return result; +} + +bool +QPDF_Dictionary::hasKey(std::string const& key) +{ + return ((this->items.count(key) > 0) && + (! this->items[key].isNull())); +} + +QPDFObjectHandle +QPDF_Dictionary::getKey(std::string const& key) +{ + // PDF spec says fetching a non-existent key from a dictionary + // returns the null object. + if (this->items.count(key)) + { + // May be a null object + return (*(this->items.find(key))).second; + } + else + { + return QPDFObjectHandle::newNull(); + } +} + +std::set +QPDF_Dictionary::getKeys() +{ + std::set result; + for (std::map::const_iterator iter = + this->items.begin(); + iter != this->items.end(); ++iter) + { + if (hasKey((*iter).first)) + { + result.insert((*iter).first); + } + } + return result; +} + +std::map const& +QPDF_Dictionary::getAsMap() const +{ + + return this->items; +} + +void +QPDF_Dictionary::replaceKey(std::string const& key, + QPDFObjectHandle const& value) +{ + // add or replace value + this->items[key] = value; +} + +void +QPDF_Dictionary::removeKey(std::string const& key) +{ + // no-op if key does not exist + this->items.erase(key); +} + +void +QPDF_Dictionary::replaceOrRemoveKey(std::string const& key, + QPDFObjectHandle value) +{ + if (value.isNull()) + { + removeKey(key); + } + else + { + replaceKey(key, value); + } +} diff --git a/libqpdf/QPDF_Integer.cc b/libqpdf/QPDF_Integer.cc new file mode 100644 index 0000000..fb25af1 --- /dev/null +++ b/libqpdf/QPDF_Integer.cc @@ -0,0 +1,24 @@ +#include + +#include + +QPDF_Integer::QPDF_Integer(long long val) : + val(val) +{ +} + +QPDF_Integer::~QPDF_Integer() +{ +} + +std::string +QPDF_Integer::unparse() +{ + return QUtil::int_to_string(this->val); +} + +long long +QPDF_Integer::getVal() const +{ + return this->val; +} diff --git a/libqpdf/QPDF_Name.cc b/libqpdf/QPDF_Name.cc new file mode 100644 index 0000000..ce2184f --- /dev/null +++ b/libqpdf/QPDF_Name.cc @@ -0,0 +1,48 @@ +#include + +#include +#include + +QPDF_Name::QPDF_Name(std::string const& name) : + name(name) +{ +} + +QPDF_Name::~QPDF_Name() +{ +} + +std::string +QPDF_Name::normalizeName(std::string const& name) +{ + std::string result; + char num[4]; + result += name[0]; + for (unsigned int i = 1; i < name.length(); ++i) + { + char ch = name[i]; + // Don't use locale/ctype here; follow PDF spec guidelines. + if (strchr("#()<>[]{}/%", ch) || (ch < 33) || (ch > 126)) + { + sprintf(num, "#%02x", (unsigned char) ch); + result += num; + } + else + { + result += ch; + } + } + return result; +} + +std::string +QPDF_Name::unparse() +{ + return normalizeName(this->name); +} + +std::string +QPDF_Name::getName() const +{ + return this->name; +} diff --git a/libqpdf/QPDF_Null.cc b/libqpdf/QPDF_Null.cc new file mode 100644 index 0000000..811ddd2 --- /dev/null +++ b/libqpdf/QPDF_Null.cc @@ -0,0 +1,11 @@ +#include + +QPDF_Null::~QPDF_Null() +{ +} + +std::string +QPDF_Null::unparse() +{ + return "null"; +} diff --git a/libqpdf/QPDF_Real.cc b/libqpdf/QPDF_Real.cc new file mode 100644 index 0000000..466ddb7 --- /dev/null +++ b/libqpdf/QPDF_Real.cc @@ -0,0 +1,29 @@ +#include + +#include + +QPDF_Real::QPDF_Real(std::string const& val) : + val(val) +{ +} + +QPDF_Real::QPDF_Real(double value, int decimal_places) : + val(QUtil::double_to_string(value, decimal_places)) +{ +} + +QPDF_Real::~QPDF_Real() +{ +} + +std::string +QPDF_Real::unparse() +{ + return this->val; +} + +std::string +QPDF_Real::getVal() +{ + return this->val; +} diff --git a/libqpdf/QPDF_Reserved.cc b/libqpdf/QPDF_Reserved.cc new file mode 100644 index 0000000..368db3b --- /dev/null +++ b/libqpdf/QPDF_Reserved.cc @@ -0,0 +1,13 @@ +#include +#include + +QPDF_Reserved::~QPDF_Reserved() +{ +} + +std::string +QPDF_Reserved::unparse() +{ + throw std::logic_error("attempt to unparse QPDF_Reserved"); + return ""; +} diff --git a/libqpdf/QPDF_Stream.cc b/libqpdf/QPDF_Stream.cc new file mode 100644 index 0000000..970ee58 --- /dev/null +++ b/libqpdf/QPDF_Stream.cc @@ -0,0 +1,481 @@ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +std::map QPDF_Stream::filter_abbreviations; + +QPDF_Stream::QPDF_Stream(QPDF* qpdf, int objid, int generation, + QPDFObjectHandle stream_dict, + qpdf_offset_t offset, size_t length) : + qpdf(qpdf), + objid(objid), + generation(generation), + stream_dict(stream_dict), + offset(offset), + length(length) +{ + if (! stream_dict.isDictionary()) + { + throw std::logic_error( + "stream object instantiated with non-dictionary " + "object for dictionary"); + } +} + +QPDF_Stream::~QPDF_Stream() +{ +} + +void +QPDF_Stream::setObjGen(int objid, int generation) +{ + if (! ((this->objid == 0) && (this->generation == 0))) + { + throw std::logic_error( + "attempt to set object ID and generation of a stream" + " that already has them"); + } + this->objid = objid; + this->generation = generation; +} + +std::string +QPDF_Stream::unparse() +{ + // Unparse stream objects as indirect references + return QUtil::int_to_string(this->objid) + " " + + QUtil::int_to_string(this->generation) + " R"; +} + +QPDFObjectHandle +QPDF_Stream::getDict() const +{ + return this->stream_dict; +} + +PointerHolder +QPDF_Stream::getStreamData() +{ + Pl_Buffer buf("stream data buffer"); + if (! pipeStreamData(&buf, true, false, false)) + { + throw std::logic_error("getStreamData called on unfilterable stream"); + } + QTC::TC("qpdf", "QPDF_Stream getStreamData"); + return buf.getBuffer(); +} + +PointerHolder +QPDF_Stream::getRawStreamData() +{ + Pl_Buffer buf("stream data buffer"); + pipeStreamData(&buf, false, false, false); + QTC::TC("qpdf", "QPDF_Stream getRawStreamData"); + return buf.getBuffer(); +} + +bool +QPDF_Stream::filterable(std::vector& filters, + int& predictor, int& columns, + bool& early_code_change) +{ + if (filter_abbreviations.empty()) + { + // The PDF specification provides these filter abbreviations + // for use in inline images, but according to table H.1 in the + // pre-ISO versions of the PDF specification, Adobe Reader + // also accepts them for stream filters. + filter_abbreviations["/AHx"] = "/ASCIIHexDecode"; + filter_abbreviations["/A85"] = "/ASCII85Decode"; + filter_abbreviations["/LZW"] = "/LZWDecode"; + filter_abbreviations["/Fl"] = "/FlateDecode"; + filter_abbreviations["/RL"] = "/RunLengthDecode"; + filter_abbreviations["/CCF"] = "/CCITTFaxDecode"; + filter_abbreviations["/DCT"] = "/DCTDecode"; + } + + // Initialize values to their defaults as per the PDF spec + predictor = 1; + columns = 0; + early_code_change = true; + + bool filterable = true; + + // See if we can support any decode parameters that are specified. + + QPDFObjectHandle decode_obj = + this->stream_dict.getKey("/DecodeParms"); + if (decode_obj.isNull()) + { + // no problem + } + else if (decode_obj.isDictionary()) + { + std::set keys = decode_obj.getKeys(); + for (std::set::iterator iter = keys.begin(); + iter != keys.end(); ++iter) + { + std::string const& key = *iter; + if (key == "/Predictor") + { + QPDFObjectHandle predictor_obj = decode_obj.getKey(key); + if (predictor_obj.isInteger()) + { + predictor = predictor_obj.getIntValue(); + if (! ((predictor == 1) || (predictor == 12))) + { + filterable = false; + } + } + else + { + filterable = false; + } + } + else if (key == "/EarlyChange") + { + QPDFObjectHandle earlychange_obj = decode_obj.getKey(key); + if (earlychange_obj.isInteger()) + { + int earlychange = earlychange_obj.getIntValue(); + early_code_change = (earlychange == 1); + if (! ((earlychange == 0) || (earlychange == 1))) + { + filterable = false; + } + } + else + { + filterable = false; + } + } + else if (key == "/Columns") + { + QPDFObjectHandle columns_obj = decode_obj.getKey(key); + if (columns_obj.isInteger()) + { + columns = columns_obj.getIntValue(); + } + else + { + filterable = false; + } + } + else if (((key == "/Type") || (key == "/Name")) && + decode_obj.getKey("/Type").isName() && + (decode_obj.getKey("/Type").getName() == + "/CryptFilterDecodeParms")) + { + // we handle this in decryptStream + } + else + { + filterable = false; + } + } + } + else + { + // Ignore for now -- some filter types, like CCITTFaxDecode, + // use types other than dictionary for this. + QTC::TC("qpdf", "QPDF_Stream ignore non-dictionary DecodeParms"); + + filterable = false; + } + + if ((predictor > 1) && (columns == 0)) + { + // invalid + filterable = false; + } + + if (! filterable) + { + return false; + } + + // Check filters + + QPDFObjectHandle filter_obj = this->stream_dict.getKey("/Filter"); + bool filters_okay = true; + + if (filter_obj.isNull()) + { + // No filters + } + else if (filter_obj.isName()) + { + // One filter + filters.push_back(filter_obj.getName()); + } + else if (filter_obj.isArray()) + { + // Potentially multiple filters + int n = filter_obj.getArrayNItems(); + for (int i = 0; i < n; ++i) + { + QPDFObjectHandle item = filter_obj.getArrayItem(i); + if (item.isName()) + { + filters.push_back(item.getName()); + } + else + { + filters_okay = false; + } + } + } + else + { + filters_okay = false; + } + + if (! filters_okay) + { + QTC::TC("qpdf", "QPDF_Stream invalid filter"); + throw QPDFExc(qpdf_e_damaged_pdf, qpdf->getFilename(), + "", this->offset, + "stream filter type is not name or array"); + } + + // `filters' now contains a list of filters to be applied in + // order. See which ones we can support. + + for (std::vector::iterator iter = filters.begin(); + iter != filters.end(); ++iter) + { + std::string& filter = *iter; + + if (filter_abbreviations.count(filter)) + { + QTC::TC("qpdf", "QPDF_Stream expand filter abbreviation"); + filter = filter_abbreviations[filter]; + } + + if (! ((filter == "/Crypt") || + (filter == "/FlateDecode") || + (filter == "/LZWDecode") || + (filter == "/ASCII85Decode") || + (filter == "/ASCIIHexDecode"))) + { + filterable = false; + } + } + + return filterable; +} + +bool +QPDF_Stream::pipeStreamData(Pipeline* pipeline, bool filter, + bool normalize, bool compress) +{ + std::vector filters; + int predictor = 1; + int columns = 0; + bool early_code_change = true; + if (filter) + { + filter = filterable(filters, predictor, columns, early_code_change); + } + + if (pipeline == 0) + { + QTC::TC("qpdf", "QPDF_Stream pipeStreamData with null pipeline"); + return filter; + } + + // Construct the pipeline in reverse order. Force pipelines we + // create to be deleted when this function finishes. + std::vector > to_delete; + + if (filter) + { + if (compress) + { + pipeline = new Pl_Flate("compress object stream", pipeline, + Pl_Flate::a_deflate); + to_delete.push_back(pipeline); + } + + if (normalize) + { + pipeline = new Pl_QPDFTokenizer("normalizer", pipeline); + to_delete.push_back(pipeline); + } + + for (std::vector::reverse_iterator iter = filters.rbegin(); + iter != filters.rend(); ++iter) + { + std::string const& filter = *iter; + if (filter == "/Crypt") + { + // Ignore -- handled by pipeStreamData + } + else if (filter == "/FlateDecode") + { + if (predictor == 12) + { + QTC::TC("qpdf", "QPDF_Stream PNG filter"); + pipeline = new Pl_PNGFilter( + "png decode", pipeline, Pl_PNGFilter::a_decode, + columns, 0 /* not used */); + to_delete.push_back(pipeline); + } + + pipeline = new Pl_Flate("stream inflate", + pipeline, Pl_Flate::a_inflate); + to_delete.push_back(pipeline); + } + else if (filter == "/ASCII85Decode") + { + pipeline = new Pl_ASCII85Decoder("ascii85 decode", pipeline); + to_delete.push_back(pipeline); + } + else if (filter == "/ASCIIHexDecode") + { + pipeline = new Pl_ASCIIHexDecoder("asciiHex decode", pipeline); + to_delete.push_back(pipeline); + } + else if (filter == "/LZWDecode") + { + pipeline = new Pl_LZWDecoder("lzw decode", pipeline, + early_code_change); + to_delete.push_back(pipeline); + } + else + { + throw std::logic_error( + "INTERNAL ERROR: QPDFStream: unknown filter " + "encountered after check"); + } + } + } + + if (this->stream_data.getPointer()) + { + QTC::TC("qpdf", "QPDF_Stream pipe replaced stream data"); + pipeline->write(this->stream_data->getBuffer(), + this->stream_data->getSize()); + pipeline->finish(); + } + else if (this->stream_provider.getPointer()) + { + Pl_Count count("stream provider count", pipeline); + this->stream_provider->provideStreamData( + this->objid, this->generation, &count); + qpdf_offset_t actual_length = count.getCount(); + qpdf_offset_t desired_length = 0; + if (this->stream_dict.hasKey("/Length")) + { + desired_length = this->stream_dict.getKey("/Length").getIntValue(); + if (actual_length == desired_length) + { + QTC::TC("qpdf", "QPDF_Stream pipe use stream provider"); + } + else + { + QTC::TC("qpdf", "QPDF_Stream provider length mismatch"); + throw std::logic_error( + "stream data provider for " + + QUtil::int_to_string(this->objid) + " " + + QUtil::int_to_string(this->generation) + + " provided " + + QUtil::int_to_string(actual_length) + + " bytes instead of expected " + + QUtil::int_to_string(desired_length) + " bytes"); + } + } + else + { + QTC::TC("qpdf", "QPDF_Stream provider length not provided"); + this->stream_dict.replaceKey( + "/Length", QPDFObjectHandle::newInteger(actual_length)); + } + } + else if (this->offset == 0) + { + QTC::TC("qpdf", "QPDF_Stream pipe no stream data"); + throw std::logic_error( + "pipeStreamData called for stream with no data"); + } + else + { + QTC::TC("qpdf", "QPDF_Stream pipe original stream data"); + QPDF::Pipe::pipeStreamData(this->qpdf, this->objid, this->generation, + this->offset, this->length, + this->stream_dict, pipeline); + } + + return filter; +} + +void +QPDF_Stream::replaceStreamData(PointerHolder data, + QPDFObjectHandle const& filter, + QPDFObjectHandle const& decode_parms) +{ + this->stream_data = data; + this->stream_provider = 0; + replaceFilterData(filter, decode_parms, data->getSize()); +} + +void +QPDF_Stream::replaceStreamData( + PointerHolder provider, + QPDFObjectHandle const& filter, + QPDFObjectHandle const& decode_parms) +{ + this->stream_provider = provider; + this->stream_data = 0; + replaceFilterData(filter, decode_parms, 0); +} + +void +QPDF_Stream::replaceFilterData(QPDFObjectHandle const& filter, + QPDFObjectHandle const& decode_parms, + size_t length) +{ + this->stream_dict.replaceOrRemoveKey("/Filter", filter); + this->stream_dict.replaceOrRemoveKey("/DecodeParms", decode_parms); + if (length == 0) + { + QTC::TC("qpdf", "QPDF_Stream unknown stream length"); + this->stream_dict.removeKey("/Length"); + } + else + { + this->stream_dict.replaceKey( + "/Length", QPDFObjectHandle::newInteger((int)length)); + } +} + +void +QPDF_Stream::replaceDict(QPDFObjectHandle new_dict) +{ + this->stream_dict = new_dict; + QPDFObjectHandle length_obj = new_dict.getKey("/Length"); + if (length_obj.isInteger()) + { + this->length = length_obj.getIntValue(); + } + else + { + this->length = 0; + } +} diff --git a/libqpdf/QPDF_String.cc b/libqpdf/QPDF_String.cc new file mode 100644 index 0000000..2ac2ed3 --- /dev/null +++ b/libqpdf/QPDF_String.cc @@ -0,0 +1,211 @@ +#include + +#include +#include + +// DO NOT USE ctype -- it is locale dependent for some things, and +// it's not worth the risk of including it in case it may accidentally +// be used. +#include + +// See above about ctype. +static bool is_ascii_printable(unsigned char ch) +{ + return ((ch >= 32) && (ch <= 126)); +} +static bool is_iso_latin1_printable(unsigned char ch) +{ + return (((ch >= 32) && (ch <= 126)) || (ch >= 160)); +} + +QPDF_String::QPDF_String(std::string const& val) : + val(val) +{ +} + +QPDF_String::~QPDF_String() +{ +} + +std::string +QPDF_String::unparse() +{ + return unparse(false); +} + +std::string +QPDF_String::unparse(bool force_binary) +{ + bool use_hexstring = force_binary; + if (! use_hexstring) + { + unsigned int nonprintable = 0; + int consecutive_printable = 0; + for (unsigned int i = 0; i < this->val.length(); ++i) + { + char ch = this->val[i]; + // Note: do not use locale to determine printability. The + // PDF specification accepts arbitrary binary data. Some + // locales imply multibyte characters. We'll consider + // something printable if it is printable in 7-bit ASCII. + // We'll code this manually rather than being rude and + // setting locale. + if ((ch == 0) || (! (is_ascii_printable(ch) || + strchr("\n\r\t\b\f", ch)))) + { + ++nonprintable; + consecutive_printable = 0; + } + else + { + if (++consecutive_printable > 5) + { + // If there are more than 5 consecutive printable + // characters, I want to see them as such. + nonprintable = 0; + break; + } + } + } + + // Use hex notation if more than 20% of the characters are not + // printable in plain ASCII. + if (5 * nonprintable > val.length()) + { + use_hexstring = true; + } + } + std::string result; + if (use_hexstring) + { + result += "<"; + char num[3]; + for (unsigned int i = 0; i < this->val.length(); ++i) + { + sprintf(num, "%02x", (unsigned char) this->val[i]); + result += num; + } + result += ">"; + } + else + { + result += "("; + char num[5]; + for (unsigned int i = 0; i < this->val.length(); ++i) + { + char ch = this->val[i]; + switch (ch) + { + case '\n': + result += "\\n"; + break; + + case '\r': + result += "\\r"; + break; + + case '\t': + result += "\\t"; + break; + + case '\b': + result += "\\b"; + break; + + case '\f': + result += "\\f"; + break; + + case '(': + result += "\\("; + break; + + case ')': + result += "\\)"; + break; + + case '\\': + result += "\\\\"; + break; + + default: + if (is_iso_latin1_printable(ch)) + { + result += this->val[i]; + } + else + { + sprintf(num, "\\%03o", (unsigned char)ch); + result += num; + } + break; + } + } + result += ")"; + } + + return result; +} + +std::string +QPDF_String::getVal() const +{ + return this->val; +} + +std::string +QPDF_String::getUTF8Val() const +{ + std::string result; + size_t len = this->val.length(); + if ((len >= 2) && (len % 2 == 0) && + (this->val[0] == '\xfe') && (this->val[1] == '\xff')) + { + // This is a Unicode string using big-endian UTF-16. This + // code uses unsigned long and unsigned short to hold + // codepoint values. It requires unsigned long to be at least + // 32 bits and unsigned short to be at least 16 bits, but it + // will work fine if they are larger. + unsigned long codepoint = 0L; + for (unsigned int i = 2; i < len; i += 2) + { + // Convert from UTF16-BE. If we get a malformed + // codepoint, this code will generate incorrect output + // without giving a warning. Specifically, a high + // codepoint not followed by a low codepoint will be + // discarded, and a low codepoint not preceded by a high + // codepoint will just get its low 10 bits output. + unsigned short bits = + (((unsigned char) this->val[i]) << 8) + + ((unsigned char) this->val[i+1]); + if ((bits & 0xFC00) == 0xD800) + { + codepoint = 0x10000 + ((bits & 0x3FF) << 10); + continue; + } + else if ((bits & 0xFC00) == 0xDC00) + { + if (codepoint != 0) + { + QTC::TC("qpdf", "QPDF_String non-trivial UTF-16"); + } + codepoint += bits & 0x3FF; + } + else + { + codepoint = bits; + } + + result += QUtil::toUTF8(codepoint); + codepoint = 0; + } + } + else + { + for (unsigned int i = 0; i < len; ++i) + { + result += QUtil::toUTF8((unsigned char) this->val[i]); + } + } + return result; +} diff --git a/libqpdf/QPDF_encryption.cc b/libqpdf/QPDF_encryption.cc new file mode 100644 index 0000000..c73a47b --- /dev/null +++ b/libqpdf/QPDF_encryption.cc @@ -0,0 +1,930 @@ +// This file implements methods from the QPDF class that involve +// encryption. + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +static unsigned char const padding_string[] = { + 0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41, + 0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08, + 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, 0x3e, 0x80, + 0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a +}; + +static unsigned int const O_key_bytes = sizeof(MD5::Digest); +static unsigned int const key_bytes = 32; + +void +pad_or_truncate_password(std::string const& password, char k1[key_bytes]) +{ + int password_bytes = std::min(key_bytes, (unsigned int)password.length()); + int pad_bytes = key_bytes - password_bytes; + memcpy(k1, password.c_str(), password_bytes); + memcpy(k1 + password_bytes, padding_string, pad_bytes); +} + +void +QPDF::trim_user_password(std::string& user_password) +{ + // Although unnecessary, this routine trims the padding string + // from the end of a user password. Its only purpose is for + // recovery of user passwords which is done in the test suite. + char const* cstr = user_password.c_str(); + size_t len = user_password.length(); + if (len < key_bytes) + { + return; + } + + char const* p = 0; + while ((p = strchr(cstr, '\x28')) != 0) + { + if (memcmp(p, padding_string, len - (p - cstr)) == 0) + { + user_password = user_password.substr(0, p - cstr); + return; + } + } +} + +static std::string +pad_or_truncate_password(std::string const& password) +{ + char k1[key_bytes]; + pad_or_truncate_password(password, k1); + return std::string(k1, key_bytes); +} + +static void +iterate_md5_digest(MD5& md5, MD5::Digest& digest, int iterations) +{ + md5.digest(digest); + + for (int i = 0; i < iterations; ++i) + { + MD5 m; + m.encodeDataIncrementally((char*)digest, sizeof(digest)); + m.digest(digest); + } +} + + +static void +iterate_rc4(unsigned char* data, int data_len, + unsigned char* okey, int key_len, + int iterations, bool reverse) +{ + unsigned char* key = new unsigned char[key_len]; + for (int i = 0; i < iterations; ++i) + { + int const xor_value = (reverse ? iterations - 1 - i : i); + for (int j = 0; j < key_len; ++j) + { + key[j] = okey[j] ^ xor_value; + } + RC4 rc4(key, key_len); + rc4.process(data, data_len); + } + delete [] key; +} + +std::string +QPDF::compute_data_key(std::string const& encryption_key, + int objid, int generation, + bool use_aes) +{ + // Algorithm 3.1 from the PDF 1.7 Reference Manual + + std::string result = encryption_key; + + // Append low three bytes of object ID and low two bytes of generation + result += (char) (objid & 0xff); + result += (char) ((objid >> 8) & 0xff); + result += (char) ((objid >> 16) & 0xff); + result += (char) (generation & 0xff); + result += (char) ((generation >> 8) & 0xff); + if (use_aes) + { + result += "sAlT"; + } + + MD5 md5; + md5.encodeDataIncrementally(result.c_str(), (int)result.length()); + MD5::Digest digest; + md5.digest(digest); + return std::string((char*) digest, + std::min(result.length(), (size_t) 16)); +} + +std::string +QPDF::compute_encryption_key( + std::string const& password, EncryptionData const& data) +{ + // Algorithm 3.2 from the PDF 1.7 Reference Manual + + MD5 md5; + md5.encodeDataIncrementally( + pad_or_truncate_password(password).c_str(), key_bytes); + md5.encodeDataIncrementally(data.O.c_str(), key_bytes); + char pbytes[4]; + pbytes[0] = (char) (data.P & 0xff); + pbytes[1] = (char) ((data.P >> 8) & 0xff); + pbytes[2] = (char) ((data.P >> 16) & 0xff); + pbytes[3] = (char) ((data.P >> 24) & 0xff); + md5.encodeDataIncrementally(pbytes, 4); + md5.encodeDataIncrementally(data.id1.c_str(), (int)data.id1.length()); + if ((data.R >= 4) && (! data.encrypt_metadata)) + { + char bytes[4]; + memset(bytes, 0xff, 4); + md5.encodeDataIncrementally(bytes, 4); + } + MD5::Digest digest; + iterate_md5_digest(md5, digest, ((data.R >= 3) ? 50 : 0)); + return std::string((char*)digest, data.Length_bytes); +} + +static void +compute_O_rc4_key(std::string const& user_password, + std::string const& owner_password, + QPDF::EncryptionData const& data, + unsigned char key[O_key_bytes]) +{ + std::string password = owner_password; + if (password.empty()) + { + password = user_password; + } + MD5 md5; + md5.encodeDataIncrementally( + pad_or_truncate_password(password).c_str(), key_bytes); + MD5::Digest digest; + iterate_md5_digest(md5, digest, ((data.R >= 3) ? 50 : 0)); + memcpy(key, digest, O_key_bytes); +} + +static std::string +compute_O_value(std::string const& user_password, + std::string const& owner_password, + QPDF::EncryptionData const& data) +{ + // Algorithm 3.3 from the PDF 1.7 Reference Manual + + unsigned char O_key[O_key_bytes]; + compute_O_rc4_key(user_password, owner_password, data, O_key); + + char upass[key_bytes]; + pad_or_truncate_password(user_password, upass); + iterate_rc4((unsigned char*) upass, key_bytes, + O_key, data.Length_bytes, (data.R >= 3) ? 20 : 1, false); + return std::string(upass, key_bytes); +} + +static +std::string +compute_U_value_R2(std::string const& user_password, + QPDF::EncryptionData const& data) +{ + // Algorithm 3.4 from the PDF 1.7 Reference Manual + + std::string k1 = QPDF::compute_encryption_key(user_password, data); + char udata[key_bytes]; + pad_or_truncate_password("", udata); + iterate_rc4((unsigned char*) udata, key_bytes, + (unsigned char*)k1.c_str(), data.Length_bytes, 1, false); + return std::string(udata, key_bytes); +} + +static +std::string +compute_U_value_R3(std::string const& user_password, + QPDF::EncryptionData const& data) +{ + // Algorithm 3.5 from the PDF 1.7 Reference Manual + + std::string k1 = QPDF::compute_encryption_key(user_password, data); + MD5 md5; + md5.encodeDataIncrementally( + pad_or_truncate_password("").c_str(), key_bytes); + md5.encodeDataIncrementally(data.id1.c_str(), (int)data.id1.length()); + MD5::Digest digest; + md5.digest(digest); + iterate_rc4(digest, sizeof(MD5::Digest), + (unsigned char*) k1.c_str(), data.Length_bytes, 20, false); + char result[key_bytes]; + memcpy(result, digest, sizeof(MD5::Digest)); + // pad with arbitrary data -- make it consistent for the sake of + // testing + for (unsigned int i = sizeof(MD5::Digest); i < key_bytes; ++i) + { + result[i] = (char)((i * i) % 0xff); + } + return std::string(result, key_bytes); +} + +static std::string +compute_U_value(std::string const& user_password, + QPDF::EncryptionData const& data) +{ + if (data.R >= 3) + { + return compute_U_value_R3(user_password, data); + } + + return compute_U_value_R2(user_password, data); +} + +static bool +check_user_password(std::string const& user_password, + QPDF::EncryptionData const& data) +{ + // Algorithm 3.6 from the PDF 1.7 Reference Manual + + std::string u_value = compute_U_value(user_password, data); + int to_compare = ((data.R >= 3) ? sizeof(MD5::Digest) : key_bytes); + return (memcmp(data.U.c_str(), u_value.c_str(), to_compare) == 0); +} + +static bool +check_owner_password(std::string& user_password, + std::string const& owner_password, + QPDF::EncryptionData const& data) +{ + // Algorithm 3.7 from the PDF 1.7 Reference Manual + + unsigned char key[O_key_bytes]; + compute_O_rc4_key(user_password, owner_password, data, key); + unsigned char O_data[key_bytes]; + memcpy(O_data, (unsigned char*) data.O.c_str(), key_bytes); + iterate_rc4(O_data, key_bytes, key, data.Length_bytes, + (data.R >= 3) ? 20 : 1, true); + std::string new_user_password = + std::string((char*)O_data, key_bytes); + bool result = false; + if (check_user_password(new_user_password, data)) + { + result = true; + user_password = new_user_password; + } + return result; +} + +QPDF::encryption_method_e +QPDF::interpretCF(QPDFObjectHandle cf) +{ + if (cf.isName()) + { + std::string filter = cf.getName(); + if (this->crypt_filters.count(filter) != 0) + { + return this->crypt_filters[filter]; + } + else if (filter == "/Identity") + { + return e_none; + } + else + { + return e_unknown; + } + } + else + { + // Default: /Identity + return e_none; + } +} + +void +QPDF::initializeEncryption() +{ + if (this->encryption_initialized) + { + return; + } + this->encryption_initialized = true; + + // After we initialize encryption parameters, we must used stored + // key information and never look at /Encrypt again. Otherwise, + // things could go wrong if someone mutates the encryption + // dictionary. + + if (! this->trailer.hasKey("/Encrypt")) + { + return; + } + + // Go ahead and set this->encryption here. That way, isEncrypted + // will return true even if there were errors reading the + // encryption dictionary. + this->encrypted = true; + + QPDFObjectHandle id_obj = this->trailer.getKey("/ID"); + if (! (id_obj.isArray() && + (id_obj.getArrayNItems() == 2) && + id_obj.getArrayItem(0).isString())) + { + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "trailer", this->file->getLastOffset(), + "invalid /ID in trailer dictionary"); + } + + std::string id1 = id_obj.getArrayItem(0).getStringValue(); + QPDFObjectHandle encryption_dict = this->trailer.getKey("/Encrypt"); + if (! encryption_dict.isDictionary()) + { + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + this->last_object_description, + this->file->getLastOffset(), + "/Encrypt in trailer dictionary is not a dictionary"); + } + + if (! (encryption_dict.getKey("/Filter").isName() && + (encryption_dict.getKey("/Filter").getName() == "/Standard"))) + { + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "encryption dictionary", this->file->getLastOffset(), + "unsupported encryption filter"); + } + if (! encryption_dict.getKey("/SubFilter").isNull()) + { + warn(QPDFExc(qpdf_e_unsupported, this->file->getName(), + "encryption dictionary", this->file->getLastOffset(), + "file uses encryption SubFilters," + " which qpdf does not support")); + } + + if (! (encryption_dict.getKey("/V").isInteger() && + encryption_dict.getKey("/R").isInteger() && + encryption_dict.getKey("/O").isString() && + encryption_dict.getKey("/U").isString() && + encryption_dict.getKey("/P").isInteger())) + { + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "encryption dictionary", this->file->getLastOffset(), + "some encryption dictionary parameters are missing " + "or the wrong type"); + } + + int V = encryption_dict.getKey("/V").getIntValue(); + int R = encryption_dict.getKey("/R").getIntValue(); + std::string O = encryption_dict.getKey("/O").getStringValue(); + std::string U = encryption_dict.getKey("/U").getStringValue(); + unsigned int P = (unsigned int) encryption_dict.getKey("/P").getIntValue(); + + if (! (((R == 2) || (R == 3) || (R == 4)) && + ((V == 1) || (V == 2) || (V == 4)))) + { + throw QPDFExc(qpdf_e_unsupported, this->file->getName(), + "encryption dictionary", this->file->getLastOffset(), + "Unsupported /R or /V in encryption dictionary"); + } + + this->encryption_V = V; + + if (! ((O.length() == key_bytes) && (U.length() == key_bytes))) + { + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "encryption dictionary", this->file->getLastOffset(), + "incorrect length for /O and/or /P in " + "encryption dictionary"); + } + + int Length = 40; + if (encryption_dict.getKey("/Length").isInteger()) + { + Length = encryption_dict.getKey("/Length").getIntValue(); + if ((Length % 8) || (Length < 40) || (Length > 128)) + { + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "encryption dictionary", this->file->getLastOffset(), + "invalid /Length value in encryption dictionary"); + } + } + + this->encrypt_metadata = true; + if ((V >= 4) && (encryption_dict.getKey("/EncryptMetadata").isBool())) + { + this->encrypt_metadata = + encryption_dict.getKey("/EncryptMetadata").getBoolValue(); + } + + if (V == 4) + { + QPDFObjectHandle CF = encryption_dict.getKey("/CF"); + std::set keys = CF.getKeys(); + for (std::set::iterator iter = keys.begin(); + iter != keys.end(); ++iter) + { + std::string const& filter = *iter; + QPDFObjectHandle cdict = CF.getKey(filter); + if (cdict.isDictionary()) + { + encryption_method_e method = e_none; + if (cdict.getKey("/CFM").isName()) + { + std::string method_name = cdict.getKey("/CFM").getName(); + if (method_name == "/V2") + { + QTC::TC("qpdf", "QPDF_encryption CFM V2"); + method = e_rc4; + } + else if (method_name == "/AESV2") + { + QTC::TC("qpdf", "QPDF_encryption CFM AESV2"); + method = e_aes; + } + else + { + // Don't complain now -- maybe we won't need + // to reference this type. + method = e_unknown; + } + } + this->crypt_filters[filter] = method; + } + } + + QPDFObjectHandle StmF = encryption_dict.getKey("/StmF"); + QPDFObjectHandle StrF = encryption_dict.getKey("/StrF"); + QPDFObjectHandle EFF = encryption_dict.getKey("/EFF"); + this->cf_stream = interpretCF(StmF); + this->cf_string = interpretCF(StrF); + if (EFF.isName()) + { + this->cf_file = interpretCF(EFF); + } + else + { + this->cf_file = this->cf_stream; + } + if (this->cf_file != this->cf_stream) + { + // The issue for qpdf is that it can't tell the difference + // between an embedded file stream and a regular stream. + // Search for a comment containing cf_file. To fix this, + // we need files with encrypted embedded files and + // non-encrypted native streams and vice versa. Also if + // it is possible for them to be encrypted in different + // ways, we should have some of those too. In cases where + // we can detect whether a stream is encrypted or not, we + // might want to try to detecet that automatically in + // defense of possible logic errors surrounding detection + // of embedded file streams, unless that's really clear + // from the specification. + throw QPDFExc(qpdf_e_unsupported, this->file->getName(), + "encryption dictionary", this->file->getLastOffset(), + "This document has embedded files that are" + " encrypted differently from the rest of the file." + " qpdf does not presently support this due to" + " lack of test data; if possible, please submit" + " a bug report that includes this file."); + } + } + EncryptionData data(V, R, Length / 8, P, O, U, id1, this->encrypt_metadata); + if (check_owner_password( + this->user_password, this->provided_password, data)) + { + // password supplied was owner password; user_password has + // been initialized + } + else if (check_user_password(this->provided_password, data)) + { + this->user_password = this->provided_password; + } + else + { + throw QPDFExc(qpdf_e_password, this->file->getName(), + "", 0, "invalid password"); + } + + this->encryption_key = compute_encryption_key(this->user_password, data); +} + +std::string +QPDF::getKeyForObject(int objid, int generation, bool use_aes) +{ + if (! this->encrypted) + { + throw std::logic_error( + "request for encryption key in non-encrypted PDF"); + } + + if (! ((objid == this->cached_key_objid) && + (generation == this->cached_key_generation))) + { + this->cached_object_encryption_key = + compute_data_key(this->encryption_key, objid, generation, use_aes); + this->cached_key_objid = objid; + this->cached_key_generation = generation; + } + + return this->cached_object_encryption_key; +} + +void +QPDF::decryptString(std::string& str, int objid, int generation) +{ + if (objid == 0) + { + return; + } + bool use_aes = false; + if (this->encryption_V == 4) + { + switch (this->cf_string) + { + case e_none: + return; + + case e_aes: + use_aes = true; + break; + + case e_rc4: + break; + + default: + warn(QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + this->last_object_description, + this->file->getLastOffset(), + "unknown encryption filter for strings" + " (check /StrF in /Encrypt dictionary);" + " strings may be decrypted improperly")); + // To avoid repeated warnings, reset cf_string. Assume + // we'd want to use AES if V == 4. + this->cf_string = e_aes; + break; + } + } + + std::string key = getKeyForObject(objid, generation, use_aes); + try + { + if (use_aes) + { + QTC::TC("qpdf", "QPDF_encryption aes decode string"); + assert(key.length() == Pl_AES_PDF::key_size); + Pl_Buffer bufpl("decrypted string"); + Pl_AES_PDF pl("aes decrypt string", &bufpl, false, + (unsigned char const*)key.c_str()); + pl.write((unsigned char*)str.c_str(), str.length()); + pl.finish(); + PointerHolder buf = bufpl.getBuffer(); + str = std::string((char*)buf->getBuffer(), buf->getSize()); + } + else + { + QTC::TC("qpdf", "QPDF_encryption rc4 decode string"); + unsigned int vlen = (int)str.length(); + // Using PointerHolder guarantees that tmp will + // be freed even if rc4.process throws an exception. + PointerHolder tmp(true, QUtil::copy_string(str)); + RC4 rc4((unsigned char const*)key.c_str(), (int)key.length()); + rc4.process((unsigned char*)tmp.getPointer(), vlen); + str = std::string(tmp.getPointer(), vlen); + } + } + catch (QPDFExc& e) + { + throw; + } + catch (std::runtime_error& e) + { + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + this->last_object_description, + this->file->getLastOffset(), + "error decrypting string for object " + + QUtil::int_to_string(objid) + " " + + QUtil::int_to_string(generation) + ": " + e.what()); + } +} + +void +QPDF::decryptStream(Pipeline*& pipeline, int objid, int generation, + QPDFObjectHandle& stream_dict, + std::vector >& heap) +{ + std::string type; + if (stream_dict.getKey("/Type").isName()) + { + type = stream_dict.getKey("/Type").getName(); + } + if (type == "/XRef") + { + QTC::TC("qpdf", "QPDF_encryption xref stream from encrypted file"); + return; + } + bool use_aes = false; + if (this->encryption_V == 4) + { + encryption_method_e method = e_unknown; + std::string method_source = "/StmF from /Encrypt dictionary"; + + if (stream_dict.getKey("/Filter").isOrHasName("/Crypt") && + stream_dict.getKey("/DecodeParms").isDictionary()) + { + QPDFObjectHandle decode_parms = stream_dict.getKey("/DecodeParms"); + if (decode_parms.getKey("/Type").isName() && + (decode_parms.getKey("/Type").getName() == + "/CryptFilterDecodeParms")) + { + QTC::TC("qpdf", "QPDF_encryption stream crypt filter"); + method = interpretCF(decode_parms.getKey("/Name")); + method_source = "stream's Crypt decode parameters"; + } + } + + if (method == e_unknown) + { + if ((! this->encrypt_metadata) && (type == "/Metadata")) + { + QTC::TC("qpdf", "QPDF_encryption cleartext metadata"); + method = e_none; + } + else + { + // NOTE: We should should use cf_file if this is an + // embedded file, but we can't yet detect embedded + // file streams as such. When fixing, search for all + // occurrences of cf_file to find a reference to this + // comment. + method = this->cf_stream; + } + } + use_aes = false; + switch (method) + { + case e_none: + return; + break; + + case e_aes: + use_aes = true; + break; + + case e_rc4: + break; + + default: + // filter local to this stream. + warn(QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + this->last_object_description, + this->file->getLastOffset(), + "unknown encryption filter for streams" + " (check " + method_source + ");" + " streams may be decrypted improperly")); + // To avoid repeated warnings, reset cf_stream. Assume + // we'd want to use AES if V == 4. + this->cf_stream = e_aes; + break; + } + } + std::string key = getKeyForObject(objid, generation, use_aes); + if (use_aes) + { + QTC::TC("qpdf", "QPDF_encryption aes decode stream"); + assert(key.length() == Pl_AES_PDF::key_size); + pipeline = new Pl_AES_PDF("AES stream decryption", pipeline, + false, (unsigned char*) key.c_str()); + } + else + { + QTC::TC("qpdf", "QPDF_encryption rc4 decode stream"); + pipeline = new Pl_RC4("RC4 stream decryption", pipeline, + (unsigned char*) key.c_str(), (int)key.length()); + } + heap.push_back(pipeline); +} + +void +QPDF::compute_encryption_O_U( + char const* user_password, char const* owner_password, + int V, int R, int key_len, int P, bool encrypt_metadata, + std::string const& id1, std::string& O, std::string& U) +{ + EncryptionData data(V, R, key_len, P, "", "", id1, encrypt_metadata); + data.O = compute_O_value(user_password, owner_password, data); + O = data.O; + U = compute_U_value(user_password, data); +} + +std::string const& +QPDF::getPaddedUserPassword() const +{ + return this->user_password; +} + +std::string +QPDF::getTrimmedUserPassword() const +{ + std::string result = this->user_password; + trim_user_password(result); + return result; +} + +bool +QPDF::isEncrypted() const +{ + return this->encrypted; +} + +bool +QPDF::isEncrypted(int& R, int& P) +{ + int V; + encryption_method_e stream, string, file; + return isEncrypted(R, P, V, stream, string, file); +} + +bool +QPDF::isEncrypted(int& R, int& P, int& V, + encryption_method_e& stream_method, + encryption_method_e& string_method, + encryption_method_e& file_method) +{ + if (this->encrypted) + { + QPDFObjectHandle trailer = getTrailer(); + QPDFObjectHandle encrypt = trailer.getKey("/Encrypt"); + QPDFObjectHandle Pkey = encrypt.getKey("/P"); + QPDFObjectHandle Rkey = encrypt.getKey("/R"); + QPDFObjectHandle Vkey = encrypt.getKey("/V"); + P = Pkey.getIntValue(); + R = Rkey.getIntValue(); + V = Vkey.getIntValue(); + stream_method = this->cf_stream; + string_method = this->cf_stream; + file_method = this->cf_file; + return true; + } + else + { + return false; + } +} + +static bool +is_bit_set(int P, int bit) +{ + // Bits in P are numbered from 1 in the spec + return (P & (1 << (bit - 1))); +} + +bool +QPDF::allowAccessibility() +{ + int R = 0; + int P = 0; + bool status = true; + if (isEncrypted(R, P)) + { + if (R < 3) + { + status = is_bit_set(P, 5); + } + else + { + status = is_bit_set(P, 10); + } + } + return status; +} + +bool +QPDF::allowExtractAll() +{ + int R = 0; + int P = 0; + bool status = true; + if (isEncrypted(R, P)) + { + status = is_bit_set(P, 5); + } + return status; +} + +bool +QPDF::allowPrintLowRes() +{ + int R = 0; + int P = 0; + bool status = true; + if (isEncrypted(R, P)) + { + status = is_bit_set(P, 3); + } + return status; +} + +bool +QPDF::allowPrintHighRes() +{ + int R = 0; + int P = 0; + bool status = true; + if (isEncrypted(R, P)) + { + status = is_bit_set(P, 3); + if ((R >= 3) && (! is_bit_set(P, 12))) + { + status = false; + } + } + return status; +} + +bool +QPDF::allowModifyAssembly() +{ + int R = 0; + int P = 0; + bool status = true; + if (isEncrypted(R, P)) + { + if (R < 3) + { + status = is_bit_set(P, 4); + } + else + { + status = is_bit_set(P, 11); + } + } + return status; +} + +bool +QPDF::allowModifyForm() +{ + int R = 0; + int P = 0; + bool status = true; + if (isEncrypted(R, P)) + { + if (R < 3) + { + status = is_bit_set(P, 6); + } + else + { + status = is_bit_set(P, 9); + } + } + return status; +} + +bool +QPDF::allowModifyAnnotation() +{ + int R = 0; + int P = 0; + bool status = true; + if (isEncrypted(R, P)) + { + status = is_bit_set(P, 6); + } + return status; +} + +bool +QPDF::allowModifyOther() +{ + int R = 0; + int P = 0; + bool status = true; + if (isEncrypted(R, P)) + { + status = is_bit_set(P, 4); + } + return status; +} + +bool +QPDF::allowModifyAll() +{ + int R = 0; + int P = 0; + bool status = true; + if (isEncrypted(R, P)) + { + status = (is_bit_set(P, 4) && is_bit_set(P, 6)); + if (R >= 3) + { + status = status && (is_bit_set(P, 9) && is_bit_set(P, 11)); + } + } + return status; +} diff --git a/libqpdf/QPDF_linearization.cc b/libqpdf/QPDF_linearization.cc new file mode 100644 index 0000000..65f2b99 --- /dev/null +++ b/libqpdf/QPDF_linearization.cc @@ -0,0 +1,2137 @@ +// See doc/linearization. + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +template +static void +load_vector_int(BitStream& bit_stream, int nitems, std::vector& vec, + int bits_wanted, int_type T::*field) +{ + // nitems times, read bits_wanted from the given bit stream, + // storing results in the ith vector entry. + + for (int i = 0; i < nitems; ++i) + { + vec[i].*field = bit_stream.getBits(bits_wanted); + } + // The PDF spec says that each hint table starts at a byte + // boundary. Each "row" actually must start on a byte boundary. + bit_stream.skipToNextByte(); +} + +template +static void +load_vector_vector(BitStream& bit_stream, + int nitems1, std::vector& vec1, int T::*nitems2, + int bits_wanted, std::vector T::*vec2) +{ + // nitems1 times, read nitems2 (from the ith element of vec1) items + // into the vec2 vector field of the ith item of vec1. + for (int i1 = 0; i1 < nitems1; ++i1) + { + for (int i2 = 0; i2 < vec1[i1].*nitems2; ++i2) + { + (vec1[i1].*vec2).push_back(bit_stream.getBits(bits_wanted)); + } + } + bit_stream.skipToNextByte(); +} + +bool +QPDF::checkLinearization() +{ + bool result = false; + try + { + readLinearizationData(); + result = checkLinearizationInternal(); + } + catch (QPDFExc& e) + { + *out_stream << e.what() << std::endl; + } + return result; +} + +bool +QPDF::isLinearized() +{ + // If the first object in the file is a dictionary with a suitable + // /Linearized key and has an /L key that accurately indicates the + // file size, initialize this->lindict and return true. + + // A linearized PDF spec's first object will be contained within + // the first 1024 bytes of the file and will be a dictionary with + // a valid /Linearized key. This routine looks for that and does + // no additional validation. + + // The PDF spec says the linearization dictionary must be + // completely contained within the first 1024 bytes of the file. + // Add a byte for a null terminator. + static int const tbuf_size = 1025; + + char* buf = new char[tbuf_size]; + this->file->seek(0, SEEK_SET); + PointerHolder b(true, buf); + memset(buf, '\0', tbuf_size); + this->file->read(buf, tbuf_size - 1); + + PCRE lindict_re("(?s:(\\d+)\\s+0\\s+obj\\s*<<)"); + + int lindict_obj = -1; + char* p = buf; + while (lindict_obj == -1) + { + PCRE::Match m(lindict_re.match(p)); + if (m) + { + lindict_obj = atoi(m.getMatch(1).c_str()); + if (m.getMatch(0).find('\n') != std::string::npos) + { + QTC::TC("qpdf", "QPDF lindict found newline"); + } + } + else + { + p = (char*)memchr(p, '\0', tbuf_size - (p - buf)); + assert(p != 0); + while ((p - buf < tbuf_size) && (*p == 0)) + { + ++p; + } + if ((p - buf) == tbuf_size) + { + break; + } + QTC::TC("qpdf", "QPDF lindict searching after null"); + } + } + + if (lindict_obj == 0) + { + return false; + } + + QPDFObjectHandle candidate = QPDFObjectHandle::Factory::newIndirect( + this, lindict_obj, 0); + if (! candidate.isDictionary()) + { + return false; + } + + QPDFObjectHandle linkey = candidate.getKey("/Linearized"); + if (! (linkey.isNumber() && ((int)floor(linkey.getNumericValue()) == 1))) + { + return false; + } + + QPDFObjectHandle L = candidate.getKey("/L"); + if (L.isInteger()) + { + qpdf_offset_t Li = L.getIntValue(); + this->file->seek(0, SEEK_END); + if (Li != this->file->tell()) + { + QTC::TC("qpdf", "QPDF /L mismatch"); + return false; + } + else + { + this->linp.file_size = Li; + } + } + + this->lindict = candidate; + + return true; +} + +void +QPDF::readLinearizationData() +{ + // This function throws an exception (which is trapped by + // checkLinearization()) for any errors that prevent loading. + + // Hint table parsing code needs at least 32 bits in a long. + assert(sizeof(long) >= 4); + + if (! isLinearized()) + { + throw std::logic_error("called readLinearizationData for file" + " that is not linearized"); + } + + // /L is read and stored in linp by isLinearized() + QPDFObjectHandle H = lindict.getKey("/H"); + QPDFObjectHandle O = lindict.getKey("/O"); + QPDFObjectHandle E = lindict.getKey("/E"); + QPDFObjectHandle N = lindict.getKey("/N"); + QPDFObjectHandle T = lindict.getKey("/T"); + QPDFObjectHandle P = lindict.getKey("/P"); + + if (! (H.isArray() && + O.isInteger() && + E.isInteger() && + N.isInteger() && + T.isInteger() && + (P.isInteger() || P.isNull()))) + { + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "linearization dictionary", + this->file->getLastOffset(), + "some keys in linearization dictionary are of " + "the wrong type"); + } + + // Hint table array: offset length [ offset length ] + unsigned int n_H_items = H.getArrayNItems(); + if (! ((n_H_items == 2) || (n_H_items == 4))) + { + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "linearization dictionary", + this->file->getLastOffset(), + "H has the wrong number of items"); + } + + std::vector H_items; + for (unsigned int i = 0; i < n_H_items; ++i) + { + QPDFObjectHandle oh(H.getArrayItem(i)); + if (oh.isInteger()) + { + H_items.push_back(oh.getIntValue()); + } + else + { + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "linearization dictionary", + this->file->getLastOffset(), + "some H items are of the wrong type"); + } + } + + // H: hint table offset/length for primary and overflow hint tables + int H0_offset = H_items[0]; + int H0_length = H_items[1]; + int H1_offset = 0; + int H1_length = 0; + if (H_items.size() == 4) + { + // Acrobat doesn't read or write these (as PDF 1.4), so we + // don't have a way to generate a test case. + // QTC::TC("qpdf", "QPDF overflow hint table"); + H1_offset = H_items[2]; + H1_length = H_items[3]; + } + + // P: first page number + int first_page = 0; + if (P.isInteger()) + { + QTC::TC("qpdf", "QPDF P present in lindict"); + first_page = P.getIntValue(); + } + else + { + QTC::TC("qpdf", "QPDF P absent in lindict"); + } + + // Store linearization parameter data + + // file_size initialized by isLinearized() + this->linp.first_page_object = O.getIntValue(); + this->linp.first_page_end = E.getIntValue(); + this->linp.npages = N.getIntValue(); + this->linp.xref_zero_offset = T.getIntValue(); + this->linp.first_page = first_page; + this->linp.H_offset = H0_offset; + this->linp.H_length = H0_length; + + // Read hint streams + + Pl_Buffer pb("hint buffer"); + QPDFObjectHandle H0 = readHintStream(pb, H0_offset, H0_length); + if (H1_offset) + { + (void) readHintStream(pb, H1_offset, H1_length); + } + + // PDF 1.4 hint tables that we ignore: + + // /T thumbnail + // /A thread information + // /E named destination + // /V interactive form + // /I information dictionary + // /C logical structure + // /L page label + + // Individual hint table offsets + QPDFObjectHandle HS = H0.getKey("/S"); // shared object + QPDFObjectHandle HO = H0.getKey("/O"); // outline + + PointerHolder hbp = pb.getBuffer(); + Buffer* hb = hbp.getPointer(); + unsigned char const* h_buf = hb->getBuffer(); + int h_size = (int)hb->getSize(); + + readHPageOffset(BitStream(h_buf, h_size)); + + int HSi = HS.getIntValue(); + readHSharedObject(BitStream(h_buf + HSi, h_size - HSi)); + + if (HO.isInteger()) + { + int HOi = HO.getIntValue(); + readHGeneric(BitStream(h_buf + HOi, h_size - HOi), + this->outline_hints); + } +} + +QPDFObjectHandle +QPDF::readHintStream(Pipeline& pl, qpdf_offset_t offset, size_t length) +{ + int obj; + int gen; + QPDFObjectHandle H = readObjectAtOffset( + false, offset, "linearization hint stream", -1, 0, obj, gen); + ObjCache& oc = this->obj_cache[ObjGen(obj, gen)]; + qpdf_offset_t min_end_offset = oc.end_before_space; + qpdf_offset_t max_end_offset = oc.end_after_space; + if (! H.isStream()) + { + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "linearization dictionary", + this->file->getLastOffset(), + "hint table is not a stream"); + } + + QPDFObjectHandle Hdict = H.getDict(); + + // Some versions of Acrobat make /Length indirect and place it + // immediately after the stream, increasing length to cover it, + // even though the specification says all objects in the + // linearization parameter dictionary must be direct. We have to + // get the file position of the end of length in this case. + QPDFObjectHandle length_obj = Hdict.getKey("/Length"); + if (length_obj.isIndirect()) + { + QTC::TC("qpdf", "QPDF hint table length indirect"); + // Force resolution + (void) length_obj.getIntValue(); + ObjCache& oc = this->obj_cache + [ObjGen(length_obj.getObjectID(), + length_obj.getGeneration())]; + min_end_offset = oc.end_before_space; + max_end_offset = oc.end_after_space; + } + else + { + QTC::TC("qpdf", "QPDF hint table length direct"); + } + qpdf_offset_t computed_end = offset + (qpdf_offset_t)length; + if ((computed_end < min_end_offset) || + (computed_end > max_end_offset)) + { + *out_stream << "expected = " << computed_end + << "; actual = " << min_end_offset << ".." + << max_end_offset << std::endl; + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + "linearization dictionary", + this->file->getLastOffset(), + "hint table length mismatch"); + } + H.pipeStreamData(&pl, true, false, false); + return Hdict; +} + +void +QPDF::readHPageOffset(BitStream h) +{ + // All comments referring to the PDF spec refer to the spec for + // version 1.4. + + HPageOffset& t = this->page_offset_hints; + + t.min_nobjects = h.getBits(32); // 1 + t.first_page_offset = h.getBits(32); // 2 + t.nbits_delta_nobjects = h.getBits(16); // 3 + t.min_page_length = h.getBits(32); // 4 + t.nbits_delta_page_length = h.getBits(16); // 5 + t.min_content_offset = h.getBits(32); // 6 + t.nbits_delta_content_offset = h.getBits(16); // 7 + t.min_content_length = h.getBits(32); // 8 + t.nbits_delta_content_length = h.getBits(16); // 9 + t.nbits_nshared_objects = h.getBits(16); // 10 + t.nbits_shared_identifier = h.getBits(16); // 11 + t.nbits_shared_numerator = h.getBits(16); // 12 + t.shared_denominator = h.getBits(16); // 13 + + unsigned int nitems = this->linp.npages; + std::vector& entries = t.entries; + entries = std::vector(nitems); + + load_vector_int(h, nitems, entries, + t.nbits_delta_nobjects, + &HPageOffsetEntry::delta_nobjects); + load_vector_int(h, nitems, entries, + t.nbits_delta_page_length, + &HPageOffsetEntry::delta_page_length); + load_vector_int(h, nitems, entries, + t.nbits_nshared_objects, + &HPageOffsetEntry::nshared_objects); + load_vector_vector(h, nitems, entries, + &HPageOffsetEntry::nshared_objects, + t.nbits_shared_identifier, + &HPageOffsetEntry::shared_identifiers); + load_vector_vector(h, nitems, entries, + &HPageOffsetEntry::nshared_objects, + t.nbits_shared_numerator, + &HPageOffsetEntry::shared_numerators); + load_vector_int(h, nitems, entries, + t.nbits_delta_content_offset, + &HPageOffsetEntry::delta_content_offset); + load_vector_int(h, nitems, entries, + t.nbits_delta_content_length, + &HPageOffsetEntry::delta_content_length); +} + +void +QPDF::readHSharedObject(BitStream h) +{ + HSharedObject& t = this->shared_object_hints; + + t.first_shared_obj = h.getBits(32); // 1 + t.first_shared_offset = h.getBits(32); // 2 + t.nshared_first_page = h.getBits(32); // 3 + t.nshared_total = h.getBits(32); // 4 + t.nbits_nobjects = h.getBits(16); // 5 + t.min_group_length = h.getBits(32); // 6 + t.nbits_delta_group_length = h.getBits(16); // 7 + + QTC::TC("qpdf", "QPDF lin nshared_total > nshared_first_page", + (t.nshared_total > t.nshared_first_page) ? 1 : 0); + + int nitems = t.nshared_total; + std::vector& entries = t.entries; + entries = std::vector(nitems); + + load_vector_int(h, nitems, entries, + t.nbits_delta_group_length, + &HSharedObjectEntry::delta_group_length); + load_vector_int(h, nitems, entries, + 1, &HSharedObjectEntry::signature_present); + for (int i = 0; i < nitems; ++i) + { + if (entries[i].signature_present) + { + // Skip 128-bit MD5 hash. These are not supported by + // acrobat, so they should probably never be there. We + // have no test case for this. + for (int j = 0; j < 4; ++j) + { + (void) h.getBits(32); + } + } + } + load_vector_int(h, nitems, entries, + t.nbits_nobjects, + &HSharedObjectEntry::nobjects_minus_one); +} + +void +QPDF::readHGeneric(BitStream h, HGeneric& t) +{ + t.first_object = h.getBits(32); // 1 + t.first_object_offset = h.getBits(32); // 2 + t.nobjects = h.getBits(32); // 3 + t.group_length = h.getBits(32); // 4 +} + +bool +QPDF::checkLinearizationInternal() +{ + // All comments referring to the PDF spec refer to the spec for + // version 1.4. + + std::list errors; + std::list warnings; + + // Check all values in linearization parameter dictionary + + LinParameters& p = this->linp; + + // L: file size in bytes -- checked by isLinearized + + // O: object number of first page + std::vector const& pages = getAllPages(); + if (p.first_page_object != pages[0].getObjectID()) + { + QTC::TC("qpdf", "QPDF err /O mismatch"); + errors.push_back("first page object (/O) mismatch"); + } + + // N: number of pages + int npages = (int)pages.size(); + if (p.npages != npages) + { + // Not tested in the test suite + errors.push_back("page count (/N) mismatch"); + } + + for (int i = 0; i < npages; ++i) + { + QPDFObjectHandle const& page = pages[i]; + ObjGen og(page.getObjectID(), page.getGeneration()); + if (this->xref_table[og].getType() == 2) + { + errors.push_back("page dictionary for page " + + QUtil::int_to_string(i) + " is compressed"); + } + } + + // T: offset of whitespace character preceding xref entry for object 0 + this->file->seek(p.xref_zero_offset, SEEK_SET); + while (1) + { + char ch; + this->file->read(&ch, 1); + if (! ((ch == ' ') || (ch == '\r') || (ch == '\n'))) + { + this->file->seek(-1, SEEK_CUR); + break; + } + } + if (this->file->tell() != this->first_xref_item_offset) + { + QTC::TC("qpdf", "QPDF err /T mismatch"); + errors.push_back("space before first xref item (/T) mismatch " + "(computed = " + + QUtil::int_to_string(this->first_xref_item_offset) + + "; file = " + + QUtil::int_to_string(this->file->tell())); + } + + // P: first page number -- Implementation note 124 says Acrobat + // ignores this value, so we will too. + + // Check numbering of compressed objects in each xref section. + // For linearized files, all compressed objects are supposed to be + // at the end of the containing xref section if any object streams + // are in use. + + if (this->uncompressed_after_compressed) + { + errors.push_back("linearized file contains an uncompressed object" + " after a compressed one in a cross-reference stream"); + } + + // Further checking requires optimization and order calculation. + // Don't allow optimization to make changes. If it has to, then + // the file is not properly linearized. We use the xref table to + // figure out which objects are compressed and which are + // uncompressed. + { // local scope + std::map object_stream_data; + for (std::map::const_iterator iter = + this->xref_table.begin(); + iter != this->xref_table.end(); ++iter) + { + ObjGen const& og = (*iter).first; + QPDFXRefEntry const& entry = (*iter).second; + if (entry.getType() == 2) + { + object_stream_data[og.obj] = entry.getObjStreamNumber(); + } + } + optimize(object_stream_data, false); + calculateLinearizationData(object_stream_data); + } + + // E: offset of end of first page -- Implementation note 123 says + // Acrobat includes on extra object here by mistake. pdlin fails + // to place thumbnail images in section 9, so when thumbnails are + // present, it also gets the wrong value for /E. It also doesn't + // count outlines here when it should even though it places them + // in part 6. This code fails to put thread information + // dictionaries in part 9, so it actually gets the wrong value for + // E when threads are present. In that case, it would probably + // agree with pdlin. As of this writing, the test suite doesn't + // contain any files with threads. + + assert(! this->part6.empty()); + int min_E = -1; + int max_E = -1; + for (std::vector::iterator iter = this->part6.begin(); + iter != this->part6.end(); ++iter) + { + ObjGen og((*iter).getObjectID(), (*iter).getGeneration()); + // All objects have to have been dereferenced to be classified. + assert(this->obj_cache.count(og) > 0); + ObjCache const& oc = this->obj_cache[og]; + min_E = std::max(min_E, (int)oc.end_before_space); + max_E = std::max(max_E, (int)oc.end_after_space); + } + if ((p.first_page_end < min_E) || (p.first_page_end > max_E)) + { + QTC::TC("qpdf", "QPDF warn /E mismatch"); + warnings.push_back("end of first page section (/E) mismatch: /E = " + + QUtil::int_to_string(p.first_page_end) + + "; computed = " + + QUtil::int_to_string(min_E) + ".." + + QUtil::int_to_string(max_E)); + } + + // Check hint tables + + std::map shared_idx_to_obj; + checkHSharedObject(errors, warnings, pages, shared_idx_to_obj); + checkHPageOffset(errors, warnings, pages, shared_idx_to_obj); + checkHOutlines(warnings); + + // Report errors + + bool result = true; + + if (! errors.empty()) + { + result = false; + for (std::list::iterator iter = errors.begin(); + iter != errors.end(); ++iter) + { + *out_stream << "ERROR: " << (*iter) << std::endl; + } + } + + if (! warnings.empty()) + { + result = false; + for (std::list::iterator iter = warnings.begin(); + iter != warnings.end(); ++iter) + { + *out_stream << "WARNING: " << (*iter) << std::endl; + } + } + + return result; +} + +int +QPDF::maxEnd(ObjUser const& ou) +{ + assert(this->obj_user_to_objects.count(ou) > 0); + std::set const& ogs = this->obj_user_to_objects[ou]; + int end = 0; + for (std::set::const_iterator iter = ogs.begin(); + iter != ogs.end(); ++iter) + { + ObjGen const& og = *iter; + assert(this->obj_cache.count(og) > 0); + end = std::max( + end, (int)(this->obj_cache[og].end_after_space)); + } + return end; +} + +qpdf_offset_t +QPDF::getLinearizationOffset(ObjGen const& og) +{ + QPDFXRefEntry entry = this->xref_table[og]; + qpdf_offset_t result = 0; + switch (entry.getType()) + { + case 1: + result = entry.getOffset(); + break; + + case 2: + // For compressed objects, return the offset of the object + // stream that contains them. + result = getLinearizationOffset(ObjGen(entry.getObjStreamNumber(), 0)); + break; + + default: + throw std::logic_error( + "getLinearizationOffset called for xref entry not of type 1 or 2"); + break; + } + return result; +} + +QPDFObjectHandle +QPDF::getUncompressedObject(QPDFObjectHandle& obj, + std::map const& object_stream_data) +{ + if (obj.isNull() || (object_stream_data.count(obj.getObjectID()) == 0)) + { + return obj; + } + else + { + int repl = (*(object_stream_data.find(obj.getObjectID()))).second; + return objGenToIndirect(ObjGen(repl, 0)); + } +} + +int +QPDF::lengthNextN(int first_object, int n, + std::list& errors) +{ + int length = 0; + for (int i = 0; i < n; ++i) + { + ObjGen og(first_object + i, 0); + if (this->xref_table.count(og) == 0) + { + errors.push_back( + "no xref table entry for " + + QUtil::int_to_string(first_object + i) + " 0"); + } + else + { + assert(this->obj_cache.count(og) > 0); + length += this->obj_cache[og].end_after_space - + getLinearizationOffset(og); + } + } + return length; +} + +void +QPDF::checkHPageOffset(std::list& errors, + std::list& warnings, + std::vector const& pages, + std::map& shared_idx_to_obj) +{ + // Implementation note 126 says Acrobat always sets + // delta_content_offset and delta_content_length in the page + // offset header dictionary to 0. It also states that + // min_content_offset in the per-page information is always 0, + // which is an incorrect value. + + // Implementation note 127 explains that Acrobat always sets item + // 8 (min_content_length) to zero, item 9 + // (nbits_delta_content_length) to the value of item 5 + // (nbits_delta_page_length), and item 7 of each per-page hint + // table (delta_content_length) to item 2 (delta_page_length) of + // that entry. Acrobat ignores these values when reading files. + + // Empirically, it also seems that Acrobat sometimes puts items + // under a page's /Resources dictionary in with shared objects + // even when they are private. + + unsigned int npages = (unsigned int)pages.size(); + int table_offset = adjusted_offset( + this->page_offset_hints.first_page_offset); + ObjGen first_page_og(pages[0].getObjectID(), pages[0].getGeneration()); + assert(this->xref_table.count(first_page_og) > 0); + int offset = getLinearizationOffset(first_page_og); + if (table_offset != offset) + { + warnings.push_back("first page object offset mismatch"); + } + + for (unsigned int pageno = 0; pageno < npages; ++pageno) + { + ObjGen page_og(pages[pageno].getObjectID(), + pages[pageno].getGeneration()); + int first_object = page_og.obj; + assert(this->xref_table.count(page_og) > 0); + offset = getLinearizationOffset(page_og); + + HPageOffsetEntry& he = this->page_offset_hints.entries[pageno]; + CHPageOffsetEntry& ce = this->c_page_offset_data.entries[pageno]; + int h_nobjects = he.delta_nobjects + + this->page_offset_hints.min_nobjects; + if (h_nobjects != ce.nobjects) + { + // This happens with pdlin when there are thumbnails. + warnings.push_back( + "object count mismatch for page " + + QUtil::int_to_string(pageno) + ": hint table = " + + QUtil::int_to_string(h_nobjects) + "; computed = " + + QUtil::int_to_string(ce.nobjects)); + } + + // Use value for number of objects in hint table rather than + // computed value if there is a discrepancy. + int length = lengthNextN(first_object, h_nobjects, errors); + int h_length = he.delta_page_length + + this->page_offset_hints.min_page_length; + if (length != h_length) + { + // This condition almost certainly indicates a bad hint + // table or a bug in this code. + errors.push_back( + "page length mismatch for page " + + QUtil::int_to_string(pageno) + ": hint table = " + + QUtil::int_to_string(h_length) + "; computed length = " + + QUtil::int_to_string(length) + " (offset = " + + QUtil::int_to_string(offset) + ")"); + } + + offset += h_length; + + // Translate shared object indexes to object numbers. + std::set hint_shared; + std::set computed_shared; + + if ((pageno == 0) && (he.nshared_objects > 0)) + { + // pdlin and Acrobat both do this even though the spec + // states clearly and unambiguously that they should not. + warnings.push_back("page 0 has shared identifier entries"); + } + + for (int i = 0; i < he.nshared_objects; ++i) + { + int idx = he.shared_identifiers[i]; + assert(shared_idx_to_obj.count(idx) > 0); + hint_shared.insert(shared_idx_to_obj[idx]); + } + + for (int i = 0; i < ce.nshared_objects; ++i) + { + int idx = ce.shared_identifiers[i]; + assert(idx < this->c_shared_object_data.nshared_total); + int obj = this->c_shared_object_data.entries[idx].object; + computed_shared.insert(obj); + } + + for (std::set::iterator iter = hint_shared.begin(); + iter != hint_shared.end(); ++iter) + { + if (! computed_shared.count(*iter)) + { + // pdlin puts thumbnails here even though it shouldn't + warnings.push_back( + "page " + QUtil::int_to_string(pageno) + + ": shared object " + QUtil::int_to_string(*iter) + + ": in hint table but not computed list"); + } + } + + for (std::set::iterator iter = computed_shared.begin(); + iter != computed_shared.end(); ++iter) + { + if (! hint_shared.count(*iter)) + { + // Acrobat does not put some things including at least + // built-in fonts and procsets here, at least in some + // cases. + warnings.push_back( + "page " + QUtil::int_to_string(pageno) + + ": shared object " + QUtil::int_to_string(*iter) + + ": in computed list but not hint table"); + } + } + } +} + +void +QPDF::checkHSharedObject(std::list& errors, + std::list& warnings, + std::vector const& pages, + std::map& idx_to_obj) +{ + // Implementation note 125 says shared object groups always + // contain only one object. Implementation note 128 says that + // Acrobat always nbits_nobjects to zero. Implementation note 130 + // says that Acrobat does not support more than one shared object + // per group. These are all consistent. + + // Implementation note 129 states that MD5 signatures are not + // implemented in Acrobat, so signature_present must always be + // zero. + + // Implementation note 131 states that first_shared_obj and + // first_shared_offset have meaningless values for single-page + // files. + + // Empirically, Acrobat and pdlin generate incorrect values for + // these whenever there are no shared objects not referenced by + // the first page (i.e., nshared_total == nshared_first_page). + + HSharedObject& so = this->shared_object_hints; + if (so.nshared_total < so.nshared_first_page) + { + errors.push_back("shared object hint table: ntotal < nfirst_page"); + } + else + { + // The first nshared_first_page objects are consecutive + // objects starting with the first page object. The rest are + // consecutive starting from the first_shared_obj object. + int cur_object = pages[0].getObjectID(); + for (int i = 0; i < so.nshared_total; ++i) + { + if (i == so.nshared_first_page) + { + QTC::TC("qpdf", "QPDF lin check shared past first page"); + if (this->part8.empty()) + { + errors.push_back( + "part 8 is empty but nshared_total > " + "nshared_first_page"); + } + else + { + int obj = this->part8[0].getObjectID(); + if (obj != so.first_shared_obj) + { + errors.push_back( + "first shared object number mismatch: " + "hint table = " + + QUtil::int_to_string(so.first_shared_obj) + + "; computed = " + + QUtil::int_to_string(obj)); + } + } + + cur_object = so.first_shared_obj; + + ObjGen og(cur_object, 0); + assert(this->xref_table.count(og) > 0); + int offset = getLinearizationOffset(og); + int h_offset = adjusted_offset(so.first_shared_offset); + if (offset != h_offset) + { + errors.push_back( + "first shared object offset mismatch: hint table = " + + QUtil::int_to_string(h_offset) + "; computed = " + + QUtil::int_to_string(offset)); + } + } + + idx_to_obj[i] = cur_object; + HSharedObjectEntry& se = so.entries[i]; + int nobjects = se.nobjects_minus_one + 1; + int length = lengthNextN(cur_object, nobjects, errors); + int h_length = so.min_group_length + se.delta_group_length; + if (length != h_length) + { + errors.push_back( + "shared object " + QUtil::int_to_string(i) + + " length mismatch: hint table = " + + QUtil::int_to_string(h_length) + "; computed = " + + QUtil::int_to_string(length)); + } + cur_object += nobjects; + } + } +} + +void +QPDF::checkHOutlines(std::list& warnings) +{ + // Empirically, Acrobat generates the correct value for the object + // number but incorrectly stores the next object number's offset + // as the offset, at least when outlines appear in part 6. It + // also generates an incorrect value for length (specifically, the + // length that would cover the correct number of objects from the + // wrong starting place). pdlin appears to generate correct + // values in those cases. + + if (this->c_outline_data.nobjects == this->outline_hints.nobjects) + { + if (this->c_outline_data.nobjects == 0) + { + return; + } + + if (this->c_outline_data.first_object == + this->outline_hints.first_object) + { + // Check length and offset. Acrobat gets these wrong. + QPDFObjectHandle outlines = getRoot().getKey("/Outlines"); + ObjGen og(outlines.getObjectID(), outlines.getGeneration()); + assert(this->xref_table.count(og) > 0); + int offset = getLinearizationOffset(og); + ObjUser ou(ObjUser::ou_root_key, "/Outlines"); + int length = maxEnd(ou) - offset; + int table_offset = + adjusted_offset(this->outline_hints.first_object_offset); + if (offset != table_offset) + { + warnings.push_back( + "incorrect offset in outlines table: hint table = " + + QUtil::int_to_string(table_offset) + + "; computed = " + QUtil::int_to_string(offset)); + } + int table_length = this->outline_hints.group_length; + if (length != table_length) + { + warnings.push_back( + "incorrect length in outlines table: hint table = " + + QUtil::int_to_string(table_length) + + "; computed = " + QUtil::int_to_string(length)); + } + } + else + { + warnings.push_back("incorrect first object number in outline " + "hints table."); + } + } + else + { + warnings.push_back("incorrect object count in outline hint table"); + } +} + +void +QPDF::showLinearizationData() +{ + try + { + readLinearizationData(); + checkLinearizationInternal(); + dumpLinearizationDataInternal(); + } + catch (QPDFExc& e) + { + *out_stream << e.what() << std::endl; + } +} + +void +QPDF::dumpLinearizationDataInternal() +{ + *out_stream << this->file->getName() << ": linearization data:" << std::endl + << std::endl; + + *out_stream + << "file_size: " << this->linp.file_size << std::endl + << "first_page_object: " << this->linp.first_page_object << std::endl + << "first_page_end: " << this->linp.first_page_end << std::endl + << "npages: " << this->linp.npages << std::endl + << "xref_zero_offset: " << this->linp.xref_zero_offset << std::endl + << "first_page: " << this->linp.first_page << std::endl + << "H_offset: " << this->linp.H_offset << std::endl + << "H_length: " << this->linp.H_length << std::endl + << std::endl; + + *out_stream << "Page Offsets Hint Table" << std::endl + << std::endl; + dumpHPageOffset(); + *out_stream << std::endl + << "Shared Objects Hint Table" << std::endl + << std::endl; + dumpHSharedObject(); + + if (this->outline_hints.nobjects > 0) + { + *out_stream << std::endl + << "Outlines Hint Table" << std::endl + << std::endl; + dumpHGeneric(this->outline_hints); + } +} + +int +QPDF::adjusted_offset(int offset) +{ + // All offsets >= H_offset have to be increased by H_length + // since all hint table location values disregard the hint table + // itself. + if (offset >= this->linp.H_offset) + { + return offset + this->linp.H_length; + } + return offset; +} + + +void +QPDF::dumpHPageOffset() +{ + HPageOffset& t = this->page_offset_hints; + *out_stream + << "min_nobjects: " << t.min_nobjects + << std::endl + << "first_page_offset: " << adjusted_offset(t.first_page_offset) + << std::endl + << "nbits_delta_nobjects: " << t.nbits_delta_nobjects + << std::endl + << "min_page_length: " << t.min_page_length + << std::endl + << "nbits_delta_page_length: " << t.nbits_delta_page_length + << std::endl + << "min_content_offset: " << t.min_content_offset + << std::endl + << "nbits_delta_content_offset: " << t.nbits_delta_content_offset + << std::endl + << "min_content_length: " << t.min_content_length + << std::endl + << "nbits_delta_content_length: " << t.nbits_delta_content_length + << std::endl + << "nbits_nshared_objects: " << t.nbits_nshared_objects + << std::endl + << "nbits_shared_identifier: " << t.nbits_shared_identifier + << std::endl + << "nbits_shared_numerator: " << t.nbits_shared_numerator + << std::endl + << "shared_denominator: " << t.shared_denominator + << std::endl; + + for (int i1 = 0; i1 < this->linp.npages; ++i1) + { + HPageOffsetEntry& pe = t.entries[i1]; + *out_stream + << "Page " << i1 << ":" << std::endl + << " nobjects: " << pe.delta_nobjects + t.min_nobjects + << std::endl + << " length: " << pe.delta_page_length + t.min_page_length + << std::endl + // content offset is relative to page, not file + << " content_offset: " + << pe.delta_content_offset + t.min_content_offset << std::endl + << " content_length: " + << pe.delta_content_length + t.min_content_length << std::endl + << " nshared_objects: " << pe.nshared_objects << std::endl; + for (int i2 = 0; i2 < pe.nshared_objects; ++i2) + { + *out_stream << " identifier " << i2 << ": " + << pe.shared_identifiers[i2] << std::endl; + *out_stream << " numerator " << i2 << ": " + << pe.shared_numerators[i2] << std::endl; + } + } +} + +void +QPDF::dumpHSharedObject() +{ + HSharedObject& t = this->shared_object_hints; + *out_stream + << "first_shared_obj: " << t.first_shared_obj + << std::endl + << "first_shared_offset: " << adjusted_offset(t.first_shared_offset) + << std::endl + << "nshared_first_page: " << t.nshared_first_page + << std::endl + << "nshared_total: " << t.nshared_total + << std::endl + << "nbits_nobjects: " << t.nbits_nobjects + << std::endl + << "min_group_length: " << t.min_group_length + << std::endl + << "nbits_delta_group_length: " << t.nbits_delta_group_length + << std::endl; + + for (int i = 0; i < t.nshared_total; ++i) + { + HSharedObjectEntry& se = t.entries[i]; + *out_stream << "Shared Object " << i << ":" << std::endl; + *out_stream << " group length: " + << se.delta_group_length + t.min_group_length << std::endl; + // PDF spec says signature present nobjects_minus_one are + // always 0, so print them only if they have a non-zero value. + if (se.signature_present) + { + *out_stream << " signature present" << std::endl; + } + if (se.nobjects_minus_one != 0) + { + *out_stream << " nobjects: " + << se.nobjects_minus_one + 1 << std::endl; + } + } +} + +void +QPDF::dumpHGeneric(HGeneric& t) +{ + *out_stream + << "first_object: " << t.first_object + << std::endl + << "first_object_offset: " << adjusted_offset(t.first_object_offset) + << std::endl + << "nobjects: " << t.nobjects + << std::endl + << "group_length: " << t.group_length + << std::endl; +} + +QPDFObjectHandle +QPDF::objGenToIndirect(ObjGen const& og) +{ + return getObjectByID(og.obj, og.gen); +} + +void +QPDF::calculateLinearizationData(std::map const& object_stream_data) +{ + // This function calculates the ordering of objects, divides them + // into the appropriate parts, and computes some values for the + // linearization parameter dictionary and hint tables. The file + // must be optimized (via calling optimize()) prior to calling + // this function. Note that actual offsets and lengths are not + // computed here, but anything related to object ordering is. + + if (this->object_to_obj_users.empty()) + { + // Note that we can't call optimize here because we don't know + // whether it should be called with or without allow changes. + throw std::logic_error( + "INTERNAL ERROR: QPDF::calculateLinearizationData " + "called before optimize()"); + } + + // Separate objects into the categories sufficient for us to + // determine which part of the linearized file should contain the + // object. This categorization is useful for other purposes as + // well. Part numbers refer to version 1.4 of the PDF spec. + + // Parts 1, 3, 5, 10, and 11 don't contain any objects from the + // original file (except the trailer dictionary in part 11). + + // Part 4 is the document catalog (root) and the following root + // keys: /ViewerPreferences, /PageMode, /Threads, /OpenAction, + // /AcroForm, /Encrypt. Note that Thread information dictionaries + // are supposed to appear in part 9, but we are disregarding that + // recommendation for now. + + // Part 6 is the first page section. It includes all remaining + // objects referenced by the first page including shared objects + // but not including thumbnails. Additionally, if /PageMode is + // /Outlines, then information from /Outlines also appears here. + + // Part 7 contains remaining objects private to pages other than + // the first page. + + // Part 8 contains all remaining shared objects except those that + // are shared only within thumbnails. + + // Part 9 contains all remaining objects. + + // We sort objects into the following categories: + + // * open_document: part 4 + + // * first_page_private: part 6 + + // * first_page_shared: part 6 + + // * other_page_private: part 7 + + // * other_page_shared: part 8 + + // * thumbnail_private: part 9 + + // * thumbnail_shared: part 9 + + // * other: part 9 + + // * outlines: part 6 or 9 + + this->part4.clear(); + this->part6.clear(); + this->part7.clear(); + this->part8.clear(); + this->part9.clear(); + this->c_linp = LinParameters(); + this->c_page_offset_data = CHPageOffset(); + this->c_shared_object_data = CHSharedObject(); + this->c_outline_data = HGeneric(); + + QPDFObjectHandle root = getRoot(); + bool outlines_in_first_page = false; + QPDFObjectHandle pagemode = root.getKey("/PageMode"); + QTC::TC("qpdf", "QPDF categorize pagemode present", + pagemode.isName() ? 1 : 0); + if (pagemode.isName()) + { + if (pagemode.getName() == "/UseOutlines") + { + if (root.hasKey("/Outlines")) + { + outlines_in_first_page = true; + } + else + { + QTC::TC("qpdf", "QPDF UseOutlines but no Outlines"); + } + } + QTC::TC("qpdf", "QPDF categorize pagemode outlines", + outlines_in_first_page ? 1 : 0); + } + + std::set open_document_keys; + open_document_keys.insert("/ViewerPreferences"); + open_document_keys.insert("/PageMode"); + open_document_keys.insert("/Threads"); + open_document_keys.insert("/OpenAction"); + open_document_keys.insert("/AcroForm"); + + std::set lc_open_document; + std::set lc_first_page_private; + std::set lc_first_page_shared; + std::set lc_other_page_private; + std::set lc_other_page_shared; + std::set lc_thumbnail_private; + std::set lc_thumbnail_shared; + std::set lc_other; + std::set lc_outlines; + std::set lc_root; + + for (std::map >::iterator oiter = + this->object_to_obj_users.begin(); + oiter != this->object_to_obj_users.end(); ++oiter) + { + ObjGen const& og = (*oiter).first; + + std::set& ous = (*oiter).second; + + bool in_open_document = false; + bool in_first_page = false; + int other_pages = 0; + int thumbs = 0; + int others = 0; + bool in_outlines = false; + bool is_root = false; + + for (std::set::iterator uiter = ous.begin(); + uiter != ous.end(); ++uiter) + { + ObjUser const& ou = *uiter; + switch (ou.ou_type) + { + case ObjUser::ou_trailer_key: + if (ou.key == "/Encrypt") + { + in_open_document = true; + } + else + { + ++others; + } + break; + + case ObjUser::ou_thumb: + ++thumbs; + break; + + case ObjUser::ou_root_key: + if (open_document_keys.count(ou.key) > 0) + { + in_open_document = true; + } + else if (ou.key == "/Outlines") + { + in_outlines = true; + } + else + { + ++others; + } + break; + + case ObjUser::ou_page: + if (ou.pageno == 0) + { + in_first_page = true; + } + else + { + ++other_pages; + } + break; + + case ObjUser::ou_root: + is_root = true; + break; + + case ObjUser::ou_bad: + throw std::logic_error( + "INTERNAL ERROR: QPDF::calculateLinearizationData: " + "invalid user type"); + break; + } + } + + if (is_root) + { + lc_root.insert(og); + } + else if (in_outlines) + { + lc_outlines.insert(og); + } + else if (in_open_document) + { + lc_open_document.insert(og); + } + else if ((in_first_page) && + (others == 0) && (other_pages == 0) && (thumbs == 0)) + { + lc_first_page_private.insert(og); + } + else if (in_first_page) + { + lc_first_page_shared.insert(og); + } + else if ((other_pages == 1) && (others == 0) && (thumbs == 0)) + { + lc_other_page_private.insert(og); + } + else if (other_pages > 1) + { + lc_other_page_shared.insert(og); + } + else if ((thumbs == 1) && (others == 0)) + { + lc_thumbnail_private.insert(og); + } + else if (thumbs > 1) + { + lc_thumbnail_shared.insert(og); + } + else + { + lc_other.insert(og); + } + } + + // Generate ordering for objects in the output file. Sometimes we + // just dump right from a set into a vector. Rather than + // optimizing this by going straight into the vector, we'll leave + // these phases separate for now. That way, this section can be + // concerned only with ordering, and the above section can be + // considered only with categorization. Note that sets of ObjGens + // are sorted by ObjGen. In a linearized file, objects appear in + // sequence with the possible exception of hints tables which we + // won't see here anyway. That means that running + // calculateLinearizationData() on a linearized file should give + // results identical to the original file ordering. + + // We seem to traverse the page tree a lot in this code, but we + // can address this for a future code optimization if necessary. + // Premature optimization is the root of all evil. + std::vector pages; + { // local scope + // Map all page objects to the containing object stream. This + // should be a no-op in a properly linearized file. + std::vector t = getAllPages(); + for (std::vector::iterator iter = t.begin(); + iter != t.end(); ++iter) + { + pages.push_back(getUncompressedObject(*iter, object_stream_data)); + } + } + unsigned int npages = (unsigned int)pages.size(); + + // We will be initializing some values of the computed hint + // tables. Specifically, we can initialize any items that deal + // with object numbers or counts but not any items that deal with + // lengths or offsets. The code that writes linearized files will + // have to fill in these values during the first pass. The + // validation code can compute them relatively easily given the + // rest of the information. + + this->c_linp.npages = npages; + this->c_page_offset_data.entries = std::vector(npages); + + // Part 4: open document objects. We don't care about the order. + + assert(lc_root.size() == 1); + this->part4.push_back(objGenToIndirect(*(lc_root.begin()))); + for (std::set::iterator iter = lc_open_document.begin(); + iter != lc_open_document.end(); ++iter) + { + this->part4.push_back(objGenToIndirect(*iter)); + } + + // Part 6: first page objects. Note: implementation note 124 + // states that Acrobat always treats page 0 as the first page for + // linearization regardless of /OpenAction. pdlin doesn't provide + // any option to set this and also disregards /OpenAction. We + // will do the same. + + // First, place the actual first page object itself. + ObjGen first_page_og(pages[0].getObjectID(), pages[0].getGeneration()); + if (! lc_first_page_private.count(first_page_og)) + { + throw std::logic_error( + "INTERNAL ERROR: QPDF::calculateLinearizationData: first page " + "object not in lc_first_page_private"); + } + lc_first_page_private.erase(first_page_og); + this->c_linp.first_page_object = pages[0].getObjectID(); + this->part6.push_back(pages[0]); + + // The PDF spec "recommends" an order for the rest of the objects, + // but we are going to disregard it except to the extent that it + // groups private and shared objects contiguously for the sake of + // hint tables. + + for (std::set::iterator iter = lc_first_page_private.begin(); + iter != lc_first_page_private.end(); ++iter) + { + this->part6.push_back(objGenToIndirect(*iter)); + } + + for (std::set::iterator iter = lc_first_page_shared.begin(); + iter != lc_first_page_shared.end(); ++iter) + { + this->part6.push_back(objGenToIndirect(*iter)); + } + + // Place the outline dictionary if it goes in the first page section. + if (outlines_in_first_page) + { + pushOutlinesToPart(this->part6, lc_outlines, object_stream_data); + } + + // Fill in page offset hint table information for the first page. + // The PDF spec says that nshared_objects should be zero for the + // first page. pdlin does not appear to obey this, but it fills + // in garbage values for all the shared object identifiers on the + // first page. + + this->c_page_offset_data.entries[0].nobjects = (int)this->part6.size(); + + // Part 7: other pages' private objects + + // For each page in order: + for (unsigned int i = 1; i < npages; ++i) + { + // Place this page's page object + + ObjGen page_og(pages[i].getObjectID(), pages[i].getGeneration()); + if (! lc_other_page_private.count(page_og)) + { + throw std::logic_error( + "INTERNAL ERROR: " + "QPDF::calculateLinearizationData: page object for page " + + QUtil::int_to_string(i) + " not in lc_other_page_private"); + } + lc_other_page_private.erase(page_og); + this->part7.push_back(pages[i]); + + // Place all non-shared objects referenced by this page, + // updating the page object count for the hint table. + + this->c_page_offset_data.entries[i].nobjects = 1; + + ObjUser ou(ObjUser::ou_page, i); + assert(this->obj_user_to_objects.count(ou) > 0); + std::set ogs = this->obj_user_to_objects[ou]; + for (std::set::iterator iter = ogs.begin(); + iter != ogs.end(); ++iter) + { + ObjGen const& og = (*iter); + if (lc_other_page_private.count(og)) + { + lc_other_page_private.erase(og); + this->part7.push_back(objGenToIndirect(og)); + ++this->c_page_offset_data.entries[i].nobjects; + } + } + } + // That should have covered all part7 objects. + if (! lc_other_page_private.empty()) + { + throw std::logic_error( + "INTERNAL ERROR:" + " QPDF::calculateLinearizationData: lc_other_page_private is " + "not empty after generation of part7"); + } + + // Part 8: other pages' shared objects + + // Order is unimportant. + for (std::set::iterator iter = lc_other_page_shared.begin(); + iter != lc_other_page_shared.end(); ++iter) + { + this->part8.push_back(objGenToIndirect(*iter)); + } + + // Part 9: other objects + + // The PDF specification makes recommendations on ordering here. + // We follow them only to a limited extent. Specifically, we put + // the pages tree first, then private thumbnail objects in page + // order, then shared thumbnail objects, and then outlines (unless + // in part 6). After that, we throw all remaining objects in + // arbitrary order. + + // Place the pages tree. + std::set pages_ogs = + this->obj_user_to_objects[ObjUser(ObjUser::ou_root_key, "/Pages")]; + assert(! pages_ogs.empty()); + for (std::set::iterator iter = pages_ogs.begin(); + iter != pages_ogs.end(); ++iter) + { + ObjGen const& og = *iter; + if (lc_other.count(og)) + { + lc_other.erase(og); + this->part9.push_back(objGenToIndirect(og)); + } + } + + // Place private thumbnail images in page order. Slightly more + // information would be required if we were going to bother with + // thumbnail hint tables. + for (unsigned int i = 0; i < npages; ++i) + { + QPDFObjectHandle thumb = pages[i].getKey("/Thumb"); + thumb = getUncompressedObject(thumb, object_stream_data); + if (! thumb.isNull()) + { + // Output the thumbnail itself + ObjGen thumb_og(thumb.getObjectID(), thumb.getGeneration()); + if (lc_thumbnail_private.count(thumb_og)) + { + lc_thumbnail_private.erase(thumb_og); + this->part9.push_back(thumb); + } + else + { + // No internal error this time...there's nothing to + // stop this object from having been referred to + // somewhere else outside of a page's /Thumb, and if + // it had been, there's nothing to prevent it from + // having been in some set other than + // lc_thumbnail_private. + } + std::set& ogs = + this->obj_user_to_objects[ObjUser(ObjUser::ou_thumb, i)]; + for (std::set::iterator iter = ogs.begin(); + iter != ogs.end(); ++iter) + { + ObjGen const& og = *iter; + if (lc_thumbnail_private.count(og)) + { + lc_thumbnail_private.erase(og); + this->part9.push_back(objGenToIndirect(og)); + } + } + } + } + if (! lc_thumbnail_private.empty()) + { + throw std::logic_error( + "INTERNAL ERROR: " + "QPDF::calculateLinearizationData: lc_thumbnail_private " + "not empty after placing thumbnails"); + } + + // Place shared thumbnail objects + for (std::set::iterator iter = lc_thumbnail_shared.begin(); + iter != lc_thumbnail_shared.end(); ++iter) + { + this->part9.push_back(objGenToIndirect(*iter)); + } + + // Place outlines unless in first page + if (! outlines_in_first_page) + { + pushOutlinesToPart(this->part9, lc_outlines, object_stream_data); + } + + // Place all remaining objects + for (std::set::iterator iter = lc_other.begin(); + iter != lc_other.end(); ++iter) + { + this->part9.push_back(objGenToIndirect(*iter)); + } + + // Make sure we got everything exactly once. + + unsigned int num_placed = + (unsigned int)(this->part4.size() + this->part6.size() + + this->part7.size() + this->part8.size() + + this->part9.size()); + unsigned int num_wanted = (unsigned int)this->object_to_obj_users.size(); + if (num_placed != num_wanted) + { + throw std::logic_error( + "INTERNAL ERROR: QPDF::calculateLinearizationData: wrong " + "number of objects placed (num_placed = " + + QUtil::int_to_string(num_placed) + + "; number of objects: " + + QUtil::int_to_string(num_wanted)); + } + + // Calculate shared object hint table information including + // references to shared objects from page offset hint data. + + // The shared object hint table consists of all part 6 (whether + // shared or not) in order followed by all part 8 objects in + // order. Add the objects to shared object data keeping a map of + // object number to index. Then populate the shared object + // information for the pages. + + // Note that two objects never have the same object number, so we + // can map from object number only without regards to generation. + std::map obj_to_index; + + this->c_shared_object_data.nshared_first_page = + (unsigned int)this->part6.size(); + this->c_shared_object_data.nshared_total = + this->c_shared_object_data.nshared_first_page + + (unsigned int) this->part8.size(); + + std::vector& shared = + this->c_shared_object_data.entries; + for (std::vector::iterator iter = this->part6.begin(); + iter != this->part6.end(); ++iter) + { + QPDFObjectHandle& oh = *iter; + int obj = oh.getObjectID(); + obj_to_index[obj] = (int)shared.size(); + shared.push_back(CHSharedObjectEntry(obj)); + } + QTC::TC("qpdf", "QPDF lin part 8 empty", this->part8.empty() ? 1 : 0); + if (! this->part8.empty()) + { + this->c_shared_object_data.first_shared_obj = + this->part8[0].getObjectID(); + for (std::vector::iterator iter = + this->part8.begin(); + iter != this->part8.end(); ++iter) + { + QPDFObjectHandle& oh = *iter; + int obj = oh.getObjectID(); + obj_to_index[obj] = (int)shared.size(); + shared.push_back(CHSharedObjectEntry(obj)); + } + } + assert(this->c_shared_object_data.nshared_total == + (int) this->c_shared_object_data.entries.size()); + + // Now compute the list of shared objects for each page after the + // first page. + + for (unsigned int i = 1; i < npages; ++i) + { + CHPageOffsetEntry& pe = this->c_page_offset_data.entries[i]; + ObjUser ou(ObjUser::ou_page, i); + assert(this->obj_user_to_objects.count(ou) > 0); + std::set const& ogs = this->obj_user_to_objects[ou]; + for (std::set::const_iterator iter = ogs.begin(); + iter != ogs.end(); ++iter) + { + ObjGen const& og = *iter; + if ((this->object_to_obj_users[og].size() > 1) && + (obj_to_index.count(og.obj) > 0)) + { + int idx = obj_to_index[og.obj]; + ++pe.nshared_objects; + pe.shared_identifiers.push_back(idx); + } + } + } +} + +void +QPDF::pushOutlinesToPart( + std::vector& part, + std::set& lc_outlines, + std::map const& object_stream_data) +{ + QPDFObjectHandle root = getRoot(); + QPDFObjectHandle outlines = root.getKey("/Outlines"); + if (outlines.isNull()) + { + return; + } + outlines = getUncompressedObject(outlines, object_stream_data); + ObjGen outlines_og(outlines.getObjectID(), outlines.getGeneration()); + QTC::TC("qpdf", "QPDF lin outlines in part", + ((&part == (&this->part6)) ? 0 + : (&part == (&this->part9)) ? 1 + : 9999)); // can't happen + this->c_outline_data.first_object = outlines_og.obj; + this->c_outline_data.nobjects = 1; + lc_outlines.erase(outlines_og); + part.push_back(outlines); + for (std::set::iterator iter = lc_outlines.begin(); + iter != lc_outlines.end(); ++iter) + { + part.push_back(objGenToIndirect(*iter)); + ++this->c_outline_data.nobjects; + } +} + +void +QPDF::getLinearizedParts( + std::map const& object_stream_data, + std::vector& part4, + std::vector& part6, + std::vector& part7, + std::vector& part8, + std::vector& part9) +{ + calculateLinearizationData(object_stream_data); + part4 = this->part4; + part6 = this->part6; + part7 = this->part7; + part8 = this->part8; + part9 = this->part9; +} + +static inline int nbits(int val) +{ + return (val == 0 ? 0 : (1 + nbits(val >> 1))); +} + +int +QPDF::outputLengthNextN( + int in_object, int n, + std::map const& lengths, + std::map const& obj_renumber) +{ + // Figure out the length of a series of n consecutive objects in + // the output file starting with whatever object in_object from + // the input file mapped to. + + assert(obj_renumber.count(in_object) > 0); + int first = (*(obj_renumber.find(in_object))).second; + int length = 0; + for (int i = 0; i < n; ++i) + { + assert(lengths.count(first + i) > 0); + length += (*(lengths.find(first + i))).second; + } + return length; +} + +void +QPDF::calculateHPageOffset( + std::map const& xref, + std::map const& lengths, + std::map const& obj_renumber) +{ + // Page Offset Hint Table + + // We are purposely leaving some values set to their initial zero + // values. + + std::vector const& pages = getAllPages(); + unsigned int npages = (unsigned int)pages.size(); + CHPageOffset& cph = this->c_page_offset_data; + std::vector& cphe = cph.entries; + + // Calculate minimum and maximum values for number of objects per + // page and page length. + + int min_nobjects = cphe[0].nobjects; + int max_nobjects = min_nobjects; + int min_length = outputLengthNextN( + pages[0].getObjectID(), min_nobjects, lengths, obj_renumber); + int max_length = min_length; + int max_shared = cphe[0].nshared_objects; + + HPageOffset& ph = this->page_offset_hints; + std::vector& phe = ph.entries; + phe = std::vector(npages); + + for (unsigned int i = 0; i < npages; ++i) + { + // Calculate values for each page, assigning full values to + // the delta items. They will be adjusted later. + + // Repeat calculations for page 0 so we can assign to phe[i] + // without duplicating those assignments. + + int nobjects = cphe[i].nobjects; + int length = outputLengthNextN( + pages[i].getObjectID(), nobjects, lengths, obj_renumber); + int nshared = cphe[i].nshared_objects; + + min_nobjects = std::min(min_nobjects, nobjects); + max_nobjects = std::max(max_nobjects, nobjects); + min_length = std::min(min_length, length); + max_length = std::max(max_length, length); + max_shared = std::max(max_shared, nshared); + + phe[i].delta_nobjects = nobjects; + phe[i].delta_page_length = length; + phe[i].nshared_objects = nshared; + } + + ph.min_nobjects = min_nobjects; + int in_page0_id = pages[0].getObjectID(); + int out_page0_id = (*(obj_renumber.find(in_page0_id))).second; + ph.first_page_offset = (*(xref.find(out_page0_id))).second.getOffset(); + ph.nbits_delta_nobjects = nbits(max_nobjects - min_nobjects); + ph.min_page_length = min_length; + ph.nbits_delta_page_length = nbits(max_length - min_length); + ph.nbits_nshared_objects = nbits(max_shared); + ph.nbits_shared_identifier = + nbits(this->c_shared_object_data.nshared_total); + ph.shared_denominator = 4; // doesn't matter + + // It isn't clear how to compute content offset and content + // length. Since we are not interleaving page objects with the + // content stream, we'll use the same values for content length as + // page length. We will use 0 as content offset because this is + // what Adobe does (implementation note 127) and pdlin as well. + ph.nbits_delta_content_length = ph.nbits_delta_page_length; + ph.min_content_length = ph.min_page_length; + + for (unsigned int i = 0; i < npages; ++i) + { + // Adjust delta entries + assert(phe[i].delta_nobjects >= min_nobjects); + assert(phe[i].delta_page_length >= min_length); + phe[i].delta_nobjects -= min_nobjects; + phe[i].delta_page_length -= min_length; + phe[i].delta_content_length = phe[i].delta_page_length; + + for (int j = 0; j < cphe[i].nshared_objects; ++j) + { + phe[i].shared_identifiers.push_back( + cphe[i].shared_identifiers[j]); + phe[i].shared_numerators.push_back(0); + } + } +} + +void +QPDF::calculateHSharedObject( + std::map const& xref, + std::map const& lengths, + std::map const& obj_renumber) +{ + CHSharedObject& cso = this->c_shared_object_data; + std::vector& csoe = cso.entries; + HSharedObject& so = this->shared_object_hints; + std::vector& soe = so.entries; + soe = std::vector(cso.nshared_total); + + int min_length = outputLengthNextN( + csoe[0].object, 1, lengths, obj_renumber); + int max_length = min_length; + + for (int i = 0; i < cso.nshared_total; ++i) + { + // Assign absolute numbers to deltas; adjust later + int length = outputLengthNextN( + csoe[i].object, 1, lengths, obj_renumber); + min_length = std::min(min_length, length); + max_length = std::max(max_length, length); + soe[i].delta_group_length = length; + } + + so.nshared_total = cso.nshared_total; + so.nshared_first_page = cso.nshared_first_page; + if (so.nshared_total > so.nshared_first_page) + { + so.first_shared_obj = + (*(obj_renumber.find(cso.first_shared_obj))).second; + so.first_shared_offset = + (*(xref.find(so.first_shared_obj))).second.getOffset(); + } + so.min_group_length = min_length; + so.nbits_delta_group_length = nbits(max_length - min_length); + + for (int i = 0; i < cso.nshared_total; ++i) + { + // Adjust deltas + assert(soe[i].delta_group_length >= min_length); + soe[i].delta_group_length -= min_length; + } +} + +void +QPDF::calculateHOutline( + std::map const& xref, + std::map const& lengths, + std::map const& obj_renumber) +{ + HGeneric& cho = this->c_outline_data; + + if (cho.nobjects == 0) + { + return; + } + + HGeneric& ho = this->outline_hints; + + ho.first_object = + (*(obj_renumber.find(cho.first_object))).second; + ho.first_object_offset = + (*(xref.find(ho.first_object))).second.getOffset(); + ho.nobjects = cho.nobjects; + ho.group_length = outputLengthNextN( + cho.first_object, ho.nobjects, lengths, obj_renumber); +} + +template +static void +write_vector_int(BitWriter& w, int nitems, std::vector& vec, + int bits, int_type T::*field) +{ + // nitems times, write bits bits from the given field of the ith + // vector to the given bit writer. + + for (int i = 0; i < nitems; ++i) + { + w.writeBits(vec[i].*field, bits); + } + // The PDF spec says that each hint table starts at a byte + // boundary. Each "row" actually must start on a byte boundary. + w.flush(); +} + +template +static void +write_vector_vector(BitWriter& w, + int nitems1, std::vector& vec1, int T::*nitems2, + int bits, std::vector T::*vec2) +{ + // nitems1 times, write nitems2 (from the ith element of vec1) items + // from the vec2 vector field of the ith item of vec1. + for (int i1 = 0; i1 < nitems1; ++i1) + { + for (int i2 = 0; i2 < vec1[i1].*nitems2; ++i2) + { + w.writeBits((vec1[i1].*vec2)[i2], bits); + } + } + w.flush(); +} + + +void +QPDF::writeHPageOffset(BitWriter& w) +{ + HPageOffset& t = this->page_offset_hints; + + w.writeBits(t.min_nobjects, 32); // 1 + w.writeBits(t.first_page_offset, 32); // 2 + w.writeBits(t.nbits_delta_nobjects, 16); // 3 + w.writeBits(t.min_page_length, 32); // 4 + w.writeBits(t.nbits_delta_page_length, 16); // 5 + w.writeBits(t.min_content_offset, 32); // 6 + w.writeBits(t.nbits_delta_content_offset, 16); // 7 + w.writeBits(t.min_content_length, 32); // 8 + w.writeBits(t.nbits_delta_content_length, 16); // 9 + w.writeBits(t.nbits_nshared_objects, 16); // 10 + w.writeBits(t.nbits_shared_identifier, 16); // 11 + w.writeBits(t.nbits_shared_numerator, 16); // 12 + w.writeBits(t.shared_denominator, 16); // 13 + + unsigned int nitems = (unsigned int)getAllPages().size(); + std::vector& entries = t.entries; + + write_vector_int(w, nitems, entries, + t.nbits_delta_nobjects, + &HPageOffsetEntry::delta_nobjects); + write_vector_int(w, nitems, entries, + t.nbits_delta_page_length, + &HPageOffsetEntry::delta_page_length); + write_vector_int(w, nitems, entries, + t.nbits_nshared_objects, + &HPageOffsetEntry::nshared_objects); + write_vector_vector(w, nitems, entries, + &HPageOffsetEntry::nshared_objects, + t.nbits_shared_identifier, + &HPageOffsetEntry::shared_identifiers); + write_vector_vector(w, nitems, entries, + &HPageOffsetEntry::nshared_objects, + t.nbits_shared_numerator, + &HPageOffsetEntry::shared_numerators); + write_vector_int(w, nitems, entries, + t.nbits_delta_content_offset, + &HPageOffsetEntry::delta_content_offset); + write_vector_int(w, nitems, entries, + t.nbits_delta_content_length, + &HPageOffsetEntry::delta_content_length); +} + +void +QPDF::writeHSharedObject(BitWriter& w) +{ + HSharedObject& t = this->shared_object_hints; + + w.writeBits(t.first_shared_obj, 32); // 1 + w.writeBits(t.first_shared_offset, 32); // 2 + w.writeBits(t.nshared_first_page, 32); // 3 + w.writeBits(t.nshared_total, 32); // 4 + w.writeBits(t.nbits_nobjects, 16); // 5 + w.writeBits(t.min_group_length, 32); // 6 + w.writeBits(t.nbits_delta_group_length, 16); // 7 + + QTC::TC("qpdf", "QPDF lin write nshared_total > nshared_first_page", + (t.nshared_total > t.nshared_first_page) ? 1 : 0); + + int nitems = t.nshared_total; + std::vector& entries = t.entries; + + write_vector_int(w, nitems, entries, + t.nbits_delta_group_length, + &HSharedObjectEntry::delta_group_length); + write_vector_int(w, nitems, entries, + 1, &HSharedObjectEntry::signature_present); + for (int i = 0; i < nitems; ++i) + { + // If signature were present, we'd have to write a 128-bit hash. + assert(entries[i].signature_present == 0); + } + write_vector_int(w, nitems, entries, + t.nbits_nobjects, + &HSharedObjectEntry::nobjects_minus_one); +} + +void +QPDF::writeHGeneric(BitWriter& w, HGeneric& t) +{ + w.writeBits(t.first_object, 32); // 1 + w.writeBits(t.first_object_offset, 32); // 2 + w.writeBits(t.nobjects, 32); // 3 + w.writeBits(t.group_length, 32); // 4 +} + +void +QPDF::generateHintStream(std::map const& xref, + std::map const& lengths, + std::map const& obj_renumber, + PointerHolder& hint_buffer, + int& S, int& O) +{ + // Populate actual hint table values + calculateHPageOffset(xref, lengths, obj_renumber); + calculateHSharedObject(xref, lengths, obj_renumber); + calculateHOutline(xref, lengths, obj_renumber); + + // Write the hint stream itself into a compressed memory buffer. + // Write through a counter so we can get offsets. + Pl_Buffer hint_stream("hint stream"); + Pl_Flate f("compress hint stream", &hint_stream, Pl_Flate::a_deflate); + Pl_Count c("count", &f); + BitWriter w(&c); + + writeHPageOffset(w); + S = (int)c.getCount(); + writeHSharedObject(w); + O = 0; + if (this->outline_hints.nobjects > 0) + { + O = (int)c.getCount(); + writeHGeneric(w, this->outline_hints); + } + c.finish(); + + hint_buffer = hint_stream.getBuffer(); +} diff --git a/libqpdf/QPDF_optimization.cc b/libqpdf/QPDF_optimization.cc new file mode 100644 index 0000000..67f147f --- /dev/null +++ b/libqpdf/QPDF_optimization.cc @@ -0,0 +1,556 @@ +// See the "Optimization" section of the manual. + +#include + +#include +#include +#include +#include +#include + +QPDF::ObjUser::ObjUser() : + ou_type(ou_bad), + pageno(0) +{ +} + +QPDF::ObjUser::ObjUser(user_e type) : + ou_type(type), + pageno(0) +{ + assert(type == ou_root); +} + +QPDF::ObjUser::ObjUser(user_e type, int pageno) : + ou_type(type), + pageno(pageno) +{ + assert((type == ou_page) || (type == ou_thumb)); +} + +QPDF::ObjUser::ObjUser(user_e type, std::string const& key) : + ou_type(type), + pageno(0), + key(key) +{ + assert((type == ou_trailer_key) || (type == ou_root_key)); +} + +bool +QPDF::ObjUser::operator<(ObjUser const& rhs) const +{ + if (this->ou_type < rhs.ou_type) + { + return true; + } + else if (this->ou_type == rhs.ou_type) + { + if (this->pageno < rhs.pageno) + { + return true; + } + else if (this->pageno == rhs.pageno) + { + return (this->key < rhs.key); + } + } + + return false; +} + +void +QPDF::flattenScalarReferences() +{ + // Do a traversal of the entire PDF file structure replacing all + // indirect objects that are not arrays, streams, or dictionaries + // with direct objects. + + std::list queue; + queue.push_back(this->trailer); + std::set visited; + + // Add every object in the xref table to the queue. This ensures + // that we flatten scalar references in unreferenced objects. + // This becomes important if we are preserving object streams in a + // file that has unreferenced objects in its object streams. (See + // QPDF bug 2974522 at SourceForge.) + for (std::map::iterator iter = + this->xref_table.begin(); + iter != this->xref_table.end(); ++iter) + { + ObjGen const& og = (*iter).first; + queue.push_back(getObjectByID(og.obj, og.gen)); + } + + while (! queue.empty()) + { + QPDFObjectHandle node = queue.front(); + queue.pop_front(); + if (node.isIndirect()) + { + ObjGen og(node.getObjectID(), node.getGeneration()); + if (visited.count(og) > 0) + { + continue; + } + visited.insert(og); + } + + if (node.isArray()) + { + int nitems = node.getArrayNItems(); + for (int i = 0; i < nitems; ++i) + { + QPDFObjectHandle oh = node.getArrayItem(i); + if (oh.isScalar()) + { + if (oh.isIndirect()) + { + QTC::TC("qpdf", "QPDF opt flatten array scalar"); + oh.makeDirect(); + node.setArrayItem(i, oh); + } + } + else + { + queue.push_back(oh); + } + } + } + else if (node.isDictionary() || node.isStream()) + { + QPDFObjectHandle dict = node; + if (node.isStream()) + { + dict = node.getDict(); + } + std::set keys = dict.getKeys(); + for (std::set::iterator iter = keys.begin(); + iter != keys.end(); ++iter) + { + std::string const& key = *iter; + QPDFObjectHandle oh = dict.getKey(key); + if (oh.isNull()) + { + // QPDF_Dictionary.getKeys() never returns null + // keys. + throw std::logic_error( + "INTERNAL ERROR: dictionary with null key found"); + } + else if (oh.isScalar()) + { + if (oh.isIndirect()) + { + QTC::TC("qpdf", "QPDF opt flatten dict scalar"); + oh.makeDirect(); + dict.replaceKey(key, oh); + } + } + else + { + queue.push_back(oh); + } + } + } + } +} + +void +QPDF::optimize(std::map const& object_stream_data, + bool allow_changes) +{ + if (! this->obj_user_to_objects.empty()) + { + // already optimized + return; + } + + // Traverse pages tree pushing all inherited resources down to the + // page level. This also initializes this->all_pages. + pushInheritedAttributesToPage(allow_changes, false); + + // Traverse pages + int n = (int)this->all_pages.size(); + for (int pageno = 0; pageno < n; ++pageno) + { + updateObjectMaps(ObjUser(ObjUser::ou_page, pageno), + this->all_pages[pageno]); + } + + // Traverse document-level items + std::set keys = this->trailer.getKeys(); + for (std::set::iterator iter = keys.begin(); + iter != keys.end(); ++iter) + { + std::string const& key = *iter; + if (key == "/Root") + { + // handled separately + } + else + { + updateObjectMaps(ObjUser(ObjUser::ou_trailer_key, key), + this->trailer.getKey(key)); + } + } + + QPDFObjectHandle root = getRoot(); + keys = root.getKeys(); + for (std::set::iterator iter = keys.begin(); + iter != keys.end(); ++iter) + { + // Technically, /I keys from /Thread dictionaries are supposed + // to be handled separately, but we are going to disregard + // that specification for now. There is loads of evidence + // that pdlin and Acrobat both disregard things like this from + // time to time, so this is almost certain not to cause any + // problems. + + std::string const& key = *iter; + updateObjectMaps(ObjUser(ObjUser::ou_root_key, key), + root.getKey(key)); + } + + ObjUser root_ou = ObjUser(ObjUser::ou_root); + ObjGen root_og = ObjGen(root.getObjectID(), root.getGeneration()); + obj_user_to_objects[root_ou].insert(root_og); + object_to_obj_users[root_og].insert(root_ou); + + filterCompressedObjects(object_stream_data); +} + +void +QPDF::pushInheritedAttributesToPage() +{ + // Public API should not have access to allow_changes. + pushInheritedAttributesToPage(true, false); +} + +void +QPDF::pushInheritedAttributesToPage(bool allow_changes, bool warn_skipped_keys) +{ + // Traverse pages tree pushing all inherited resources down to the + // page level. + + // The record of whether we've done this is cleared by + // updateAllPagesCache(). If we're warning for skipped keys, + // re-traverse unconditionally. + if (this->pushed_inherited_attributes_to_pages && (! warn_skipped_keys)) + { + return; + } + + // key_ancestors is a mapping of page attribute keys to a stack of + // Pages nodes that contain values for them. + std::map > key_ancestors; + this->all_pages.clear(); + pushInheritedAttributesToPageInternal( + this->trailer.getKey("/Root").getKey("/Pages"), + key_ancestors, this->all_pages, allow_changes, warn_skipped_keys); + assert(key_ancestors.empty()); + this->pushed_inherited_attributes_to_pages = true; +} + +void +QPDF::pushInheritedAttributesToPageInternal( + QPDFObjectHandle cur_pages, + std::map >& key_ancestors, + std::vector& pages, + bool allow_changes, bool warn_skipped_keys) +{ + // Extract the underlying dictionary object + std::string type = cur_pages.getKey("/Type").getName(); + + if (type == "/Pages") + { + // Make a list of inheritable keys. Any key other than /Type, + // /Parent, Kids, or /Count is an inheritable attribute. Push + // this object onto the stack of pages nodes that have values + // for this attribute. + + std::set inheritable_keys; + std::set keys = cur_pages.getKeys(); + for (std::set::iterator iter = keys.begin(); + iter != keys.end(); ++iter) + { + std::string const& key = *iter; + if ( (key == "/MediaBox") || (key == "/CropBox") || + (key == "/Resources") || (key == "/Rotate") ) + { + if (! allow_changes) + { + throw QPDFExc(qpdf_e_internal, this->file->getName(), + this->last_object_description, + this->file->getLastOffset(), + "optimize detected an " + "inheritable attribute when called " + "in no-change mode"); + } + + // This is an inheritable resource + inheritable_keys.insert(key); + QPDFObjectHandle oh = cur_pages.getKey(key); + QTC::TC("qpdf", "QPDF opt direct pages resource", + oh.isIndirect() ? 0 : 1); + if (! oh.isIndirect()) + { + if (! oh.isScalar()) + { + // Replace shared direct object non-scalar + // resources with indirect objects to avoid + // copying large structures around. + cur_pages.replaceKey(key, makeIndirectObject(oh)); + oh = cur_pages.getKey(key); + } + else + { + // Don't defeat flattenScalarReferences which + // would have already been called by this + // time. + QTC::TC("qpdf", "QPDF opt inherited scalar"); + } + } + key_ancestors[key].push_back(oh); + if (key_ancestors[key].size() > 1) + { + QTC::TC("qpdf", "QPDF opt key ancestors depth > 1"); + } + // Remove this resource from this node. It will be + // reattached at the page level. + cur_pages.removeKey(key); + } + else if (! ((key == "/Type") || (key == "/Parent") || + (key == "/Kids") || (key == "/Count"))) + { + // Warn when flattening, but not if the key is at the top + // level (i.e. "/Parent" not set), as we don't change these; + // but flattening removes intermediate /Pages nodes. + if ( (warn_skipped_keys) && (cur_pages.hasKey("/Parent")) ) + { + QTC::TC("qpdf", "QPDF unknown key not inherited"); + setLastObjectDescription("Pages object", + cur_pages.getObjectID(), + cur_pages.getGeneration()); + warn(QPDFExc(qpdf_e_pages, this->file->getName(), + this->last_object_description, 0, + "Unknown key " + key + " in /Pages object" + " is being discarded as a result of" + " flattening the /Pages tree")); + } + } + } + + // Visit descendant nodes. + QPDFObjectHandle kids = cur_pages.getKey("/Kids"); + int n = kids.getArrayNItems(); + for (int i = 0; i < n; ++i) + { + pushInheritedAttributesToPageInternal( + kids.getArrayItem(i), key_ancestors, pages, + allow_changes, warn_skipped_keys); + } + + // For each inheritable key, pop the stack. If the stack + // becomes empty, remove it from the map. That way, the + // invariant that the list of keys in key_ancestors is exactly + // those keys for which inheritable attributes are available. + + if (! inheritable_keys.empty()) + { + QTC::TC("qpdf", "QPDF opt inheritable keys"); + for (std::set::iterator iter = + inheritable_keys.begin(); + iter != inheritable_keys.end(); ++iter) + { + std::string const& key = (*iter); + key_ancestors[key].pop_back(); + if (key_ancestors[key].empty()) + { + QTC::TC("qpdf", "QPDF opt erase empty key ancestor"); + key_ancestors.erase(key); + } + } + } + else + { + QTC::TC("qpdf", "QPDF opt no inheritable keys"); + } + } + else if (type == "/Page") + { + // Add all available inheritable attributes not present in + // this object to this object. + for (std::map >::iterator + iter = key_ancestors.begin(); + iter != key_ancestors.end(); ++iter) + { + std::string const& key = (*iter).first; + if (! cur_pages.hasKey(key)) + { + QTC::TC("qpdf", "QPDF opt resource inherited"); + cur_pages.replaceKey(key, (*iter).second.back()); + } + else + { + QTC::TC("qpdf", "QPDF opt page resource hides ancestor"); + } + } + pages.push_back(cur_pages); + } + else + { + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + this->last_object_description, + this->file->getLastOffset(), + "invalid Type " + type + " in page tree"); + } +} + +void +QPDF::updateObjectMaps(ObjUser const& ou, QPDFObjectHandle oh) +{ + std::set visited; + updateObjectMapsInternal(ou, oh, visited, true); +} + +void +QPDF::updateObjectMapsInternal(ObjUser const& ou, QPDFObjectHandle oh, + std::set& visited, bool top) +{ + // Traverse the object tree from this point taking care to avoid + // crossing page boundaries. + + bool is_page_node = false; + + if (oh.isDictionary() && oh.hasKey("/Type")) + { + std::string type = oh.getKey("/Type").getName(); + if (type == "/Page") + { + is_page_node = true; + if (! top) + { + return; + } + } + } + + if (oh.isIndirect()) + { + ObjGen og(oh.getObjectID(), oh.getGeneration()); + if (visited.count(og)) + { + QTC::TC("qpdf", "QPDF opt loop detected"); + return; + } + this->obj_user_to_objects[ou].insert(og); + this->object_to_obj_users[og].insert(ou); + visited.insert(og); + } + + if (oh.isArray()) + { + int n = oh.getArrayNItems(); + for (int i = 0; i < n; ++i) + { + updateObjectMapsInternal(ou, oh.getArrayItem(i), visited, false); + } + } + else if (oh.isDictionary() || oh.isStream()) + { + QPDFObjectHandle dict = oh; + if (oh.isStream()) + { + dict = oh.getDict(); + } + + std::set keys = dict.getKeys(); + for (std::set::iterator iter = keys.begin(); + iter != keys.end(); ++iter) + { + std::string const& key = *iter; + if (is_page_node && (key == "/Thumb")) + { + // Traverse page thumbnail dictionaries as a special + // case. + updateObjectMaps(ObjUser(ObjUser::ou_thumb, ou.pageno), + dict.getKey(key)); + } + else if (is_page_node && (key == "/Parent")) + { + // Don't traverse back up the page tree + } + else + { + updateObjectMapsInternal(ou, dict.getKey(key), + visited, false); + } + } + } +} + +void +QPDF::filterCompressedObjects(std::map const& object_stream_data) +{ + if (object_stream_data.empty()) + { + return; + } + + // Transform object_to_obj_users and obj_user_to_objects so that + // they refer only to uncompressed objects. If something is a + // user of a compressed object, then it is really a user of the + // object stream that contains it. + + std::map > t_obj_user_to_objects; + std::map > t_object_to_obj_users; + + for (std::map >::iterator i1 = + this->obj_user_to_objects.begin(); + i1 != this->obj_user_to_objects.end(); ++i1) + { + ObjUser const& ou = (*i1).first; + std::set const& objects = (*i1).second; + for (std::set::const_iterator i2 = objects.begin(); + i2 != objects.end(); ++i2) + { + ObjGen const& og = (*i2); + std::map::const_iterator i3 = + object_stream_data.find(og.obj); + if (i3 == object_stream_data.end()) + { + t_obj_user_to_objects[ou].insert(og); + } + else + { + t_obj_user_to_objects[ou].insert(ObjGen((*i3).second, 0)); + } + } + } + + for (std::map >::iterator i1 = + this->object_to_obj_users.begin(); + i1 != this->object_to_obj_users.end(); ++i1) + { + ObjGen const& og = (*i1).first; + std::set const& objusers = (*i1).second; + for (std::set::const_iterator i2 = objusers.begin(); + i2 != objusers.end(); ++i2) + { + ObjUser const& ou = (*i2); + std::map::const_iterator i3 = + object_stream_data.find(og.obj); + if (i3 == object_stream_data.end()) + { + t_object_to_obj_users[og].insert(ou); + } + else + { + t_object_to_obj_users[ObjGen((*i3).second, 0)].insert(ou); + } + } + } + + this->obj_user_to_objects = t_obj_user_to_objects; + this->object_to_obj_users = t_object_to_obj_users; +} diff --git a/libqpdf/QPDF_pages.cc b/libqpdf/QPDF_pages.cc new file mode 100644 index 0000000..36ca951 --- /dev/null +++ b/libqpdf/QPDF_pages.cc @@ -0,0 +1,272 @@ +#include + +#include + +#include +#include +#include + +// In support of page manipulation APIs, these methods internally +// maintain state about pages in a pair of data structures: all_pages, +// which is a vector of page objects, and pageobj_to_pages_pos, which +// maps a page object to its position in the all_pages array. +// Unfortunately, the getAllPages() method returns a const reference +// to all_pages and has been in the public API long before the +// introduction of mutation APIs, so we're pretty much stuck with it. +// Anyway, there are lots of calls to it in the library, so the +// efficiency of having it cached is probably worth keeping it. + +// The goal of this code is to ensure that the all_pages vector, which +// users may have a reference to, and the pageobj_to_pages_pos map, +// which users will not have access to, remain consistent outside of +// any call to the library. As long as users only touch the /Pages +// structure through page-specific API calls, they never have to worry +// about anything, and this will also stay consistent. If a user +// touches anything about the /Pages structure outside of these calls +// (such as by directly looking up and manipulating the underlying +// objects), they can call updatePagesCache() to bring things back in +// sync. + +// If the user doesn't ever use the page manipulation APIs, then qpdf +// leaves the /Pages structure alone. If the user does use the APIs, +// then we push all inheritable objects down and flatten the /Pages +// tree. This makes it easier for us to keep /Pages, all_pages, and +// pageobj_to_pages_pos internally consistent at all times. + +// Responsibility for keeping all_pages, pageobj_to_pages_pos, and the +// Pages structure consistent should remain in as few places as +// possible. As of initial writing, only flattenPagesTree, +// insertPage, and removePage, along with methods they call, are +// concerned with it. Everything else goes through one of those +// methods. + +std::vector const& +QPDF::getAllPages() +{ + // Note that pushInheritedAttributesToPage may also be used to + // initialize this->all_pages. + if (this->all_pages.empty()) + { + getAllPagesInternal(getRoot().getKey("/Pages"), this->all_pages); + } + return this->all_pages; +} + +void +QPDF::getAllPagesInternal(QPDFObjectHandle cur_pages, + std::vector& result) +{ + std::string type = cur_pages.getKey("/Type").getName(); + if (type == "/Pages") + { + QPDFObjectHandle kids = cur_pages.getKey("/Kids"); + int n = kids.getArrayNItems(); + for (int i = 0; i < n; ++i) + { + getAllPagesInternal(kids.getArrayItem(i), result); + } + } + else if (type == "/Page") + { + result.push_back(cur_pages); + } + else + { + throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), + this->last_object_description, + this->file->getLastOffset(), + "invalid Type " + type + " in page tree"); + } +} + +void +QPDF::updateAllPagesCache() +{ + // Force regeneration of the pages cache. We force immediate + // recalculation of all_pages since users may have references to + // it that they got from calls to getAllPages(). We can defer + // recalculation of pageobj_to_pages_pos until needed. + QTC::TC("qpdf", "QPDF updateAllPagesCache"); + this->all_pages.clear(); + this->pageobj_to_pages_pos.clear(); + this->pushed_inherited_attributes_to_pages = false; + getAllPages(); +} + +void +QPDF::flattenPagesTree() +{ + // If not already done, flatten the /Pages structure and + // initialize pageobj_to_pages_pos. + + if (! this->pageobj_to_pages_pos.empty()) + { + return; + } + + // Push inherited objects down to the /Page level. As a side + // effect this->all_pages will also be generated. + pushInheritedAttributesToPage(true, true); + + QPDFObjectHandle pages = getRoot().getKey("/Pages"); + + int const len = (int)this->all_pages.size(); + for (int pos = 0; pos < len; ++pos) + { + // populate pageobj_to_pages_pos and fix parent pointer + insertPageobjToPage(this->all_pages[pos], pos, true); + this->all_pages[pos].replaceKey("/Parent", pages); + } + + pages.replaceKey("/Kids", QPDFObjectHandle::newArray(this->all_pages)); + // /Count has not changed + assert(pages.getKey("/Count").getIntValue() == len); +} + +void +QPDF::insertPageobjToPage(QPDFObjectHandle const& obj, int pos, + bool check_duplicate) +{ + ObjGen og(obj.getObjectID(), obj.getGeneration()); + if (check_duplicate) + { + if (! this->pageobj_to_pages_pos.insert(std::make_pair(og, pos)).second) + { + QTC::TC("qpdf", "QPDF duplicate page reference"); + setLastObjectDescription("page " + QUtil::int_to_string(pos) + + " (numbered from zero)", + og.obj, og.gen); + throw QPDFExc(qpdf_e_pages, this->file->getName(), + this->last_object_description, 0, + "duplicate page reference found;" + " this would cause loss of data"); + } + } + else + { + this->pageobj_to_pages_pos[og] = pos; + } +} + +void +QPDF::insertPage(QPDFObjectHandle newpage, int pos) +{ + // pos is numbered from 0, so pos = 0 inserts at the beginning and + // pos = npages adds to the end. + + flattenPagesTree(); + newpage.assertPageObject(); + + if (! newpage.isIndirect()) + { + QTC::TC("qpdf", "QPDF insert non-indirect page"); + newpage = this->makeIndirectObject(newpage); + } + else if (newpage.getOwningQPDF() != this) + { + QTC::TC("qpdf", "QPDF insert foreign page"); + newpage.getOwningQPDF()->pushInheritedAttributesToPage(); + newpage = this->copyForeignObject(newpage, true); + } + else + { + QTC::TC("qpdf", "QPDF insert indirect page"); + } + + QTC::TC("qpdf", "QPDF insert page", + (pos == 0) ? 0 : // insert at beginning + (pos == ((int)this->all_pages.size())) ? 1 : // insert at end + 2); // insert in middle + + QPDFObjectHandle pages = getRoot().getKey("/Pages"); + QPDFObjectHandle kids = pages.getKey("/Kids"); + assert ((pos >= 0) && (pos <= (int)this->all_pages.size())); + + newpage.replaceKey("/Parent", pages); + kids.insertItem(pos, newpage); + int npages = kids.getArrayNItems(); + pages.replaceKey("/Count", QPDFObjectHandle::newInteger(npages)); + this->all_pages.insert(this->all_pages.begin() + pos, newpage); + assert((int)this->all_pages.size() == npages); + for (int i = pos + 1; i < npages; ++i) + { + insertPageobjToPage(this->all_pages[i], i, false); + } + insertPageobjToPage(newpage, pos, true); + assert((int)this->pageobj_to_pages_pos.size() == npages); +} + +void +QPDF::removePage(QPDFObjectHandle page) +{ + int pos = findPage(page); // also ensures flat /Pages + QTC::TC("qpdf", "QPDF remove page", + (pos == 0) ? 0 : // remove at beginning + (pos == ((int)this->all_pages.size() - 1)) ? 1 : // remove at end + 2); // remove in middle + + QPDFObjectHandle pages = getRoot().getKey("/Pages"); + QPDFObjectHandle kids = pages.getKey("/Kids"); + + kids.eraseItem(pos); + int npages = kids.getArrayNItems(); + pages.replaceKey("/Count", QPDFObjectHandle::newInteger(npages)); + this->all_pages.erase(this->all_pages.begin() + pos); + assert((int)this->all_pages.size() == npages); + this->pageobj_to_pages_pos.erase( + ObjGen(page.getObjectID(), page.getGeneration())); + assert((int)this->pageobj_to_pages_pos.size() == npages); + for (int i = pos; i < npages; ++i) + { + insertPageobjToPage(this->all_pages[i], i, false); + } +} + +void +QPDF::addPageAt(QPDFObjectHandle newpage, bool before, + QPDFObjectHandle refpage) +{ + int refpos = findPage(refpage); + if (! before) + { + ++refpos; + } + insertPage(newpage, refpos); +} + +void +QPDF::addPage(QPDFObjectHandle newpage, bool first) +{ + if (first) + { + insertPage(newpage, 0); + } + else + { + insertPage(newpage, + getRoot().getKey("/Pages").getKey("/Count").getIntValue()); + } +} + +int +QPDF::findPage(QPDFObjectHandle& page) +{ + page.assertPageObject(); + return findPage(page.getObjectID(), page.getGeneration()); +} + +int +QPDF::findPage(int objid, int generation) +{ + flattenPagesTree(); + std::map::iterator it = + this->pageobj_to_pages_pos.find(ObjGen(objid, generation)); + if (it == this->pageobj_to_pages_pos.end()) + { + setLastObjectDescription("page object", objid, generation); + throw QPDFExc(qpdf_e_pages, this->file->getName(), + this->last_object_description, 0, + "page object not referenced in /Pages tree"); + } + return (*it).second; +} diff --git a/libqpdf/QTC.cc b/libqpdf/QTC.cc new file mode 100644 index 0000000..d0f3e11 --- /dev/null +++ b/libqpdf/QTC.cc @@ -0,0 +1,45 @@ +#include + +#include +#include +#include + +static bool tc_active(char const* const scope) +{ + std::string value; + return (QUtil::get_env("TC_SCOPE", &value) && (value == scope)); +} + +void QTC::TC(char const* const scope, char const* const ccase, int n) +{ + static std::set > cache; + + if (! tc_active(scope)) + { + return; + } + + std::string filename; +#ifdef _WIN32 +# define TC_ENV "TC_WIN_FILENAME" +#else +# define TC_ENV "TC_FILENAME" +#endif + if (! QUtil::get_env(TC_ENV, &filename)) + { + return; + } +#undef TC_ENV + + if (cache.count(std::make_pair(ccase, n))) + { + return; + } + cache.insert(std::make_pair(ccase, n)); + + FILE* tc = + QUtil::fopen_wrapper("open test coverage file (" + filename + ")", + fopen(filename.c_str(), "ab")); + fprintf(tc, "%s %d\n", ccase, n); + fclose(tc); +} diff --git a/libqpdf/QUtil.cc b/libqpdf/QUtil.cc new file mode 100644 index 0000000..2014308 --- /dev/null +++ b/libqpdf/QUtil.cc @@ -0,0 +1,335 @@ +// Include qpdf-config.h first so off_t is guaranteed to have the right size. +#include + +#include + +#include +#include +#include +#include +#include +#include +#ifdef _WIN32 +#include +#include +#include +#else +#include +#endif + +std::string +QUtil::int_to_string(long long num, int fullpad) +{ + // This routine will need to be recompiled if an int can be longer than + // 49 digits. + char t[50]; + + // -2 or -1 to leave space for the possible negative sign and for NUL... + if (abs(fullpad) > (int)sizeof(t) - ((num < 0)?2:1)) + { + throw std::logic_error("Util::int_to_string has been called with " + "a padding value greater than its internal " + "limit"); + } + +#ifdef HAVE_PRINTF_LL +# define PRINTF_LL "ll" +#else +# define PRINTF_LL "l" +#endif + if (fullpad) + { + sprintf(t, "%0*" PRINTF_LL "d", fullpad, num); + } + else + { + sprintf(t, "%" PRINTF_LL "d", num); + } +#undef PRINTF_LL + + return std::string(t); +} + +std::string +QUtil::double_to_string(double num, int decimal_places) +{ + // This routine will need to be recompiled if a double can be longer than + // 99 digits. + char t[100]; + + std::string lhs = int_to_string((int)num); + + // lhs.length() gives us the length of the part on the right hand + // side of the dot + 1 for the dot + decimal_places: total size of + // the required string. -1 on the sizeof side to allow for NUL at + // the end. + // + // If decimal_places <= 0, it is as if no precision was provided + // so trust the buffer is big enough. The following test will + // always pass in those cases. + if (decimal_places + 1 + (int)lhs.length() > (int)sizeof(t) - 1) + { + throw std::logic_error("Util::double_to_string has been called with " + "a number and a decimal places specification " + "that would break an internal limit"); + } + + if (decimal_places) + { + sprintf(t, "%.*f", decimal_places, num); + } + else + { + sprintf(t, "%f", num); + } + return std::string(t); +} + +long long +QUtil::string_to_ll(char const* str) +{ +#ifdef _MSC_VER + return _strtoi64(str, 0, 10); +#else + return strtoll(str, 0, 10); +#endif +} + +void +QUtil::throw_system_error(std::string const& description) +{ + throw std::runtime_error(description + ": " + strerror(errno)); +} + +int +QUtil::os_wrapper(std::string const& description, int status) +{ + if (status == -1) + { + throw_system_error(description); + } + return status; +} + +FILE* +QUtil::fopen_wrapper(std::string const& description, FILE* f) +{ + if (f == 0) + { + throw_system_error(description); + } + return f; +} + +int +QUtil::seek(FILE* stream, qpdf_offset_t offset, int whence) +{ +#if HAVE_FSEEKO + return fseeko(stream, (off_t)offset, whence); +#elif HAVE_FSEEKO64 + return fseeko64(stream, offset, whence); +#else +# ifdef _MSC_VER + return _fseeki64(stream, offset, whence); +# else + return fseek(stream, (long)offset, whence); +# endif +#endif +} + +qpdf_offset_t +QUtil::tell(FILE* stream) +{ +#if HAVE_FSEEKO + return (qpdf_offset_t)ftello(stream); +#elif HAVE_FSEEKO64 + return (qpdf_offset_t)ftello64(stream); +#else +# ifdef _MSC_VER + return _ftelli64(stream); +# else + return (qpdf_offset_t)ftell(stream); +# endif +#endif +} + +char* +QUtil::copy_string(std::string const& str) +{ + char* result = new char[str.length() + 1]; + // Use memcpy in case string contains nulls + result[str.length()] = '\0'; + memcpy(result, str.c_str(), str.length()); + return result; +} + +void +QUtil::binary_stdout() +{ +#ifdef _WIN32 + _setmode(_fileno(stdout), _O_BINARY); +#endif +} + +void +QUtil::binary_stdin() +{ +#ifdef _WIN32 + _setmode(_fileno(stdin), _O_BINARY); +#endif +} + +void +QUtil::setLineBuf(FILE* f) +{ +#ifndef _WIN32 + setvbuf(f, (char *) NULL, _IOLBF, 0); +#endif +} + +char* +QUtil::getWhoami(char* argv0) +{ +#ifdef _WIN32 + char pathsep = '\\'; +#else + char pathsep = '/'; +#endif + char* whoami = 0; + if ((whoami = strrchr(argv0, pathsep)) == NULL) + { + whoami = argv0; + } + else + { + ++whoami; + } +#ifdef _WIN32 + if ((strlen(whoami) > 4) && + (strcmp(whoami + strlen(whoami) - 4, ".exe") == 0)) + { + whoami[strlen(whoami) - 4] = '\0'; + } +#endif + return whoami; +} + +bool +QUtil::get_env(std::string const& var, std::string* value) +{ + // This was basically ripped out of wxWindows. +#ifdef _WIN32 + // first get the size of the buffer + DWORD len = ::GetEnvironmentVariable(var.c_str(), NULL, 0); + if (len == 0) + { + // this means that there is no such variable + return false; + } + + if (value) + { + char* t = new char[len + 1]; + ::GetEnvironmentVariable(var.c_str(), t, len); + *value = t; + delete [] t; + } + + return true; +#else + char* p = getenv(var.c_str()); + if (p == 0) + { + return false; + } + if (value) + { + *value = p; + } + + return true; +#endif +} + +time_t +QUtil::get_current_time() +{ +#ifdef _WIN32 + // The procedure to get local time at this resolution comes from + // the Microsoft documentation. It says to convert a SYSTEMTIME + // to a FILETIME, and to copy the FILETIME to a ULARGE_INTEGER. + // The resulting number is the number of 100-nanosecond intervals + // between January 1, 1601 and now. POSIX threads wants a time + // based on January 1, 1970, so we adjust by subtracting the + // number of seconds in that time period from the result we get + // here. + SYSTEMTIME sysnow; + GetSystemTime(&sysnow); + FILETIME filenow; + SystemTimeToFileTime(&sysnow, &filenow); + ULARGE_INTEGER uinow; + uinow.LowPart = filenow.dwLowDateTime; + uinow.HighPart = filenow.dwHighDateTime; + ULONGLONG now = uinow.QuadPart; + return ((now / 10000000LL) - 11644473600LL); +#else + return time(0); +#endif +} + +std::string +QUtil::toUTF8(unsigned long uval) +{ + std::string result; + + // A UTF-8 encoding of a Unicode value is a single byte for + // Unicode values <= 127. For larger values, the first byte of + // the UTF-8 encoding has '1' as each of its n highest bits and + // '0' for its (n+1)th highest bit where n is the total number of + // bytes required. Subsequent bytes start with '10' and have the + // remaining 6 bits free for encoding. For example, an 11-bit + // Unicode value can be stored in two bytes where the first is + // 110zzzzz, the second is 10zzzzzz, and the z's represent the + // remaining bits. + + if (uval > 0x7fffffff) + { + throw std::runtime_error("bounds error in QUtil::toUTF8"); + } + else if (uval < 128) + { + result += (char)(uval); + } + else + { + unsigned char bytes[7]; + bytes[6] = '\0'; + unsigned char* cur_byte = &bytes[5]; + + // maximum value that will fit in the current number of bytes + unsigned char maxval = 0x3f; // six bits + + while (uval > maxval) + { + // Assign low six bits plus 10000000 to lowest unused + // byte position, then shift + *cur_byte = (unsigned char) (0x80 + (uval & 0x3f)); + uval >>= 6; + // Maximum that will fit in high byte now shrinks by one bit + maxval >>= 1; + // Slide to the left one byte + --cur_byte; + if (cur_byte < bytes) + { + throw std::logic_error("QUtil::toUTF8: overflow error"); + } + } + // If maxval is k bits long, the high (7 - k) bits of the + // resulting byte must be high. + *cur_byte = (unsigned char)((0xff - (1 + (maxval << 1))) + uval); + + result += (char*)cur_byte; + } + + return result; +} diff --git a/libqpdf/RC4.cc b/libqpdf/RC4.cc new file mode 100644 index 0000000..b992937 --- /dev/null +++ b/libqpdf/RC4.cc @@ -0,0 +1,55 @@ +#include + +#include + +static void swap_byte(unsigned char &a, unsigned char &b) +{ + unsigned char t; + + t = a; + a = b; + b = t; +} + +RC4::RC4(unsigned char const* key_data, int key_len) +{ + if (key_len == -1) + { + key_len = (int)strlen((char*)key_data); + } + + for (int i = 0; i < 256; ++i) + { + key.state[i] = i; + } + key.x = 0; + key.y = 0; + + int i1 = 0; + int i2 = 0; + for (int i = 0; i < 256; ++i) + { + i2 = (key_data[i1] + key.state[i] + i2) % 256; + swap_byte(key.state[i], key.state[i2]); + i1 = (i1 + 1) % key_len; + } +} + +void +RC4::process(unsigned char *in_data, int len, unsigned char* out_data) +{ + if (out_data == 0) + { + // Convert in place + out_data = in_data; + } + + for (int i = 0; i < len; ++i) + { + key.x = (key.x + 1) % 256; + key.y = (key.state[key.x] + key.y) % 256; + swap_byte(key.state[key.x], key.state[key.y]); + int xor_index = (key.state[key.x] + key.state[key.y]) % 256; + out_data[i] = in_data[i] ^ key.state[xor_index]; + } +} diff --git a/libqpdf/bits.icc b/libqpdf/bits.icc new file mode 100644 index 0000000..bcd7dd8 --- /dev/null +++ b/libqpdf/bits.icc @@ -0,0 +1,149 @@ + +#ifndef __BITS_CC__ +#define __BITS_CC__ + +#include +#include +#include +#include + +// These functions may be run at places where the function call +// overhead from test coverage testing would be too high. Therefore, +// we make the test coverage cases conditional upon a preprocessor +// symbol. BitStream.cc includes this file without defining the +// symbol, and the specially designed test code that fully exercises +// this code includes with the symbol defined. + +#ifdef BITS_READ +static unsigned long long +read_bits(unsigned char const*& p, unsigned int& bit_offset, + unsigned int& bits_available, unsigned int bits_wanted) +{ + // View p as a stream of bits: + + // 76543210 76543210 .... + + // bit_offset is the bit number within the first byte that marks + // the first bit that we would read. + + if (bits_wanted > bits_available) + { + throw std::length_error("overflow reading bit stream"); + } + if (bits_wanted > 32) + { + throw std::out_of_range("read_bits: too many bits requested"); + } + + unsigned long result = 0; +#ifdef BITS_TESTING + if (bits_wanted == 0) + { + QTC::TC("libtests", "bits zero bits wanted"); + } +#endif + while (bits_wanted > 0) + { + // Grab bits from the first byte clearing anything before + // bit_offset. + unsigned char byte = *p & ((1 << (bit_offset + 1)) - 1); + + // There are bit_offset + 1 bits available in the first byte. + unsigned int to_copy = std::min(bits_wanted, bit_offset + 1); + unsigned int leftover = (bit_offset + 1) - to_copy; + +#ifdef BITS_TESTING + QTC::TC("libtests", "bits bit_offset", + ((bit_offset == 0) ? 0 : + (bit_offset == 7) ? 1 : + 2)); + QTC::TC("libtests", "bits leftover", (leftover > 0) ? 1 : 0); +#endif + + // Right shift so that all the bits we want are right justified. + byte >>= leftover; + + // Copy the bits into result + result <<= to_copy; + result |= byte; + + // Update pointers + if (leftover) + { + bit_offset = leftover - 1; + } + else + { + bit_offset = 7; + ++p; + } + bits_wanted -= to_copy; + bits_available -= to_copy; + +#ifdef BITS_TESTING + QTC::TC("libtests", "bits iterations", + ((bits_wanted > 8) ? 0 : + (bits_wanted > 0) ? 1 : + 2)); +#endif + } + + return result; +} +#endif + +#ifdef BITS_WRITE +static void +write_bits(unsigned char& ch, unsigned int& bit_offset, + unsigned long long val, unsigned int bits, Pipeline* pipeline) +{ + if (bits > 32) + { + throw std::out_of_range("write_bits: too many bits requested"); + } + + // bit_offset + 1 is the number of bits left in ch +#ifdef BITS_TESTING + if (bits == 0) + { + QTC::TC("libtests", "bits write zero bits"); + } +#endif + while (bits > 0) + { + int bits_to_write = std::min(bits, bit_offset + 1); + unsigned char newval = + (val >> (bits - bits_to_write)) & ((1 << bits_to_write) - 1); + int bits_left_in_ch = bit_offset + 1 - bits_to_write; + newval <<= bits_left_in_ch; + ch |= newval; + if (bits_left_in_ch == 0) + { +#ifdef BITS_TESTING + QTC::TC("libtests", "bits write pipeline"); +#endif + pipeline->write(&ch, 1); + bit_offset = 7; + ch = 0; + } + else + { +#ifdef BITS_TESTING + QTC::TC("libtests", "bits write leftover"); +#endif + bit_offset -= bits_to_write; + } + bits -= bits_to_write; +#ifdef BITS_TESTING + QTC::TC("libtests", "bits write iterations", + ((bits > 8) ? 0 : + (bits > 0) ? 1 : + 2)); +#endif + } + +} +#endif + + +#endif // __BITS_CC__ diff --git a/libqpdf/build.mk b/libqpdf/build.mk new file mode 100644 index 0000000..6debf10 --- /dev/null +++ b/libqpdf/build.mk @@ -0,0 +1,83 @@ +TARGETS_libqpdf = libqpdf/$(OUTPUT_DIR)/$(call libname,qpdf) + +INCLUDES_libqpdf = include libqpdf +LDFLAGS_libqpdf = -Llibqpdf/$(OUTPUT_DIR) +LIBS_libqpdf = -lqpdf + +SRCS_libqpdf = \ + libqpdf/BitStream.cc \ + libqpdf/BitWriter.cc \ + libqpdf/Buffer.cc \ + libqpdf/BufferInputSource.cc \ + libqpdf/FileInputSource.cc \ + libqpdf/InputSource.cc \ + libqpdf/MD5.cc \ + libqpdf/PCRE.cc \ + libqpdf/Pipeline.cc \ + libqpdf/Pl_AES_PDF.cc \ + libqpdf/Pl_ASCII85Decoder.cc \ + libqpdf/Pl_ASCIIHexDecoder.cc \ + libqpdf/Pl_Buffer.cc \ + libqpdf/Pl_Concatenate.cc \ + libqpdf/Pl_Count.cc \ + libqpdf/Pl_Discard.cc \ + libqpdf/Pl_Flate.cc \ + libqpdf/Pl_LZWDecoder.cc \ + libqpdf/Pl_MD5.cc \ + libqpdf/Pl_PNGFilter.cc \ + libqpdf/Pl_QPDFTokenizer.cc \ + libqpdf/Pl_RC4.cc \ + libqpdf/Pl_StdioFile.cc \ + libqpdf/QPDF.cc \ + libqpdf/QPDFExc.cc \ + libqpdf/QPDFObject.cc \ + libqpdf/QPDFObjectHandle.cc \ + libqpdf/QPDFTokenizer.cc \ + libqpdf/QPDFWriter.cc \ + libqpdf/QPDFXRefEntry.cc \ + libqpdf/QPDF_Array.cc \ + libqpdf/QPDF_Bool.cc \ + libqpdf/QPDF_Dictionary.cc \ + libqpdf/QPDF_Integer.cc \ + libqpdf/QPDF_Name.cc \ + libqpdf/QPDF_Null.cc \ + libqpdf/QPDF_Real.cc \ + libqpdf/QPDF_Reserved.cc \ + libqpdf/QPDF_Stream.cc \ + libqpdf/QPDF_String.cc \ + libqpdf/QPDF_encryption.cc \ + libqpdf/QPDF_linearization.cc \ + libqpdf/QPDF_optimization.cc \ + libqpdf/QPDF_pages.cc \ + libqpdf/QTC.cc \ + libqpdf/QUtil.cc \ + libqpdf/RC4.cc \ + libqpdf/qpdf-c.cc \ + libqpdf/rijndael.cc + +# ----- + +OBJS_libqpdf = $(call src_to_lobj,$(SRCS_libqpdf)) + +ifeq ($(GENDEPS),1) +-include $(call lobj_to_dep,$(OBJS_libqpdf)) +endif + +$(OBJS_libqpdf): libqpdf/$(OUTPUT_DIR)/%.$(LOBJ): libqpdf/%.cc + $(call libcompile,$<,$(INCLUDES_libqpdf)) + +# Last three arguments to makelib are CURRENT,REVISION,AGE. +# +# * If any interfaces have been removed or changed, we are not binary +# compatible. Increment CURRENT, and set AGE and REVISION to 0. +# Also update libqpdf.map, changing the numeric portion to match +# CURRENT. +# +# * Otherwise, if any interfaces have been added since the last +# public release, then increment CURRENT and AGE, and set REVISION +# to 0. +# +# * Otherwise, increment REVISION + +$(TARGETS_libqpdf): $(OBJS_libqpdf) + $(call makelib,$(OBJS_libqpdf),$@,$(LDFLAGS),$(LIBS),9,0,1) diff --git a/libqpdf/qpdf-c.cc b/libqpdf/qpdf-c.cc new file mode 100644 index 0000000..0312ae5 --- /dev/null +++ b/libqpdf/qpdf-c.cc @@ -0,0 +1,593 @@ +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +struct _qpdf_error +{ + PointerHolder exc; +}; + +struct _qpdf_data +{ + _qpdf_data(); + ~_qpdf_data(); + + QPDF* qpdf; + QPDFWriter* qpdf_writer; + + PointerHolder error; + _qpdf_error tmp_error; + std::list warnings; + std::string tmp_string; + + // Parameters for functions we call + char const* filename; // or description + char const* buffer; + unsigned long long size; + char const* password; + bool write_memory; + Buffer* output_buffer; +}; + +_qpdf_data::_qpdf_data() : + qpdf(0), + qpdf_writer(0), + write_memory(false), + output_buffer(0) +{ +} + +_qpdf_data::~_qpdf_data() +{ + delete qpdf_writer; + delete qpdf; + delete output_buffer; +} + +// must set qpdf->filename and qpdf->password +static void call_read(qpdf_data qpdf) +{ + qpdf->qpdf->processFile(qpdf->filename, qpdf->password); +} + +// must set qpdf->filename, qpdf->buffer, qpdf->size, and qpdf->password +static void call_read_memory(qpdf_data qpdf) +{ + qpdf->qpdf->processMemoryFile(qpdf->filename, qpdf->buffer, + qpdf->size, qpdf->password); +} + +// must set qpdf->filename +static void call_init_write(qpdf_data qpdf) +{ + qpdf->qpdf_writer = new QPDFWriter(*(qpdf->qpdf), qpdf->filename); +} + +static void call_init_write_memory(qpdf_data qpdf) +{ + qpdf->qpdf_writer = new QPDFWriter(*(qpdf->qpdf)); + qpdf->qpdf_writer->setOutputMemory(); +} + +static void call_write(qpdf_data qpdf) +{ + qpdf->qpdf_writer->write(); +} + +static QPDF_ERROR_CODE trap_errors(qpdf_data qpdf, void (*fn)(qpdf_data)) +{ + QPDF_ERROR_CODE status = QPDF_SUCCESS; + try + { + fn(qpdf); + } + catch (QPDFExc& e) + { + qpdf->error = new QPDFExc(e); + status |= QPDF_ERRORS; + } + catch (std::runtime_error& e) + { + qpdf->error = new QPDFExc(qpdf_e_system, "", "", 0, e.what()); + status |= QPDF_ERRORS; + } + catch (std::exception& e) + { + qpdf->error = new QPDFExc(qpdf_e_internal, "", "", 0, e.what()); + status |= QPDF_ERRORS; + } + + if (qpdf_more_warnings(qpdf)) + { + status |= QPDF_WARNINGS; + } + return status; +} + +char const* qpdf_get_qpdf_version() +{ + QTC::TC("qpdf", "qpdf-c called qpdf_get_qpdf_version"); + return QPDF::QPDFVersion().c_str(); +} + +qpdf_data qpdf_init() +{ + QTC::TC("qpdf", "qpdf-c called qpdf_init"); + qpdf_data qpdf = new _qpdf_data(); + qpdf->qpdf = new QPDF(); + return qpdf; +} + +void qpdf_cleanup(qpdf_data* qpdf) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_cleanup"); + delete *qpdf; + *qpdf = 0; +} + +QPDF_BOOL qpdf_more_warnings(qpdf_data qpdf) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_more_warnings"); + + if (qpdf->warnings.empty()) + { + std::vector w = qpdf->qpdf->getWarnings(); + if (! w.empty()) + { + qpdf->warnings.assign(w.begin(), w.end()); + } + } + if (qpdf->warnings.empty()) + { + return QPDF_FALSE; + } + else + { + return QPDF_TRUE; + } +} + +QPDF_BOOL qpdf_has_error(qpdf_data qpdf) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_has_error"); + return (qpdf->error.getPointer() ? QPDF_TRUE : QPDF_FALSE); +} + +qpdf_error qpdf_get_error(qpdf_data qpdf) +{ + if (qpdf->error.getPointer()) + { + qpdf->tmp_error.exc = qpdf->error; + qpdf->error = 0; + QTC::TC("qpdf", "qpdf-c qpdf_get_error returned error"); + return &qpdf->tmp_error; + } + else + { + return 0; + } +} + +qpdf_error qpdf_next_warning(qpdf_data qpdf) +{ + if (qpdf_more_warnings(qpdf)) + { + qpdf->tmp_error.exc = new QPDFExc(qpdf->warnings.front()); + qpdf->warnings.pop_front(); + QTC::TC("qpdf", "qpdf-c qpdf_next_warning returned warning"); + return &qpdf->tmp_error; + } + else + { + return 0; + } +} + +char const* qpdf_get_error_full_text(qpdf_data qpdf, qpdf_error e) +{ + if (e == 0) + { + return ""; + } + return e->exc->what(); +} + +enum qpdf_error_code_e qpdf_get_error_code(qpdf_data qpdf, qpdf_error e) +{ + if (e == 0) + { + return qpdf_e_success; + } + return e->exc->getErrorCode(); +} + +char const* qpdf_get_error_filename(qpdf_data qpdf, qpdf_error e) +{ + if (e == 0) + { + return ""; + } + return e->exc->getFilename().c_str(); +} + +unsigned long long qpdf_get_error_file_position(qpdf_data qpdf, qpdf_error e) +{ + if (e == 0) + { + return 0; + } + return e->exc->getFilePosition(); +} + +char const* qpdf_get_error_message_detail(qpdf_data qpdf, qpdf_error e) +{ + if (e == 0) + { + return ""; + } + return e->exc->getMessageDetail().c_str(); +} + +void qpdf_set_suppress_warnings(qpdf_data qpdf, QPDF_BOOL value) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_set_suppress_warnings"); + qpdf->qpdf->setSuppressWarnings(value); +} + +void qpdf_set_ignore_xref_streams(qpdf_data qpdf, QPDF_BOOL value) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_set_ignore_xref_streams"); + qpdf->qpdf->setIgnoreXRefStreams(value); +} + +void qpdf_set_attempt_recovery(qpdf_data qpdf, QPDF_BOOL value) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_set_attempt_recovery"); + qpdf->qpdf->setAttemptRecovery(value); +} + +QPDF_ERROR_CODE qpdf_read(qpdf_data qpdf, char const* filename, + char const* password) +{ + QPDF_ERROR_CODE status = QPDF_SUCCESS; + qpdf->filename = filename; + qpdf->password = password; + status = trap_errors(qpdf, &call_read); + QTC::TC("qpdf", "qpdf-c called qpdf_read", status); + return status; +} + +QPDF_ERROR_CODE qpdf_read_memory(qpdf_data qpdf, + char const* description, + char const* buffer, + unsigned long long size, + char const* password) +{ + QPDF_ERROR_CODE status = QPDF_SUCCESS; + qpdf->filename = description; + qpdf->buffer = buffer; + qpdf->size = size; + qpdf->password = password; + status = trap_errors(qpdf, &call_read_memory); + QTC::TC("qpdf", "qpdf-c called qpdf_read_memory", status); + return status; +} + +char const* qpdf_get_pdf_version(qpdf_data qpdf) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_get_pdf_version"); + qpdf->tmp_string = qpdf->qpdf->getPDFVersion(); + return qpdf->tmp_string.c_str(); +} + +char const* qpdf_get_user_password(qpdf_data qpdf) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_get_user_password"); + qpdf->tmp_string = qpdf->qpdf->getTrimmedUserPassword(); + return qpdf->tmp_string.c_str(); +} + +char const* qpdf_get_info_key(qpdf_data qpdf, char const* key) +{ + char const* result = 0; + QPDFObjectHandle trailer = qpdf->qpdf->getTrailer(); + if (trailer.hasKey("/Info")) + { + QPDFObjectHandle info = trailer.getKey("/Info"); + if (info.hasKey(key)) + { + QPDFObjectHandle value = info.getKey(key); + if (value.isString()) + { + qpdf->tmp_string = value.getStringValue(); + result = qpdf->tmp_string.c_str(); + } + } + } + QTC::TC("qpdf", "qpdf-c get_info_key", (result == 0 ? 0 : 1)); + return result; +} + +void qpdf_set_info_key(qpdf_data qpdf, char const* key, char const* value) +{ + if ((key == 0) || (std::strlen(key) == 0) || (key[0] != '/')) + { + return; + } + QPDFObjectHandle value_object; + if (value) + { + QTC::TC("qpdf", "qpdf-c set_info_key to value"); + value_object = QPDFObjectHandle::newString(value); + } + else + { + QTC::TC("qpdf", "qpdf-c set_info_key to null"); + value_object = QPDFObjectHandle::newNull(); + } + + QPDFObjectHandle trailer = qpdf->qpdf->getTrailer(); + if (! trailer.hasKey("/Info")) + { + QTC::TC("qpdf", "qpdf-c add info to trailer"); + trailer.replaceKey( + "/Info", + qpdf->qpdf->makeIndirectObject(QPDFObjectHandle::newDictionary())); + } + else + { + QTC::TC("qpdf", "qpdf-c set-info-key use existing info"); + } + + QPDFObjectHandle info = trailer.getKey("/Info"); + info.replaceOrRemoveKey(key, value_object); +} + +QPDF_BOOL qpdf_is_linearized(qpdf_data qpdf) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_is_linearized"); + return (qpdf->qpdf->isLinearized() ? QPDF_TRUE : QPDF_FALSE); +} + +QPDF_BOOL qpdf_is_encrypted(qpdf_data qpdf) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_is_encrypted"); + return (qpdf->qpdf->isEncrypted() ? QPDF_TRUE : QPDF_FALSE); +} + +QPDF_BOOL qpdf_allow_accessibility(qpdf_data qpdf) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_allow_accessibility"); + return qpdf->qpdf->allowAccessibility(); +} + +QPDF_BOOL qpdf_allow_extract_all(qpdf_data qpdf) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_allow_extract_all"); + return qpdf->qpdf->allowExtractAll(); +} + +QPDF_BOOL qpdf_allow_print_low_res(qpdf_data qpdf) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_allow_print_low_res"); + return qpdf->qpdf->allowPrintLowRes(); +} + +QPDF_BOOL qpdf_allow_print_high_res(qpdf_data qpdf) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_allow_print_high_res"); + return qpdf->qpdf->allowPrintHighRes(); +} + +QPDF_BOOL qpdf_allow_modify_assembly(qpdf_data qpdf) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_allow_modify_assembly"); + return qpdf->qpdf->allowModifyAssembly(); +} + +QPDF_BOOL qpdf_allow_modify_form(qpdf_data qpdf) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_allow_modify_form"); + return qpdf->qpdf->allowModifyForm(); +} + +QPDF_BOOL qpdf_allow_modify_annotation(qpdf_data qpdf) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_allow_modify_annotation"); + return qpdf->qpdf->allowModifyAnnotation(); +} + +QPDF_BOOL qpdf_allow_modify_other(qpdf_data qpdf) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_allow_modify_other"); + return qpdf->qpdf->allowModifyOther(); +} + +QPDF_BOOL qpdf_allow_modify_all(qpdf_data qpdf) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_allow_modify_all"); + return qpdf->qpdf->allowModifyAll(); +} + +static void qpdf_init_write_internal(qpdf_data qpdf) +{ + if (qpdf->qpdf_writer) + { + QTC::TC("qpdf", "qpdf-c called qpdf_init_write multiple times"); + delete qpdf->qpdf_writer; + qpdf->qpdf_writer = 0; + if (qpdf->output_buffer) + { + delete qpdf->output_buffer; + qpdf->output_buffer = 0; + qpdf->write_memory = false; + qpdf->filename = 0; + } + } +} + +QPDF_ERROR_CODE qpdf_init_write(qpdf_data qpdf, char const* filename) +{ + qpdf_init_write_internal(qpdf); + qpdf->filename = filename; + QPDF_ERROR_CODE status = trap_errors(qpdf, &call_init_write); + QTC::TC("qpdf", "qpdf-c called qpdf_init_write", status); + return status; +} + +QPDF_ERROR_CODE qpdf_init_write_memory(qpdf_data qpdf) +{ + qpdf_init_write_internal(qpdf); + QPDF_ERROR_CODE status = trap_errors(qpdf, &call_init_write_memory); + QTC::TC("qpdf", "qpdf-c called qpdf_init_write_memory"); + qpdf->write_memory = true; + return status; +} + +static void qpdf_get_buffer_internal(qpdf_data qpdf) +{ + if (qpdf->write_memory && (qpdf->output_buffer == 0)) + { + qpdf->output_buffer = qpdf->qpdf_writer->getBuffer(); + } +} + +size_t qpdf_get_buffer_length(qpdf_data qpdf) +{ + qpdf_get_buffer_internal(qpdf); + size_t result = 0; + if (qpdf->output_buffer) + { + result = qpdf->output_buffer->getSize(); + } + return result; +} + +unsigned char const* qpdf_get_buffer(qpdf_data qpdf) +{ + unsigned char const* result = 0; + qpdf_get_buffer_internal(qpdf); + if (qpdf->output_buffer) + { + result = qpdf->output_buffer->getBuffer(); + } + return result; +} + +void qpdf_set_object_stream_mode(qpdf_data qpdf, qpdf_object_stream_e mode) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_set_object_stream_mode"); + qpdf->qpdf_writer->setObjectStreamMode(mode); +} + +void qpdf_set_stream_data_mode(qpdf_data qpdf, qpdf_stream_data_e mode) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_set_stream_data_mode"); + qpdf->qpdf_writer->setStreamDataMode(mode); +} + +void qpdf_set_content_normalization(qpdf_data qpdf, QPDF_BOOL value) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_set_content_normalization"); + qpdf->qpdf_writer->setContentNormalization(value); +} + +void qpdf_set_qdf_mode(qpdf_data qpdf, QPDF_BOOL value) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_set_qdf_mode"); + qpdf->qpdf_writer->setQDFMode(value); +} + +void qpdf_set_static_ID(qpdf_data qpdf, QPDF_BOOL value) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_set_static_ID"); + qpdf->qpdf_writer->setStaticID(value); +} + +void qpdf_set_static_aes_IV(qpdf_data qpdf, QPDF_BOOL value) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_set_static_aes_IV"); + qpdf->qpdf_writer->setStaticAesIV(value); +} + +void qpdf_set_suppress_original_object_IDs( + qpdf_data qpdf, QPDF_BOOL value) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_set_suppress_original_object_IDs"); + qpdf->qpdf_writer->setSuppressOriginalObjectIDs(value); +} + +void qpdf_set_preserve_encryption(qpdf_data qpdf, QPDF_BOOL value) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_set_preserve_encryption"); + qpdf->qpdf_writer->setPreserveEncryption(value); +} + +void qpdf_set_r2_encryption_parameters( + qpdf_data qpdf, char const* user_password, char const* owner_password, + QPDF_BOOL allow_print, QPDF_BOOL allow_modify, + QPDF_BOOL allow_extract, QPDF_BOOL allow_annotate) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_set_r2_encryption_parameters"); + qpdf->qpdf_writer->setR2EncryptionParameters( + user_password, owner_password, + allow_print, allow_modify, allow_extract, allow_annotate); +} + +void qpdf_set_r3_encryption_parameters( + qpdf_data qpdf, char const* user_password, char const* owner_password, + QPDF_BOOL allow_accessibility, QPDF_BOOL allow_extract, + qpdf_r3_print_e print, qpdf_r3_modify_e modify) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_set_r3_encryption_parameters"); + qpdf->qpdf_writer->setR3EncryptionParameters( + user_password, owner_password, + allow_accessibility, allow_extract, print, modify); +} + +void qpdf_set_r4_encryption_parameters( + qpdf_data qpdf, char const* user_password, char const* owner_password, + QPDF_BOOL allow_accessibility, QPDF_BOOL allow_extract, + qpdf_r3_print_e print, qpdf_r3_modify_e modify, + QPDF_BOOL encrypt_metadata, QPDF_BOOL use_aes) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_set_r4_encryption_parameters"); + qpdf->qpdf_writer->setR4EncryptionParameters( + user_password, owner_password, + allow_accessibility, allow_extract, print, modify, + encrypt_metadata, use_aes); +} + +void qpdf_set_linearization(qpdf_data qpdf, QPDF_BOOL value) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_set_linearization"); + qpdf->qpdf_writer->setLinearization(value); +} + +void qpdf_set_minimum_pdf_version(qpdf_data qpdf, char const* version) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_set_minimum_pdf_version"); + qpdf->qpdf_writer->setMinimumPDFVersion(version); +} + +void qpdf_force_pdf_version(qpdf_data qpdf, char const* version) +{ + QTC::TC("qpdf", "qpdf-c called qpdf_force_pdf_version"); + qpdf->qpdf_writer->forcePDFVersion(version); +} + +QPDF_ERROR_CODE qpdf_write(qpdf_data qpdf) +{ + QPDF_ERROR_CODE status = QPDF_SUCCESS; + status = trap_errors(qpdf, &call_write); + QTC::TC("qpdf", "qpdf-c called qpdf_write", status); + return status; +} diff --git a/libqpdf/qpdf/BitStream.hh b/libqpdf/qpdf/BitStream.hh new file mode 100644 index 0000000..e45a90e --- /dev/null +++ b/libqpdf/qpdf/BitStream.hh @@ -0,0 +1,29 @@ +// Read bits from a bit stream. See BitWriter for writing. + +#ifndef __BITSTREAM_HH__ +#define __BITSTREAM_HH__ + +#include + +class BitStream +{ + public: + QPDF_DLL + BitStream(unsigned char const* p, int nbytes); + QPDF_DLL + void reset(); + QPDF_DLL + unsigned long long getBits(int nbits); + QPDF_DLL + void skipToNextByte(); + + private: + unsigned char const* start; + int nbytes; + + unsigned char const* p; + unsigned int bit_offset; + unsigned int bits_available; +}; + +#endif // __BITSTREAM_HH__ diff --git a/libqpdf/qpdf/BitWriter.hh b/libqpdf/qpdf/BitWriter.hh new file mode 100644 index 0000000..7e3b07a --- /dev/null +++ b/libqpdf/qpdf/BitWriter.hh @@ -0,0 +1,29 @@ +// Write bits into a bit stream. See BitStream for reading. + +#ifndef __BITWRITER_HH__ +#define __BITWRITER_HH__ + +#include + +class Pipeline; + +class BitWriter +{ + public: + // Write bits to the pipeline. It is the caller's responsibility + // to eventually call finish on the pipeline. + QPDF_DLL + BitWriter(Pipeline* pl); + QPDF_DLL + void writeBits(unsigned long long val, unsigned int bits); + // Force any partial byte to be written to the pipeline. + QPDF_DLL + void flush(); + + private: + Pipeline* pl; + unsigned char ch; + unsigned int bit_offset; +}; + +#endif // __BITWRITER_HH__ diff --git a/libqpdf/qpdf/MD5.hh b/libqpdf/qpdf/MD5.hh new file mode 100644 index 0000000..4cfe027 --- /dev/null +++ b/libqpdf/qpdf/MD5.hh @@ -0,0 +1,92 @@ +#ifndef __MD5_HH__ +#define __MD5_HH__ + +#include +#include +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#include + +class MD5 +{ + public: + typedef unsigned char Digest[16]; + + QPDF_DLL + MD5(); + QPDF_DLL + void reset(); + + // encodes string and finalizes + QPDF_DLL + void encodeString(char const* input_string); + + // encodes file and finalizes + QPDF_DLL + void encodeFile(char const* filename, int up_to_size = -1); + + // appends string to current md5 object + QPDF_DLL + void appendString(char const* input_string); + + // appends arbitrary data to current md5 object + QPDF_DLL + void encodeDataIncrementally(char const* input_data, int len); + + // computes a raw digest + QPDF_DLL + void digest(Digest); + + // prints the digest to stdout terminated with \r\n (primarily for + // testing) + QPDF_DLL + void print(); + + // returns the digest as a hexadecimal string + QPDF_DLL + std::string unparse(); + + // Convenience functions + QPDF_DLL + static std::string getDataChecksum(char const* buf, int len); + QPDF_DLL + static std::string getFileChecksum(char const* filename, + int up_to_size = -1); + QPDF_DLL + static bool checkDataChecksum(char const* const checksum, + char const* buf, int len); + QPDF_DLL + static bool checkFileChecksum(char const* const checksum, + char const* filename, int up_to_size = -1); + + private: + // POINTER defines a generic pointer type + typedef void *POINTER; + + // UINT2 defines a two byte word + typedef uint16_t UINT2; + + // UINT4 defines a four byte word + typedef uint32_t UINT4; + + void init(); + void update(unsigned char *, unsigned int); + void final(); + + static void transform(UINT4 [4], unsigned char [64]); + static void encode(unsigned char *, UINT4 *, unsigned int); + static void decode(UINT4 *, unsigned char *, unsigned int); + + UINT4 state[4]; // state (ABCD) + UINT4 count[2]; // number of bits, modulo 2^64 (lsb first) + unsigned char buffer[64]; // input buffer + + bool finalized; + Digest digest_val; +}; + +#endif // __MD5_HH__ diff --git a/libqpdf/qpdf/PCRE.hh b/libqpdf/qpdf/PCRE.hh new file mode 100644 index 0000000..8f20065 --- /dev/null +++ b/libqpdf/qpdf/PCRE.hh @@ -0,0 +1,117 @@ +// This is a C++ wrapper class around Philip Hazel's perl-compatible +// regular expressions library. +// + +#ifndef __PCRE_HH__ +#define __PCRE_HH__ + +#include + +#ifdef _WIN32 +# define PCRE_STATIC +#endif +#include +#include +#include + +// Note: this class does not encapsulate all features of the PCRE +// package -- only those that I actually need right now are here. + +class PCRE +{ + public: + // This is thrown when an attempt is made to access a non-existent + // back reference. + class NoBackref: public std::logic_error + { + public: + QPDF_DLL + NoBackref(); + virtual ~NoBackref() throw() {} + }; + + class Match + { + friend class PCRE; + public: + QPDF_DLL + Match(int nbackrefs, char const* subject); + QPDF_DLL + Match(Match const&); + QPDF_DLL + Match& operator=(Match const&); + QPDF_DLL + ~Match(); + QPDF_DLL + operator bool(); + + // All the back reference accessing routines may throw the + // special exception NoBackref (derived from Exception) if the + // back reference does not exist. Exception will be thrown + // for other error conditions. This allows callers to trap + // this condition explicitly when they care about the + // difference between a backreference matching an empty string + // and not matching at all. + + // see getMatch flags below + QPDF_DLL + std::string getMatch(int n, int flags = 0); + QPDF_DLL + void getOffsetLength(int n, int& offset, int& length); + QPDF_DLL + int getOffset(int n); + QPDF_DLL + int getLength(int n); + + // nMatches returns the number of available matches including + // match 0 which is the whole string. In other words, if you + // have one backreference in your expression and the + // expression matches, nMatches() will return 2, getMatch(0) + // will return the whole string, getMatch(1) will return the + // text that matched the backreference, and getMatch(2) will + // throw an exception because it is out of range. + QPDF_DLL + int nMatches() const; + + // Flags for getMatch + + // getMatch on a substring that didn't match should return + // empty string instead of throwing an exception + static int const gm_no_substring_returns_empty = (1 << 0); + + private: + void init(int nmatches, int nbackrefs, char const* subject); + void copy(Match const&); + void destroy(); + + int nbackrefs; + char const* subject; + int* ovector; + int ovecsize; + int nmatches; + }; + + // The value passed in as options is passed to pcre_exec. See man + // pcreapi for details. + QPDF_DLL + PCRE(char const* pattern, int options = 0); + QPDF_DLL + ~PCRE(); + + QPDF_DLL + Match match(char const* subject, int options = 0, int startoffset = 0, + int size = -1); + + QPDF_DLL + static void test(int n = 0); + + private: + // prohibit copying and assignment + PCRE(PCRE const&); + PCRE& operator=(PCRE const&); + + pcre* code; + int nbackrefs; +}; + +#endif // __PCRE_HH__ diff --git a/libqpdf/qpdf/Pl_AES_PDF.hh b/libqpdf/qpdf/Pl_AES_PDF.hh new file mode 100644 index 0000000..3947506 --- /dev/null +++ b/libqpdf/qpdf/Pl_AES_PDF.hh @@ -0,0 +1,55 @@ +#ifndef __PL_AES_PDF_HH__ +#define __PL_AES_PDF_HH__ + +#include +#include +#ifdef HAVE_STDINT_H +# include +#endif + +// This pipeline implements AES-128 with CBC and block padding as +// specified in the PDF specification. + +class Pl_AES_PDF: public Pipeline +{ + public: + // key_data should be a pointer to key_size bytes of data + static unsigned int const key_size = 16; + QPDF_DLL + Pl_AES_PDF(char const* identifier, Pipeline* next, + bool encrypt, unsigned char const key[key_size]); + QPDF_DLL + virtual ~Pl_AES_PDF(); + + QPDF_DLL + virtual void write(unsigned char* data, size_t len); + QPDF_DLL + virtual void finish(); + + // For testing only; PDF always uses CBC + QPDF_DLL + void disableCBC(); + // For testing only: use a fixed initialization vector for CBC + QPDF_DLL + static void useStaticIV(); + + private: + void flush(bool discard_padding); + void initializeVector(); + + static unsigned int const buf_size = 16; + static bool use_static_iv; + + bool encrypt; + bool cbc_mode; + bool first; + size_t offset; // offset into memory buffer + unsigned char key[key_size]; + uint32_t rk[key_size + 28]; + unsigned char inbuf[buf_size]; + unsigned char outbuf[buf_size]; + unsigned char cbc_block[buf_size]; + unsigned int nrounds; +}; + +#endif // __PL_AES_PDF_HH__ diff --git a/libqpdf/qpdf/Pl_ASCII85Decoder.hh b/libqpdf/qpdf/Pl_ASCII85Decoder.hh new file mode 100644 index 0000000..001da86 --- /dev/null +++ b/libqpdf/qpdf/Pl_ASCII85Decoder.hh @@ -0,0 +1,26 @@ +#ifndef __PL_ASCII85DECODER_HH__ +#define __PL_ASCII85DECODER_HH__ + +#include + +class Pl_ASCII85Decoder: public Pipeline +{ + public: + QPDF_DLL + Pl_ASCII85Decoder(char const* identifier, Pipeline* next); + QPDF_DLL + virtual ~Pl_ASCII85Decoder(); + QPDF_DLL + virtual void write(unsigned char* buf, size_t len); + QPDF_DLL + virtual void finish(); + + private: + void flush(); + + char inbuf[5]; + size_t pos; + size_t eod; +}; + +#endif // __PL_ASCII85DECODER_HH__ diff --git a/libqpdf/qpdf/Pl_ASCIIHexDecoder.hh b/libqpdf/qpdf/Pl_ASCIIHexDecoder.hh new file mode 100644 index 0000000..1d33afd --- /dev/null +++ b/libqpdf/qpdf/Pl_ASCIIHexDecoder.hh @@ -0,0 +1,26 @@ +#ifndef __PL_ASCIIHEXDECODER_HH__ +#define __PL_ASCIIHEXDECODER_HH__ + +#include + +class Pl_ASCIIHexDecoder: public Pipeline +{ + public: + QPDF_DLL + Pl_ASCIIHexDecoder(char const* identifier, Pipeline* next); + QPDF_DLL + virtual ~Pl_ASCIIHexDecoder(); + QPDF_DLL + virtual void write(unsigned char* buf, size_t len); + QPDF_DLL + virtual void finish(); + + private: + void flush(); + + char inbuf[3]; + size_t pos; + bool eod; +}; + +#endif // __PL_ASCIIHEXDECODER_HH__ diff --git a/libqpdf/qpdf/Pl_LZWDecoder.hh b/libqpdf/qpdf/Pl_LZWDecoder.hh new file mode 100644 index 0000000..4121f6f --- /dev/null +++ b/libqpdf/qpdf/Pl_LZWDecoder.hh @@ -0,0 +1,43 @@ +#ifndef __PL_LZWDECODER_HH__ +#define __PL_LZWDECODER_HH__ + +#include + +#include +#include + +class Pl_LZWDecoder: public Pipeline +{ + public: + QPDF_DLL + Pl_LZWDecoder(char const* identifier, Pipeline* next, + bool early_code_change); + QPDF_DLL + virtual ~Pl_LZWDecoder(); + QPDF_DLL + virtual void write(unsigned char* buf, size_t len); + QPDF_DLL + virtual void finish(); + + private: + void sendNextCode(); + void handleCode(int code); + unsigned char getFirstChar(int code); + void addToTable(unsigned char next); + + // members used for converting bits to codes + unsigned char buf[3]; + int code_size; + int next; + int byte_pos; + int bit_pos; // left to right: 01234567 + int bits_available; + + // members used for handle LZW decompression + bool code_change_delta; + bool eod; + std::vector table; + int last_code; +}; + +#endif // __PL_LZWDECODER_HH__ diff --git a/libqpdf/qpdf/Pl_MD5.hh b/libqpdf/qpdf/Pl_MD5.hh new file mode 100644 index 0000000..13a0927 --- /dev/null +++ b/libqpdf/qpdf/Pl_MD5.hh @@ -0,0 +1,34 @@ +#ifndef __PL_MD5_HH__ +#define __PL_MD5_HH__ + +// This pipeline sends its output to its successor unmodified. After +// calling finish, the MD5 checksum of the data that passed through +// the pipeline is available. + +// This pipeline is reusable; i.e., it is safe to call write() after +// calling finish(). The first call to write() after a call to +// finish() initializes a new MD5 object. + +#include +#include + +class Pl_MD5: public Pipeline +{ + public: + QPDF_DLL + Pl_MD5(char const* identifier, Pipeline* next); + QPDF_DLL + virtual ~Pl_MD5(); + QPDF_DLL + virtual void write(unsigned char*, size_t); + QPDF_DLL + virtual void finish(); + QPDF_DLL + std::string getHexDigest(); + + private: + bool in_progress; + MD5 md5; +}; + +#endif // __PL_MD5_HH__ diff --git a/libqpdf/qpdf/Pl_PNGFilter.hh b/libqpdf/qpdf/Pl_PNGFilter.hh new file mode 100644 index 0000000..7d7ebe7 --- /dev/null +++ b/libqpdf/qpdf/Pl_PNGFilter.hh @@ -0,0 +1,52 @@ +#ifndef __PL_PNGFILTER_HH__ +#define __PL_PNGFILTER_HH__ + +// This pipeline applies or reverses the application of a PNG filter +// as described in the PNG specification. + +// NOTE: In its initial implementation, it only encodes and decodes +// filters "none" and "up". The primary motivation of this code is to +// encode and decode PDF 1.5+ XRef streams which are often encoded +// with Flate predictor 12, which corresponds to the PNG up filter. +// At present, the bytes_per_pixel parameter is ignored, and an +// exception is thrown if any row of the file has a filter of other +// than 0 or 2. Finishing the implementation would not be difficult. +// See chapter 6 of the PNG specification for a description of the +// filter algorithms. + +#include + +class Pl_PNGFilter: public Pipeline +{ + public: + // Encoding is not presently supported + enum action_e { a_encode, a_decode }; + + QPDF_DLL + Pl_PNGFilter(char const* identifier, Pipeline* next, + action_e action, unsigned int columns, + unsigned int bytes_per_pixel); + QPDF_DLL + virtual ~Pl_PNGFilter(); + + QPDF_DLL + virtual void write(unsigned char* data, size_t len); + QPDF_DLL + virtual void finish(); + + private: + void processRow(); + void encodeRow(); + void decodeRow(); + + action_e action; + unsigned int columns; + unsigned char* cur_row; + unsigned char* prev_row; + unsigned char* buf1; + unsigned char* buf2; + size_t pos; + size_t incoming; +}; + +#endif // __PL_PNGFILTER_HH__ diff --git a/libqpdf/qpdf/Pl_QPDFTokenizer.hh b/libqpdf/qpdf/Pl_QPDFTokenizer.hh new file mode 100644 index 0000000..0d04157 --- /dev/null +++ b/libqpdf/qpdf/Pl_QPDFTokenizer.hh @@ -0,0 +1,41 @@ +#ifndef __PL_QPDFTOKENIZER_HH__ +#define __PL_QPDFTOKENIZER_HH__ + +#include + +#include + +// +// Treat incoming text as a stream consisting of valid PDF tokens, but +// output bad tokens just the same. The idea here is to be able to +// use pipeline for content streams to normalize newlines without +// interfering with meaningful newlines such as those that occur +// inside of strings. +// + +class Pl_QPDFTokenizer: public Pipeline +{ + public: + Pl_QPDFTokenizer(char const* identifier, Pipeline* next); + virtual ~Pl_QPDFTokenizer(); + virtual void write(unsigned char* buf, size_t len); + virtual void finish(); + + private: + void processChar(char ch); + void checkUnread(); + void writeNext(char const*, size_t len); + void writeToken(QPDFTokenizer::Token&); + + QPDFTokenizer tokenizer; + bool newline_after_next_token; + bool just_wrote_nl; + bool last_char_was_cr; + bool unread_char; + char char_to_unread; + bool in_inline_image; + static int const IMAGE_BUF_SIZE = 4; // must be >= 4 + char image_buf[IMAGE_BUF_SIZE]; +}; + +#endif // __PL_QPDFTOKENIZER_HH__ diff --git a/libqpdf/qpdf/Pl_RC4.hh b/libqpdf/qpdf/Pl_RC4.hh new file mode 100644 index 0000000..bb892f1 --- /dev/null +++ b/libqpdf/qpdf/Pl_RC4.hh @@ -0,0 +1,32 @@ +#ifndef __PL_RC4_HH__ +#define __PL_RC4_HH__ + +#include + +#include + +class Pl_RC4: public Pipeline +{ + public: + static int const def_bufsize = 65536; + + // key_len of -1 means treat key_data as a null-terminated string + QPDF_DLL + Pl_RC4(char const* identifier, Pipeline* next, + unsigned char const* key_data, int key_len = -1, + size_t out_bufsize = def_bufsize); + QPDF_DLL + virtual ~Pl_RC4(); + + QPDF_DLL + virtual void write(unsigned char* data, size_t len); + QPDF_DLL + virtual void finish(); + + private: + unsigned char* outbuf; + size_t out_bufsize; + RC4 rc4; +}; + +#endif // __PL_RC4_HH__ diff --git a/libqpdf/qpdf/QPDF_Array.hh b/libqpdf/qpdf/QPDF_Array.hh new file mode 100644 index 0000000..338f6eb --- /dev/null +++ b/libqpdf/qpdf/QPDF_Array.hh @@ -0,0 +1,33 @@ +#ifndef __QPDF_ARRAY_HH__ +#define __QPDF_ARRAY_HH__ + +#include + +#include +#include + +class QPDF_Array: public QPDFObject +{ + public: + QPDF_Array(std::vector const& items); + virtual ~QPDF_Array(); + virtual std::string unparse(); + + int getNItems() const; + QPDFObjectHandle getItem(int n) const; + std::vector const& getAsVector() const; + + void setItem(int, QPDFObjectHandle const&); + void setFromVector(std::vector const& items); + void insertItem(int at, QPDFObjectHandle const& item); + void appendItem(QPDFObjectHandle const& item); + void eraseItem(int at); + + protected: + virtual void releaseResolved(); + + private: + std::vector items; +}; + +#endif // __QPDF_ARRAY_HH__ diff --git a/libqpdf/qpdf/QPDF_Bool.hh b/libqpdf/qpdf/QPDF_Bool.hh new file mode 100644 index 0000000..90dc590 --- /dev/null +++ b/libqpdf/qpdf/QPDF_Bool.hh @@ -0,0 +1,18 @@ +#ifndef __QPDF_BOOL_HH__ +#define __QPDF_BOOL_HH__ + +#include + +class QPDF_Bool: public QPDFObject +{ + public: + QPDF_Bool(bool val); + virtual ~QPDF_Bool(); + virtual std::string unparse(); + bool getVal() const; + + private: + bool val; +}; + +#endif // __QPDF_BOOL_HH__ diff --git a/libqpdf/qpdf/QPDF_Dictionary.hh b/libqpdf/qpdf/QPDF_Dictionary.hh new file mode 100644 index 0000000..af9f7f0 --- /dev/null +++ b/libqpdf/qpdf/QPDF_Dictionary.hh @@ -0,0 +1,40 @@ +#ifndef __QPDF_DICTIONARY_HH__ +#define __QPDF_DICTIONARY_HH__ + +#include + +#include +#include + +#include + +class QPDF_Dictionary: public QPDFObject +{ + public: + QPDF_Dictionary(std::map const& items); + virtual ~QPDF_Dictionary(); + virtual std::string unparse(); + + // hasKey() and getKeys() treat keys with null values as if they + // aren't there. getKey() returns null for the value of a + // non-existent key. This is as per the PDF spec. + bool hasKey(std::string const&); + QPDFObjectHandle getKey(std::string const&); + std::set getKeys(); + std::map const& getAsMap() const; + + // Replace value of key, adding it if it does not exist + void replaceKey(std::string const& key, QPDFObjectHandle const&); + // Remove key, doing nothing if key does not exist + void removeKey(std::string const& key); + // If object is null, replace key; otherwise, remove key + void replaceOrRemoveKey(std::string const& key, QPDFObjectHandle); + + protected: + virtual void releaseResolved(); + + private: + std::map items; +}; + +#endif // __QPDF_DICTIONARY_HH__ diff --git a/libqpdf/qpdf/QPDF_Integer.hh b/libqpdf/qpdf/QPDF_Integer.hh new file mode 100644 index 0000000..f996469 --- /dev/null +++ b/libqpdf/qpdf/QPDF_Integer.hh @@ -0,0 +1,18 @@ +#ifndef __QPDF_INTEGER_HH__ +#define __QPDF_INTEGER_HH__ + +#include + +class QPDF_Integer: public QPDFObject +{ + public: + QPDF_Integer(long long val); + virtual ~QPDF_Integer(); + virtual std::string unparse(); + long long getVal() const; + + private: + long long val; +}; + +#endif // __QPDF_INTEGER_HH__ diff --git a/libqpdf/qpdf/QPDF_Name.hh b/libqpdf/qpdf/QPDF_Name.hh new file mode 100644 index 0000000..361556a --- /dev/null +++ b/libqpdf/qpdf/QPDF_Name.hh @@ -0,0 +1,21 @@ +#ifndef __QPDF_NAME_HH__ +#define __QPDF_NAME_HH__ + +#include + +class QPDF_Name: public QPDFObject +{ + public: + QPDF_Name(std::string const& name); + virtual ~QPDF_Name(); + virtual std::string unparse(); + std::string getName() const; + + // Put # into strings with characters unsuitable for name token + static std::string normalizeName(std::string const& name); + + private: + std::string name; +}; + +#endif // __QPDF_NAME_HH__ diff --git a/libqpdf/qpdf/QPDF_Null.hh b/libqpdf/qpdf/QPDF_Null.hh new file mode 100644 index 0000000..dffe026 --- /dev/null +++ b/libqpdf/qpdf/QPDF_Null.hh @@ -0,0 +1,13 @@ +#ifndef __QPDF_NULL_HH__ +#define __QPDF_NULL_HH__ + +#include + +class QPDF_Null: public QPDFObject +{ + public: + virtual ~QPDF_Null(); + virtual std::string unparse(); +}; + +#endif // __QPDF_NULL_HH__ diff --git a/libqpdf/qpdf/QPDF_Real.hh b/libqpdf/qpdf/QPDF_Real.hh new file mode 100644 index 0000000..2895cee --- /dev/null +++ b/libqpdf/qpdf/QPDF_Real.hh @@ -0,0 +1,20 @@ +#ifndef __QPDF_REAL_HH__ +#define __QPDF_REAL_HH__ + +#include + +class QPDF_Real: public QPDFObject +{ + public: + QPDF_Real(std::string const& val); + QPDF_Real(double value, int decimal_places = 0); + virtual ~QPDF_Real(); + virtual std::string unparse(); + std::string getVal(); + + private: + // Store reals as strings to avoid roundoff errors. + std::string val; +}; + +#endif // __QPDF_REAL_HH__ diff --git a/libqpdf/qpdf/QPDF_Reserved.hh b/libqpdf/qpdf/QPDF_Reserved.hh new file mode 100644 index 0000000..b149f77 --- /dev/null +++ b/libqpdf/qpdf/QPDF_Reserved.hh @@ -0,0 +1,13 @@ +#ifndef __QPDF_RESERVED_HH__ +#define __QPDF_RESERVED_HH__ + +#include + +class QPDF_Reserved: public QPDFObject +{ + public: + virtual ~QPDF_Reserved(); + virtual std::string unparse(); +}; + +#endif // __QPDF_RESERVED_HH__ diff --git a/libqpdf/qpdf/QPDF_Stream.hh b/libqpdf/qpdf/QPDF_Stream.hh new file mode 100644 index 0000000..34eacee --- /dev/null +++ b/libqpdf/qpdf/QPDF_Stream.hh @@ -0,0 +1,61 @@ +#ifndef __QPDF_STREAM_HH__ +#define __QPDF_STREAM_HH__ + +#include + +#include +#include + +class Pipeline; +class QPDF; + +class QPDF_Stream: public QPDFObject +{ + public: + QPDF_Stream(QPDF*, int objid, int generation, + QPDFObjectHandle stream_dict, + qpdf_offset_t offset, size_t length); + virtual ~QPDF_Stream(); + virtual std::string unparse(); + QPDFObjectHandle getDict() const; + + // See comments in QPDFObjectHandle.hh for these methods. + bool pipeStreamData(Pipeline*, bool filter, + bool normalize, bool compress); + PointerHolder getStreamData(); + PointerHolder getRawStreamData(); + void replaceStreamData(PointerHolder data, + QPDFObjectHandle const& filter, + QPDFObjectHandle const& decode_parms); + void replaceStreamData( + PointerHolder provider, + QPDFObjectHandle const& filter, + QPDFObjectHandle const& decode_parms); + + void replaceDict(QPDFObjectHandle new_dict); + + // Replace object ID and generation. This may only be called if + // object ID and generation are 0. It is used by QPDFObjectHandle + // when adding streams to files. + void setObjGen(int objid, int generation); + + private: + static std::map filter_abbreviations; + + void replaceFilterData(QPDFObjectHandle const& filter, + QPDFObjectHandle const& decode_parms, + size_t length); + bool filterable(std::vector& filters, + int& predictor, int& columns, bool& early_code_change); + + QPDF* qpdf; + int objid; + int generation; + QPDFObjectHandle stream_dict; + qpdf_offset_t offset; + size_t length; + PointerHolder stream_data; + PointerHolder stream_provider; +}; + +#endif // __QPDF_STREAM_HH__ diff --git a/libqpdf/qpdf/QPDF_String.hh b/libqpdf/qpdf/QPDF_String.hh new file mode 100644 index 0000000..82860e9 --- /dev/null +++ b/libqpdf/qpdf/QPDF_String.hh @@ -0,0 +1,22 @@ +#ifndef __QPDF_STRING_HH__ +#define __QPDF_STRING_HH__ + +#include + +// QPDF_Strings may included embedded null characters. + +class QPDF_String: public QPDFObject +{ + public: + QPDF_String(std::string const& val); + virtual ~QPDF_String(); + virtual std::string unparse(); + std::string unparse(bool force_binary); + std::string getVal() const; + std::string getUTF8Val() const; + + private: + std::string val; +}; + +#endif // __QPDF_STRING_HH__ diff --git a/libqpdf/qpdf/RC4.hh b/libqpdf/qpdf/RC4.hh new file mode 100644 index 0000000..c26f3d0 --- /dev/null +++ b/libqpdf/qpdf/RC4.hh @@ -0,0 +1,25 @@ +#ifndef __RC4_HH__ +#define __RC4_HH__ + +class RC4 +{ + public: + // key_len of -1 means treat key_data as a null-terminated string + RC4(unsigned char const* key_data, int key_len = -1); + + // out_data = 0 means to encrypt/decrypt in place + void process(unsigned char* in_data, int len, unsigned char* out_data = 0); + + private: + class RC4Key + { + public: + unsigned char state[256]; + unsigned char x; + unsigned char y; + }; + + RC4Key key; +}; + +#endif // __RC4_HH__ diff --git a/libqpdf/qpdf/rijndael.h b/libqpdf/qpdf/rijndael.h new file mode 100644 index 0000000..a9cd71d --- /dev/null +++ b/libqpdf/qpdf/rijndael.h @@ -0,0 +1,25 @@ +#ifndef H__RIJNDAEL +#define H__RIJNDAEL + +#include +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif + +int rijndaelSetupEncrypt(uint32_t *rk, const unsigned char *key, + int keybits); +int rijndaelSetupDecrypt(uint32_t *rk, const unsigned char *key, + int keybits); +void rijndaelEncrypt(const uint32_t *rk, int nrounds, + const unsigned char plaintext[16], unsigned char ciphertext[16]); +void rijndaelDecrypt(const uint32_t *rk, int nrounds, + const unsigned char ciphertext[16], unsigned char plaintext[16]); + +#define KEYLENGTH(keybits) ((keybits)/8) +#define RKLENGTH(keybits) ((keybits)/8+28) +#define NROUNDS(keybits) ((keybits)/32+6) + +#endif diff --git a/libqpdf/rijndael.cc b/libqpdf/rijndael.cc new file mode 100644 index 0000000..64748d8 --- /dev/null +++ b/libqpdf/rijndael.cc @@ -0,0 +1,1206 @@ +#define FULL_UNROLL + +#include "qpdf/rijndael.h" + +typedef uint32_t u32; +typedef unsigned char u8; + +static const u32 Te0[256] = +{ + 0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU, + 0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U, + 0x60303050U, 0x02010103U, 0xce6767a9U, 0x562b2b7dU, + 0xe7fefe19U, 0xb5d7d762U, 0x4dababe6U, 0xec76769aU, + 0x8fcaca45U, 0x1f82829dU, 0x89c9c940U, 0xfa7d7d87U, + 0xeffafa15U, 0xb25959ebU, 0x8e4747c9U, 0xfbf0f00bU, + 0x41adadecU, 0xb3d4d467U, 0x5fa2a2fdU, 0x45afafeaU, + 0x239c9cbfU, 0x53a4a4f7U, 0xe4727296U, 0x9bc0c05bU, + 0x75b7b7c2U, 0xe1fdfd1cU, 0x3d9393aeU, 0x4c26266aU, + 0x6c36365aU, 0x7e3f3f41U, 0xf5f7f702U, 0x83cccc4fU, + 0x6834345cU, 0x51a5a5f4U, 0xd1e5e534U, 0xf9f1f108U, + 0xe2717193U, 0xabd8d873U, 0x62313153U, 0x2a15153fU, + 0x0804040cU, 0x95c7c752U, 0x46232365U, 0x9dc3c35eU, + 0x30181828U, 0x379696a1U, 0x0a05050fU, 0x2f9a9ab5U, + 0x0e070709U, 0x24121236U, 0x1b80809bU, 0xdfe2e23dU, + 0xcdebeb26U, 0x4e272769U, 0x7fb2b2cdU, 0xea75759fU, + 0x1209091bU, 0x1d83839eU, 0x582c2c74U, 0x341a1a2eU, + 0x361b1b2dU, 0xdc6e6eb2U, 0xb45a5aeeU, 0x5ba0a0fbU, + 0xa45252f6U, 0x763b3b4dU, 0xb7d6d661U, 0x7db3b3ceU, + 0x5229297bU, 0xdde3e33eU, 0x5e2f2f71U, 0x13848497U, + 0xa65353f5U, 0xb9d1d168U, 0x00000000U, 0xc1eded2cU, + 0x40202060U, 0xe3fcfc1fU, 0x79b1b1c8U, 0xb65b5bedU, + 0xd46a6abeU, 0x8dcbcb46U, 0x67bebed9U, 0x7239394bU, + 0x944a4adeU, 0x984c4cd4U, 0xb05858e8U, 0x85cfcf4aU, + 0xbbd0d06bU, 0xc5efef2aU, 0x4faaaae5U, 0xedfbfb16U, + 0x864343c5U, 0x9a4d4dd7U, 0x66333355U, 0x11858594U, + 0x8a4545cfU, 0xe9f9f910U, 0x04020206U, 0xfe7f7f81U, + 0xa05050f0U, 0x783c3c44U, 0x259f9fbaU, 0x4ba8a8e3U, + 0xa25151f3U, 0x5da3a3feU, 0x804040c0U, 0x058f8f8aU, + 0x3f9292adU, 0x219d9dbcU, 0x70383848U, 0xf1f5f504U, + 0x63bcbcdfU, 0x77b6b6c1U, 0xafdada75U, 0x42212163U, + 0x20101030U, 0xe5ffff1aU, 0xfdf3f30eU, 0xbfd2d26dU, + 0x81cdcd4cU, 0x180c0c14U, 0x26131335U, 0xc3ecec2fU, + 0xbe5f5fe1U, 0x359797a2U, 0x884444ccU, 0x2e171739U, + 0x93c4c457U, 0x55a7a7f2U, 0xfc7e7e82U, 0x7a3d3d47U, + 0xc86464acU, 0xba5d5de7U, 0x3219192bU, 0xe6737395U, + 0xc06060a0U, 0x19818198U, 0x9e4f4fd1U, 0xa3dcdc7fU, + 0x44222266U, 0x542a2a7eU, 0x3b9090abU, 0x0b888883U, + 0x8c4646caU, 0xc7eeee29U, 0x6bb8b8d3U, 0x2814143cU, + 0xa7dede79U, 0xbc5e5ee2U, 0x160b0b1dU, 0xaddbdb76U, + 0xdbe0e03bU, 0x64323256U, 0x743a3a4eU, 0x140a0a1eU, + 0x924949dbU, 0x0c06060aU, 0x4824246cU, 0xb85c5ce4U, + 0x9fc2c25dU, 0xbdd3d36eU, 0x43acacefU, 0xc46262a6U, + 0x399191a8U, 0x319595a4U, 0xd3e4e437U, 0xf279798bU, + 0xd5e7e732U, 0x8bc8c843U, 0x6e373759U, 0xda6d6db7U, + 0x018d8d8cU, 0xb1d5d564U, 0x9c4e4ed2U, 0x49a9a9e0U, + 0xd86c6cb4U, 0xac5656faU, 0xf3f4f407U, 0xcfeaea25U, + 0xca6565afU, 0xf47a7a8eU, 0x47aeaee9U, 0x10080818U, + 0x6fbabad5U, 0xf0787888U, 0x4a25256fU, 0x5c2e2e72U, + 0x381c1c24U, 0x57a6a6f1U, 0x73b4b4c7U, 0x97c6c651U, + 0xcbe8e823U, 0xa1dddd7cU, 0xe874749cU, 0x3e1f1f21U, + 0x964b4bddU, 0x61bdbddcU, 0x0d8b8b86U, 0x0f8a8a85U, + 0xe0707090U, 0x7c3e3e42U, 0x71b5b5c4U, 0xcc6666aaU, + 0x904848d8U, 0x06030305U, 0xf7f6f601U, 0x1c0e0e12U, + 0xc26161a3U, 0x6a35355fU, 0xae5757f9U, 0x69b9b9d0U, + 0x17868691U, 0x99c1c158U, 0x3a1d1d27U, 0x279e9eb9U, + 0xd9e1e138U, 0xebf8f813U, 0x2b9898b3U, 0x22111133U, + 0xd26969bbU, 0xa9d9d970U, 0x078e8e89U, 0x339494a7U, + 0x2d9b9bb6U, 0x3c1e1e22U, 0x15878792U, 0xc9e9e920U, + 0x87cece49U, 0xaa5555ffU, 0x50282878U, 0xa5dfdf7aU, + 0x038c8c8fU, 0x59a1a1f8U, 0x09898980U, 0x1a0d0d17U, + 0x65bfbfdaU, 0xd7e6e631U, 0x844242c6U, 0xd06868b8U, + 0x824141c3U, 0x299999b0U, 0x5a2d2d77U, 0x1e0f0f11U, + 0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, 0x2c16163aU, +}; + +static const u32 Te1[256] = +{ + 0xa5c66363U, 0x84f87c7cU, 0x99ee7777U, 0x8df67b7bU, + 0x0dfff2f2U, 0xbdd66b6bU, 0xb1de6f6fU, 0x5491c5c5U, + 0x50603030U, 0x03020101U, 0xa9ce6767U, 0x7d562b2bU, + 0x19e7fefeU, 0x62b5d7d7U, 0xe64dababU, 0x9aec7676U, + 0x458fcacaU, 0x9d1f8282U, 0x4089c9c9U, 0x87fa7d7dU, + 0x15effafaU, 0xebb25959U, 0xc98e4747U, 0x0bfbf0f0U, + 0xec41adadU, 0x67b3d4d4U, 0xfd5fa2a2U, 0xea45afafU, + 0xbf239c9cU, 0xf753a4a4U, 0x96e47272U, 0x5b9bc0c0U, + 0xc275b7b7U, 0x1ce1fdfdU, 0xae3d9393U, 0x6a4c2626U, + 0x5a6c3636U, 0x417e3f3fU, 0x02f5f7f7U, 0x4f83ccccU, + 0x5c683434U, 0xf451a5a5U, 0x34d1e5e5U, 0x08f9f1f1U, + 0x93e27171U, 0x73abd8d8U, 0x53623131U, 0x3f2a1515U, + 0x0c080404U, 0x5295c7c7U, 0x65462323U, 0x5e9dc3c3U, + 0x28301818U, 0xa1379696U, 0x0f0a0505U, 0xb52f9a9aU, + 0x090e0707U, 0x36241212U, 0x9b1b8080U, 0x3ddfe2e2U, + 0x26cdebebU, 0x694e2727U, 0xcd7fb2b2U, 0x9fea7575U, + 0x1b120909U, 0x9e1d8383U, 0x74582c2cU, 0x2e341a1aU, + 0x2d361b1bU, 0xb2dc6e6eU, 0xeeb45a5aU, 0xfb5ba0a0U, + 0xf6a45252U, 0x4d763b3bU, 0x61b7d6d6U, 0xce7db3b3U, + 0x7b522929U, 0x3edde3e3U, 0x715e2f2fU, 0x97138484U, + 0xf5a65353U, 0x68b9d1d1U, 0x00000000U, 0x2cc1ededU, + 0x60402020U, 0x1fe3fcfcU, 0xc879b1b1U, 0xedb65b5bU, + 0xbed46a6aU, 0x468dcbcbU, 0xd967bebeU, 0x4b723939U, + 0xde944a4aU, 0xd4984c4cU, 0xe8b05858U, 0x4a85cfcfU, + 0x6bbbd0d0U, 0x2ac5efefU, 0xe54faaaaU, 0x16edfbfbU, + 0xc5864343U, 0xd79a4d4dU, 0x55663333U, 0x94118585U, + 0xcf8a4545U, 0x10e9f9f9U, 0x06040202U, 0x81fe7f7fU, + 0xf0a05050U, 0x44783c3cU, 0xba259f9fU, 0xe34ba8a8U, + 0xf3a25151U, 0xfe5da3a3U, 0xc0804040U, 0x8a058f8fU, + 0xad3f9292U, 0xbc219d9dU, 0x48703838U, 0x04f1f5f5U, + 0xdf63bcbcU, 0xc177b6b6U, 0x75afdadaU, 0x63422121U, + 0x30201010U, 0x1ae5ffffU, 0x0efdf3f3U, 0x6dbfd2d2U, + 0x4c81cdcdU, 0x14180c0cU, 0x35261313U, 0x2fc3ececU, + 0xe1be5f5fU, 0xa2359797U, 0xcc884444U, 0x392e1717U, + 0x5793c4c4U, 0xf255a7a7U, 0x82fc7e7eU, 0x477a3d3dU, + 0xacc86464U, 0xe7ba5d5dU, 0x2b321919U, 0x95e67373U, + 0xa0c06060U, 0x98198181U, 0xd19e4f4fU, 0x7fa3dcdcU, + 0x66442222U, 0x7e542a2aU, 0xab3b9090U, 0x830b8888U, + 0xca8c4646U, 0x29c7eeeeU, 0xd36bb8b8U, 0x3c281414U, + 0x79a7dedeU, 0xe2bc5e5eU, 0x1d160b0bU, 0x76addbdbU, + 0x3bdbe0e0U, 0x56643232U, 0x4e743a3aU, 0x1e140a0aU, + 0xdb924949U, 0x0a0c0606U, 0x6c482424U, 0xe4b85c5cU, + 0x5d9fc2c2U, 0x6ebdd3d3U, 0xef43acacU, 0xa6c46262U, + 0xa8399191U, 0xa4319595U, 0x37d3e4e4U, 0x8bf27979U, + 0x32d5e7e7U, 0x438bc8c8U, 0x596e3737U, 0xb7da6d6dU, + 0x8c018d8dU, 0x64b1d5d5U, 0xd29c4e4eU, 0xe049a9a9U, + 0xb4d86c6cU, 0xfaac5656U, 0x07f3f4f4U, 0x25cfeaeaU, + 0xafca6565U, 0x8ef47a7aU, 0xe947aeaeU, 0x18100808U, + 0xd56fbabaU, 0x88f07878U, 0x6f4a2525U, 0x725c2e2eU, + 0x24381c1cU, 0xf157a6a6U, 0xc773b4b4U, 0x5197c6c6U, + 0x23cbe8e8U, 0x7ca1ddddU, 0x9ce87474U, 0x213e1f1fU, + 0xdd964b4bU, 0xdc61bdbdU, 0x860d8b8bU, 0x850f8a8aU, + 0x90e07070U, 0x427c3e3eU, 0xc471b5b5U, 0xaacc6666U, + 0xd8904848U, 0x05060303U, 0x01f7f6f6U, 0x121c0e0eU, + 0xa3c26161U, 0x5f6a3535U, 0xf9ae5757U, 0xd069b9b9U, + 0x91178686U, 0x5899c1c1U, 0x273a1d1dU, 0xb9279e9eU, + 0x38d9e1e1U, 0x13ebf8f8U, 0xb32b9898U, 0x33221111U, + 0xbbd26969U, 0x70a9d9d9U, 0x89078e8eU, 0xa7339494U, + 0xb62d9b9bU, 0x223c1e1eU, 0x92158787U, 0x20c9e9e9U, + 0x4987ceceU, 0xffaa5555U, 0x78502828U, 0x7aa5dfdfU, + 0x8f038c8cU, 0xf859a1a1U, 0x80098989U, 0x171a0d0dU, + 0xda65bfbfU, 0x31d7e6e6U, 0xc6844242U, 0xb8d06868U, + 0xc3824141U, 0xb0299999U, 0x775a2d2dU, 0x111e0f0fU, + 0xcb7bb0b0U, 0xfca85454U, 0xd66dbbbbU, 0x3a2c1616U, +}; + +static const u32 Te2[256] = +{ + 0x63a5c663U, 0x7c84f87cU, 0x7799ee77U, 0x7b8df67bU, + 0xf20dfff2U, 0x6bbdd66bU, 0x6fb1de6fU, 0xc55491c5U, + 0x30506030U, 0x01030201U, 0x67a9ce67U, 0x2b7d562bU, + 0xfe19e7feU, 0xd762b5d7U, 0xabe64dabU, 0x769aec76U, + 0xca458fcaU, 0x829d1f82U, 0xc94089c9U, 0x7d87fa7dU, + 0xfa15effaU, 0x59ebb259U, 0x47c98e47U, 0xf00bfbf0U, + 0xadec41adU, 0xd467b3d4U, 0xa2fd5fa2U, 0xafea45afU, + 0x9cbf239cU, 0xa4f753a4U, 0x7296e472U, 0xc05b9bc0U, + 0xb7c275b7U, 0xfd1ce1fdU, 0x93ae3d93U, 0x266a4c26U, + 0x365a6c36U, 0x3f417e3fU, 0xf702f5f7U, 0xcc4f83ccU, + 0x345c6834U, 0xa5f451a5U, 0xe534d1e5U, 0xf108f9f1U, + 0x7193e271U, 0xd873abd8U, 0x31536231U, 0x153f2a15U, + 0x040c0804U, 0xc75295c7U, 0x23654623U, 0xc35e9dc3U, + 0x18283018U, 0x96a13796U, 0x050f0a05U, 0x9ab52f9aU, + 0x07090e07U, 0x12362412U, 0x809b1b80U, 0xe23ddfe2U, + 0xeb26cdebU, 0x27694e27U, 0xb2cd7fb2U, 0x759fea75U, + 0x091b1209U, 0x839e1d83U, 0x2c74582cU, 0x1a2e341aU, + 0x1b2d361bU, 0x6eb2dc6eU, 0x5aeeb45aU, 0xa0fb5ba0U, + 0x52f6a452U, 0x3b4d763bU, 0xd661b7d6U, 0xb3ce7db3U, + 0x297b5229U, 0xe33edde3U, 0x2f715e2fU, 0x84971384U, + 0x53f5a653U, 0xd168b9d1U, 0x00000000U, 0xed2cc1edU, + 0x20604020U, 0xfc1fe3fcU, 0xb1c879b1U, 0x5bedb65bU, + 0x6abed46aU, 0xcb468dcbU, 0xbed967beU, 0x394b7239U, + 0x4ade944aU, 0x4cd4984cU, 0x58e8b058U, 0xcf4a85cfU, + 0xd06bbbd0U, 0xef2ac5efU, 0xaae54faaU, 0xfb16edfbU, + 0x43c58643U, 0x4dd79a4dU, 0x33556633U, 0x85941185U, + 0x45cf8a45U, 0xf910e9f9U, 0x02060402U, 0x7f81fe7fU, + 0x50f0a050U, 0x3c44783cU, 0x9fba259fU, 0xa8e34ba8U, + 0x51f3a251U, 0xa3fe5da3U, 0x40c08040U, 0x8f8a058fU, + 0x92ad3f92U, 0x9dbc219dU, 0x38487038U, 0xf504f1f5U, + 0xbcdf63bcU, 0xb6c177b6U, 0xda75afdaU, 0x21634221U, + 0x10302010U, 0xff1ae5ffU, 0xf30efdf3U, 0xd26dbfd2U, + 0xcd4c81cdU, 0x0c14180cU, 0x13352613U, 0xec2fc3ecU, + 0x5fe1be5fU, 0x97a23597U, 0x44cc8844U, 0x17392e17U, + 0xc45793c4U, 0xa7f255a7U, 0x7e82fc7eU, 0x3d477a3dU, + 0x64acc864U, 0x5de7ba5dU, 0x192b3219U, 0x7395e673U, + 0x60a0c060U, 0x81981981U, 0x4fd19e4fU, 0xdc7fa3dcU, + 0x22664422U, 0x2a7e542aU, 0x90ab3b90U, 0x88830b88U, + 0x46ca8c46U, 0xee29c7eeU, 0xb8d36bb8U, 0x143c2814U, + 0xde79a7deU, 0x5ee2bc5eU, 0x0b1d160bU, 0xdb76addbU, + 0xe03bdbe0U, 0x32566432U, 0x3a4e743aU, 0x0a1e140aU, + 0x49db9249U, 0x060a0c06U, 0x246c4824U, 0x5ce4b85cU, + 0xc25d9fc2U, 0xd36ebdd3U, 0xacef43acU, 0x62a6c462U, + 0x91a83991U, 0x95a43195U, 0xe437d3e4U, 0x798bf279U, + 0xe732d5e7U, 0xc8438bc8U, 0x37596e37U, 0x6db7da6dU, + 0x8d8c018dU, 0xd564b1d5U, 0x4ed29c4eU, 0xa9e049a9U, + 0x6cb4d86cU, 0x56faac56U, 0xf407f3f4U, 0xea25cfeaU, + 0x65afca65U, 0x7a8ef47aU, 0xaee947aeU, 0x08181008U, + 0xbad56fbaU, 0x7888f078U, 0x256f4a25U, 0x2e725c2eU, + 0x1c24381cU, 0xa6f157a6U, 0xb4c773b4U, 0xc65197c6U, + 0xe823cbe8U, 0xdd7ca1ddU, 0x749ce874U, 0x1f213e1fU, + 0x4bdd964bU, 0xbddc61bdU, 0x8b860d8bU, 0x8a850f8aU, + 0x7090e070U, 0x3e427c3eU, 0xb5c471b5U, 0x66aacc66U, + 0x48d89048U, 0x03050603U, 0xf601f7f6U, 0x0e121c0eU, + 0x61a3c261U, 0x355f6a35U, 0x57f9ae57U, 0xb9d069b9U, + 0x86911786U, 0xc15899c1U, 0x1d273a1dU, 0x9eb9279eU, + 0xe138d9e1U, 0xf813ebf8U, 0x98b32b98U, 0x11332211U, + 0x69bbd269U, 0xd970a9d9U, 0x8e89078eU, 0x94a73394U, + 0x9bb62d9bU, 0x1e223c1eU, 0x87921587U, 0xe920c9e9U, + 0xce4987ceU, 0x55ffaa55U, 0x28785028U, 0xdf7aa5dfU, + 0x8c8f038cU, 0xa1f859a1U, 0x89800989U, 0x0d171a0dU, + 0xbfda65bfU, 0xe631d7e6U, 0x42c68442U, 0x68b8d068U, + 0x41c38241U, 0x99b02999U, 0x2d775a2dU, 0x0f111e0fU, + 0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, 0x163a2c16U, +}; + +static const u32 Te3[256] = +{ + 0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U, + 0xf2f20dffU, 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U, + 0x30305060U, 0x01010302U, 0x6767a9ceU, 0x2b2b7d56U, + 0xfefe19e7U, 0xd7d762b5U, 0xababe64dU, 0x76769aecU, + 0xcaca458fU, 0x82829d1fU, 0xc9c94089U, 0x7d7d87faU, + 0xfafa15efU, 0x5959ebb2U, 0x4747c98eU, 0xf0f00bfbU, + 0xadadec41U, 0xd4d467b3U, 0xa2a2fd5fU, 0xafafea45U, + 0x9c9cbf23U, 0xa4a4f753U, 0x727296e4U, 0xc0c05b9bU, + 0xb7b7c275U, 0xfdfd1ce1U, 0x9393ae3dU, 0x26266a4cU, + 0x36365a6cU, 0x3f3f417eU, 0xf7f702f5U, 0xcccc4f83U, + 0x34345c68U, 0xa5a5f451U, 0xe5e534d1U, 0xf1f108f9U, + 0x717193e2U, 0xd8d873abU, 0x31315362U, 0x15153f2aU, + 0x04040c08U, 0xc7c75295U, 0x23236546U, 0xc3c35e9dU, + 0x18182830U, 0x9696a137U, 0x05050f0aU, 0x9a9ab52fU, + 0x0707090eU, 0x12123624U, 0x80809b1bU, 0xe2e23ddfU, + 0xebeb26cdU, 0x2727694eU, 0xb2b2cd7fU, 0x75759feaU, + 0x09091b12U, 0x83839e1dU, 0x2c2c7458U, 0x1a1a2e34U, + 0x1b1b2d36U, 0x6e6eb2dcU, 0x5a5aeeb4U, 0xa0a0fb5bU, + 0x5252f6a4U, 0x3b3b4d76U, 0xd6d661b7U, 0xb3b3ce7dU, + 0x29297b52U, 0xe3e33eddU, 0x2f2f715eU, 0x84849713U, + 0x5353f5a6U, 0xd1d168b9U, 0x00000000U, 0xeded2cc1U, + 0x20206040U, 0xfcfc1fe3U, 0xb1b1c879U, 0x5b5bedb6U, + 0x6a6abed4U, 0xcbcb468dU, 0xbebed967U, 0x39394b72U, + 0x4a4ade94U, 0x4c4cd498U, 0x5858e8b0U, 0xcfcf4a85U, + 0xd0d06bbbU, 0xefef2ac5U, 0xaaaae54fU, 0xfbfb16edU, + 0x4343c586U, 0x4d4dd79aU, 0x33335566U, 0x85859411U, + 0x4545cf8aU, 0xf9f910e9U, 0x02020604U, 0x7f7f81feU, + 0x5050f0a0U, 0x3c3c4478U, 0x9f9fba25U, 0xa8a8e34bU, + 0x5151f3a2U, 0xa3a3fe5dU, 0x4040c080U, 0x8f8f8a05U, + 0x9292ad3fU, 0x9d9dbc21U, 0x38384870U, 0xf5f504f1U, + 0xbcbcdf63U, 0xb6b6c177U, 0xdada75afU, 0x21216342U, + 0x10103020U, 0xffff1ae5U, 0xf3f30efdU, 0xd2d26dbfU, + 0xcdcd4c81U, 0x0c0c1418U, 0x13133526U, 0xecec2fc3U, + 0x5f5fe1beU, 0x9797a235U, 0x4444cc88U, 0x1717392eU, + 0xc4c45793U, 0xa7a7f255U, 0x7e7e82fcU, 0x3d3d477aU, + 0x6464acc8U, 0x5d5de7baU, 0x19192b32U, 0x737395e6U, + 0x6060a0c0U, 0x81819819U, 0x4f4fd19eU, 0xdcdc7fa3U, + 0x22226644U, 0x2a2a7e54U, 0x9090ab3bU, 0x8888830bU, + 0x4646ca8cU, 0xeeee29c7U, 0xb8b8d36bU, 0x14143c28U, + 0xdede79a7U, 0x5e5ee2bcU, 0x0b0b1d16U, 0xdbdb76adU, + 0xe0e03bdbU, 0x32325664U, 0x3a3a4e74U, 0x0a0a1e14U, + 0x4949db92U, 0x06060a0cU, 0x24246c48U, 0x5c5ce4b8U, + 0xc2c25d9fU, 0xd3d36ebdU, 0xacacef43U, 0x6262a6c4U, + 0x9191a839U, 0x9595a431U, 0xe4e437d3U, 0x79798bf2U, + 0xe7e732d5U, 0xc8c8438bU, 0x3737596eU, 0x6d6db7daU, + 0x8d8d8c01U, 0xd5d564b1U, 0x4e4ed29cU, 0xa9a9e049U, + 0x6c6cb4d8U, 0x5656faacU, 0xf4f407f3U, 0xeaea25cfU, + 0x6565afcaU, 0x7a7a8ef4U, 0xaeaee947U, 0x08081810U, + 0xbabad56fU, 0x787888f0U, 0x25256f4aU, 0x2e2e725cU, + 0x1c1c2438U, 0xa6a6f157U, 0xb4b4c773U, 0xc6c65197U, + 0xe8e823cbU, 0xdddd7ca1U, 0x74749ce8U, 0x1f1f213eU, + 0x4b4bdd96U, 0xbdbddc61U, 0x8b8b860dU, 0x8a8a850fU, + 0x707090e0U, 0x3e3e427cU, 0xb5b5c471U, 0x6666aaccU, + 0x4848d890U, 0x03030506U, 0xf6f601f7U, 0x0e0e121cU, + 0x6161a3c2U, 0x35355f6aU, 0x5757f9aeU, 0xb9b9d069U, + 0x86869117U, 0xc1c15899U, 0x1d1d273aU, 0x9e9eb927U, + 0xe1e138d9U, 0xf8f813ebU, 0x9898b32bU, 0x11113322U, + 0x6969bbd2U, 0xd9d970a9U, 0x8e8e8907U, 0x9494a733U, + 0x9b9bb62dU, 0x1e1e223cU, 0x87879215U, 0xe9e920c9U, + 0xcece4987U, 0x5555ffaaU, 0x28287850U, 0xdfdf7aa5U, + 0x8c8c8f03U, 0xa1a1f859U, 0x89898009U, 0x0d0d171aU, + 0xbfbfda65U, 0xe6e631d7U, 0x4242c684U, 0x6868b8d0U, + 0x4141c382U, 0x9999b029U, 0x2d2d775aU, 0x0f0f111eU, + 0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, 0x16163a2cU, +}; + +static const u32 Te4[256] = +{ + 0x63636363U, 0x7c7c7c7cU, 0x77777777U, 0x7b7b7b7bU, + 0xf2f2f2f2U, 0x6b6b6b6bU, 0x6f6f6f6fU, 0xc5c5c5c5U, + 0x30303030U, 0x01010101U, 0x67676767U, 0x2b2b2b2bU, + 0xfefefefeU, 0xd7d7d7d7U, 0xababababU, 0x76767676U, + 0xcacacacaU, 0x82828282U, 0xc9c9c9c9U, 0x7d7d7d7dU, + 0xfafafafaU, 0x59595959U, 0x47474747U, 0xf0f0f0f0U, + 0xadadadadU, 0xd4d4d4d4U, 0xa2a2a2a2U, 0xafafafafU, + 0x9c9c9c9cU, 0xa4a4a4a4U, 0x72727272U, 0xc0c0c0c0U, + 0xb7b7b7b7U, 0xfdfdfdfdU, 0x93939393U, 0x26262626U, + 0x36363636U, 0x3f3f3f3fU, 0xf7f7f7f7U, 0xccccccccU, + 0x34343434U, 0xa5a5a5a5U, 0xe5e5e5e5U, 0xf1f1f1f1U, + 0x71717171U, 0xd8d8d8d8U, 0x31313131U, 0x15151515U, + 0x04040404U, 0xc7c7c7c7U, 0x23232323U, 0xc3c3c3c3U, + 0x18181818U, 0x96969696U, 0x05050505U, 0x9a9a9a9aU, + 0x07070707U, 0x12121212U, 0x80808080U, 0xe2e2e2e2U, + 0xebebebebU, 0x27272727U, 0xb2b2b2b2U, 0x75757575U, + 0x09090909U, 0x83838383U, 0x2c2c2c2cU, 0x1a1a1a1aU, + 0x1b1b1b1bU, 0x6e6e6e6eU, 0x5a5a5a5aU, 0xa0a0a0a0U, + 0x52525252U, 0x3b3b3b3bU, 0xd6d6d6d6U, 0xb3b3b3b3U, + 0x29292929U, 0xe3e3e3e3U, 0x2f2f2f2fU, 0x84848484U, + 0x53535353U, 0xd1d1d1d1U, 0x00000000U, 0xededededU, + 0x20202020U, 0xfcfcfcfcU, 0xb1b1b1b1U, 0x5b5b5b5bU, + 0x6a6a6a6aU, 0xcbcbcbcbU, 0xbebebebeU, 0x39393939U, + 0x4a4a4a4aU, 0x4c4c4c4cU, 0x58585858U, 0xcfcfcfcfU, + 0xd0d0d0d0U, 0xefefefefU, 0xaaaaaaaaU, 0xfbfbfbfbU, + 0x43434343U, 0x4d4d4d4dU, 0x33333333U, 0x85858585U, + 0x45454545U, 0xf9f9f9f9U, 0x02020202U, 0x7f7f7f7fU, + 0x50505050U, 0x3c3c3c3cU, 0x9f9f9f9fU, 0xa8a8a8a8U, + 0x51515151U, 0xa3a3a3a3U, 0x40404040U, 0x8f8f8f8fU, + 0x92929292U, 0x9d9d9d9dU, 0x38383838U, 0xf5f5f5f5U, + 0xbcbcbcbcU, 0xb6b6b6b6U, 0xdadadadaU, 0x21212121U, + 0x10101010U, 0xffffffffU, 0xf3f3f3f3U, 0xd2d2d2d2U, + 0xcdcdcdcdU, 0x0c0c0c0cU, 0x13131313U, 0xececececU, + 0x5f5f5f5fU, 0x97979797U, 0x44444444U, 0x17171717U, + 0xc4c4c4c4U, 0xa7a7a7a7U, 0x7e7e7e7eU, 0x3d3d3d3dU, + 0x64646464U, 0x5d5d5d5dU, 0x19191919U, 0x73737373U, + 0x60606060U, 0x81818181U, 0x4f4f4f4fU, 0xdcdcdcdcU, + 0x22222222U, 0x2a2a2a2aU, 0x90909090U, 0x88888888U, + 0x46464646U, 0xeeeeeeeeU, 0xb8b8b8b8U, 0x14141414U, + 0xdedededeU, 0x5e5e5e5eU, 0x0b0b0b0bU, 0xdbdbdbdbU, + 0xe0e0e0e0U, 0x32323232U, 0x3a3a3a3aU, 0x0a0a0a0aU, + 0x49494949U, 0x06060606U, 0x24242424U, 0x5c5c5c5cU, + 0xc2c2c2c2U, 0xd3d3d3d3U, 0xacacacacU, 0x62626262U, + 0x91919191U, 0x95959595U, 0xe4e4e4e4U, 0x79797979U, + 0xe7e7e7e7U, 0xc8c8c8c8U, 0x37373737U, 0x6d6d6d6dU, + 0x8d8d8d8dU, 0xd5d5d5d5U, 0x4e4e4e4eU, 0xa9a9a9a9U, + 0x6c6c6c6cU, 0x56565656U, 0xf4f4f4f4U, 0xeaeaeaeaU, + 0x65656565U, 0x7a7a7a7aU, 0xaeaeaeaeU, 0x08080808U, + 0xbabababaU, 0x78787878U, 0x25252525U, 0x2e2e2e2eU, + 0x1c1c1c1cU, 0xa6a6a6a6U, 0xb4b4b4b4U, 0xc6c6c6c6U, + 0xe8e8e8e8U, 0xddddddddU, 0x74747474U, 0x1f1f1f1fU, + 0x4b4b4b4bU, 0xbdbdbdbdU, 0x8b8b8b8bU, 0x8a8a8a8aU, + 0x70707070U, 0x3e3e3e3eU, 0xb5b5b5b5U, 0x66666666U, + 0x48484848U, 0x03030303U, 0xf6f6f6f6U, 0x0e0e0e0eU, + 0x61616161U, 0x35353535U, 0x57575757U, 0xb9b9b9b9U, + 0x86868686U, 0xc1c1c1c1U, 0x1d1d1d1dU, 0x9e9e9e9eU, + 0xe1e1e1e1U, 0xf8f8f8f8U, 0x98989898U, 0x11111111U, + 0x69696969U, 0xd9d9d9d9U, 0x8e8e8e8eU, 0x94949494U, + 0x9b9b9b9bU, 0x1e1e1e1eU, 0x87878787U, 0xe9e9e9e9U, + 0xcecececeU, 0x55555555U, 0x28282828U, 0xdfdfdfdfU, + 0x8c8c8c8cU, 0xa1a1a1a1U, 0x89898989U, 0x0d0d0d0dU, + 0xbfbfbfbfU, 0xe6e6e6e6U, 0x42424242U, 0x68686868U, + 0x41414141U, 0x99999999U, 0x2d2d2d2dU, 0x0f0f0f0fU, + 0xb0b0b0b0U, 0x54545454U, 0xbbbbbbbbU, 0x16161616U, +}; + +static const u32 Td0[256] = +{ + 0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U, + 0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U, + 0x2030fa55U, 0xad766df6U, 0x88cc7691U, 0xf5024c25U, + 0x4fe5d7fcU, 0xc52acbd7U, 0x26354480U, 0xb562a38fU, + 0xdeb15a49U, 0x25ba1b67U, 0x45ea0e98U, 0x5dfec0e1U, + 0xc32f7502U, 0x814cf012U, 0x8d4697a3U, 0x6bd3f9c6U, + 0x038f5fe7U, 0x15929c95U, 0xbf6d7aebU, 0x955259daU, + 0xd4be832dU, 0x587421d3U, 0x49e06929U, 0x8ec9c844U, + 0x75c2896aU, 0xf48e7978U, 0x99583e6bU, 0x27b971ddU, + 0xbee14fb6U, 0xf088ad17U, 0xc920ac66U, 0x7dce3ab4U, + 0x63df4a18U, 0xe51a3182U, 0x97513360U, 0x62537f45U, + 0xb16477e0U, 0xbb6bae84U, 0xfe81a01cU, 0xf9082b94U, + 0x70486858U, 0x8f45fd19U, 0x94de6c87U, 0x527bf8b7U, + 0xab73d323U, 0x724b02e2U, 0xe31f8f57U, 0x6655ab2aU, + 0xb2eb2807U, 0x2fb5c203U, 0x86c57b9aU, 0xd33708a5U, + 0x302887f2U, 0x23bfa5b2U, 0x02036abaU, 0xed16825cU, + 0x8acf1c2bU, 0xa779b492U, 0xf307f2f0U, 0x4e69e2a1U, + 0x65daf4cdU, 0x0605bed5U, 0xd134621fU, 0xc4a6fe8aU, + 0x342e539dU, 0xa2f355a0U, 0x058ae132U, 0xa4f6eb75U, + 0x0b83ec39U, 0x4060efaaU, 0x5e719f06U, 0xbd6e1051U, + 0x3e218af9U, 0x96dd063dU, 0xdd3e05aeU, 0x4de6bd46U, + 0x91548db5U, 0x71c45d05U, 0x0406d46fU, 0x605015ffU, + 0x1998fb24U, 0xd6bde997U, 0x894043ccU, 0x67d99e77U, + 0xb0e842bdU, 0x07898b88U, 0xe7195b38U, 0x79c8eedbU, + 0xa17c0a47U, 0x7c420fe9U, 0xf8841ec9U, 0x00000000U, + 0x09808683U, 0x322bed48U, 0x1e1170acU, 0x6c5a724eU, + 0xfd0efffbU, 0x0f853856U, 0x3daed51eU, 0x362d3927U, + 0x0a0fd964U, 0x685ca621U, 0x9b5b54d1U, 0x24362e3aU, + 0x0c0a67b1U, 0x9357e70fU, 0xb4ee96d2U, 0x1b9b919eU, + 0x80c0c54fU, 0x61dc20a2U, 0x5a774b69U, 0x1c121a16U, + 0xe293ba0aU, 0xc0a02ae5U, 0x3c22e043U, 0x121b171dU, + 0x0e090d0bU, 0xf28bc7adU, 0x2db6a8b9U, 0x141ea9c8U, + 0x57f11985U, 0xaf75074cU, 0xee99ddbbU, 0xa37f60fdU, + 0xf701269fU, 0x5c72f5bcU, 0x44663bc5U, 0x5bfb7e34U, + 0x8b432976U, 0xcb23c6dcU, 0xb6edfc68U, 0xb8e4f163U, + 0xd731dccaU, 0x42638510U, 0x13972240U, 0x84c61120U, + 0x854a247dU, 0xd2bb3df8U, 0xaef93211U, 0xc729a16dU, + 0x1d9e2f4bU, 0xdcb230f3U, 0x0d8652ecU, 0x77c1e3d0U, + 0x2bb3166cU, 0xa970b999U, 0x119448faU, 0x47e96422U, + 0xa8fc8cc4U, 0xa0f03f1aU, 0x567d2cd8U, 0x223390efU, + 0x87494ec7U, 0xd938d1c1U, 0x8ccaa2feU, 0x98d40b36U, + 0xa6f581cfU, 0xa57ade28U, 0xdab78e26U, 0x3fadbfa4U, + 0x2c3a9de4U, 0x5078920dU, 0x6a5fcc9bU, 0x547e4662U, + 0xf68d13c2U, 0x90d8b8e8U, 0x2e39f75eU, 0x82c3aff5U, + 0x9f5d80beU, 0x69d0937cU, 0x6fd52da9U, 0xcf2512b3U, + 0xc8ac993bU, 0x10187da7U, 0xe89c636eU, 0xdb3bbb7bU, + 0xcd267809U, 0x6e5918f4U, 0xec9ab701U, 0x834f9aa8U, + 0xe6956e65U, 0xaaffe67eU, 0x21bccf08U, 0xef15e8e6U, + 0xbae79bd9U, 0x4a6f36ceU, 0xea9f09d4U, 0x29b07cd6U, + 0x31a4b2afU, 0x2a3f2331U, 0xc6a59430U, 0x35a266c0U, + 0x744ebc37U, 0xfc82caa6U, 0xe090d0b0U, 0x33a7d815U, + 0xf104984aU, 0x41ecdaf7U, 0x7fcd500eU, 0x1791f62fU, + 0x764dd68dU, 0x43efb04dU, 0xccaa4d54U, 0xe49604dfU, + 0x9ed1b5e3U, 0x4c6a881bU, 0xc12c1fb8U, 0x4665517fU, + 0x9d5eea04U, 0x018c355dU, 0xfa877473U, 0xfb0b412eU, + 0xb3671d5aU, 0x92dbd252U, 0xe9105633U, 0x6dd64713U, + 0x9ad7618cU, 0x37a10c7aU, 0x59f8148eU, 0xeb133c89U, + 0xcea927eeU, 0xb761c935U, 0xe11ce5edU, 0x7a47b13cU, + 0x9cd2df59U, 0x55f2733fU, 0x1814ce79U, 0x73c737bfU, + 0x53f7cdeaU, 0x5ffdaa5bU, 0xdf3d6f14U, 0x7844db86U, + 0xcaaff381U, 0xb968c43eU, 0x3824342cU, 0xc2a3405fU, + 0x161dc372U, 0xbce2250cU, 0x283c498bU, 0xff0d9541U, + 0x39a80171U, 0x080cb3deU, 0xd8b4e49cU, 0x6456c190U, + 0x7bcb8461U, 0xd532b670U, 0x486c5c74U, 0xd0b85742U, +}; + +static const u32 Td1[256] = +{ + 0x5051f4a7U, 0x537e4165U, 0xc31a17a4U, 0x963a275eU, + 0xcb3bab6bU, 0xf11f9d45U, 0xabacfa58U, 0x934be303U, + 0x552030faU, 0xf6ad766dU, 0x9188cc76U, 0x25f5024cU, + 0xfc4fe5d7U, 0xd7c52acbU, 0x80263544U, 0x8fb562a3U, + 0x49deb15aU, 0x6725ba1bU, 0x9845ea0eU, 0xe15dfec0U, + 0x02c32f75U, 0x12814cf0U, 0xa38d4697U, 0xc66bd3f9U, + 0xe7038f5fU, 0x9515929cU, 0xebbf6d7aU, 0xda955259U, + 0x2dd4be83U, 0xd3587421U, 0x2949e069U, 0x448ec9c8U, + 0x6a75c289U, 0x78f48e79U, 0x6b99583eU, 0xdd27b971U, + 0xb6bee14fU, 0x17f088adU, 0x66c920acU, 0xb47dce3aU, + 0x1863df4aU, 0x82e51a31U, 0x60975133U, 0x4562537fU, + 0xe0b16477U, 0x84bb6baeU, 0x1cfe81a0U, 0x94f9082bU, + 0x58704868U, 0x198f45fdU, 0x8794de6cU, 0xb7527bf8U, + 0x23ab73d3U, 0xe2724b02U, 0x57e31f8fU, 0x2a6655abU, + 0x07b2eb28U, 0x032fb5c2U, 0x9a86c57bU, 0xa5d33708U, + 0xf2302887U, 0xb223bfa5U, 0xba02036aU, 0x5ced1682U, + 0x2b8acf1cU, 0x92a779b4U, 0xf0f307f2U, 0xa14e69e2U, + 0xcd65daf4U, 0xd50605beU, 0x1fd13462U, 0x8ac4a6feU, + 0x9d342e53U, 0xa0a2f355U, 0x32058ae1U, 0x75a4f6ebU, + 0x390b83ecU, 0xaa4060efU, 0x065e719fU, 0x51bd6e10U, + 0xf93e218aU, 0x3d96dd06U, 0xaedd3e05U, 0x464de6bdU, + 0xb591548dU, 0x0571c45dU, 0x6f0406d4U, 0xff605015U, + 0x241998fbU, 0x97d6bde9U, 0xcc894043U, 0x7767d99eU, + 0xbdb0e842U, 0x8807898bU, 0x38e7195bU, 0xdb79c8eeU, + 0x47a17c0aU, 0xe97c420fU, 0xc9f8841eU, 0x00000000U, + 0x83098086U, 0x48322bedU, 0xac1e1170U, 0x4e6c5a72U, + 0xfbfd0effU, 0x560f8538U, 0x1e3daed5U, 0x27362d39U, + 0x640a0fd9U, 0x21685ca6U, 0xd19b5b54U, 0x3a24362eU, + 0xb10c0a67U, 0x0f9357e7U, 0xd2b4ee96U, 0x9e1b9b91U, + 0x4f80c0c5U, 0xa261dc20U, 0x695a774bU, 0x161c121aU, + 0x0ae293baU, 0xe5c0a02aU, 0x433c22e0U, 0x1d121b17U, + 0x0b0e090dU, 0xadf28bc7U, 0xb92db6a8U, 0xc8141ea9U, + 0x8557f119U, 0x4caf7507U, 0xbbee99ddU, 0xfda37f60U, + 0x9ff70126U, 0xbc5c72f5U, 0xc544663bU, 0x345bfb7eU, + 0x768b4329U, 0xdccb23c6U, 0x68b6edfcU, 0x63b8e4f1U, + 0xcad731dcU, 0x10426385U, 0x40139722U, 0x2084c611U, + 0x7d854a24U, 0xf8d2bb3dU, 0x11aef932U, 0x6dc729a1U, + 0x4b1d9e2fU, 0xf3dcb230U, 0xec0d8652U, 0xd077c1e3U, + 0x6c2bb316U, 0x99a970b9U, 0xfa119448U, 0x2247e964U, + 0xc4a8fc8cU, 0x1aa0f03fU, 0xd8567d2cU, 0xef223390U, + 0xc787494eU, 0xc1d938d1U, 0xfe8ccaa2U, 0x3698d40bU, + 0xcfa6f581U, 0x28a57adeU, 0x26dab78eU, 0xa43fadbfU, + 0xe42c3a9dU, 0x0d507892U, 0x9b6a5fccU, 0x62547e46U, + 0xc2f68d13U, 0xe890d8b8U, 0x5e2e39f7U, 0xf582c3afU, + 0xbe9f5d80U, 0x7c69d093U, 0xa96fd52dU, 0xb3cf2512U, + 0x3bc8ac99U, 0xa710187dU, 0x6ee89c63U, 0x7bdb3bbbU, + 0x09cd2678U, 0xf46e5918U, 0x01ec9ab7U, 0xa8834f9aU, + 0x65e6956eU, 0x7eaaffe6U, 0x0821bccfU, 0xe6ef15e8U, + 0xd9bae79bU, 0xce4a6f36U, 0xd4ea9f09U, 0xd629b07cU, + 0xaf31a4b2U, 0x312a3f23U, 0x30c6a594U, 0xc035a266U, + 0x37744ebcU, 0xa6fc82caU, 0xb0e090d0U, 0x1533a7d8U, + 0x4af10498U, 0xf741ecdaU, 0x0e7fcd50U, 0x2f1791f6U, + 0x8d764dd6U, 0x4d43efb0U, 0x54ccaa4dU, 0xdfe49604U, + 0xe39ed1b5U, 0x1b4c6a88U, 0xb8c12c1fU, 0x7f466551U, + 0x049d5eeaU, 0x5d018c35U, 0x73fa8774U, 0x2efb0b41U, + 0x5ab3671dU, 0x5292dbd2U, 0x33e91056U, 0x136dd647U, + 0x8c9ad761U, 0x7a37a10cU, 0x8e59f814U, 0x89eb133cU, + 0xeecea927U, 0x35b761c9U, 0xede11ce5U, 0x3c7a47b1U, + 0x599cd2dfU, 0x3f55f273U, 0x791814ceU, 0xbf73c737U, + 0xea53f7cdU, 0x5b5ffdaaU, 0x14df3d6fU, 0x867844dbU, + 0x81caaff3U, 0x3eb968c4U, 0x2c382434U, 0x5fc2a340U, + 0x72161dc3U, 0x0cbce225U, 0x8b283c49U, 0x41ff0d95U, + 0x7139a801U, 0xde080cb3U, 0x9cd8b4e4U, 0x906456c1U, + 0x617bcb84U, 0x70d532b6U, 0x74486c5cU, 0x42d0b857U, +}; + +static const u32 Td2[256] = +{ + 0xa75051f4U, 0x65537e41U, 0xa4c31a17U, 0x5e963a27U, + 0x6bcb3babU, 0x45f11f9dU, 0x58abacfaU, 0x03934be3U, + 0xfa552030U, 0x6df6ad76U, 0x769188ccU, 0x4c25f502U, + 0xd7fc4fe5U, 0xcbd7c52aU, 0x44802635U, 0xa38fb562U, + 0x5a49deb1U, 0x1b6725baU, 0x0e9845eaU, 0xc0e15dfeU, + 0x7502c32fU, 0xf012814cU, 0x97a38d46U, 0xf9c66bd3U, + 0x5fe7038fU, 0x9c951592U, 0x7aebbf6dU, 0x59da9552U, + 0x832dd4beU, 0x21d35874U, 0x692949e0U, 0xc8448ec9U, + 0x896a75c2U, 0x7978f48eU, 0x3e6b9958U, 0x71dd27b9U, + 0x4fb6bee1U, 0xad17f088U, 0xac66c920U, 0x3ab47dceU, + 0x4a1863dfU, 0x3182e51aU, 0x33609751U, 0x7f456253U, + 0x77e0b164U, 0xae84bb6bU, 0xa01cfe81U, 0x2b94f908U, + 0x68587048U, 0xfd198f45U, 0x6c8794deU, 0xf8b7527bU, + 0xd323ab73U, 0x02e2724bU, 0x8f57e31fU, 0xab2a6655U, + 0x2807b2ebU, 0xc2032fb5U, 0x7b9a86c5U, 0x08a5d337U, + 0x87f23028U, 0xa5b223bfU, 0x6aba0203U, 0x825ced16U, + 0x1c2b8acfU, 0xb492a779U, 0xf2f0f307U, 0xe2a14e69U, + 0xf4cd65daU, 0xbed50605U, 0x621fd134U, 0xfe8ac4a6U, + 0x539d342eU, 0x55a0a2f3U, 0xe132058aU, 0xeb75a4f6U, + 0xec390b83U, 0xefaa4060U, 0x9f065e71U, 0x1051bd6eU, + 0x8af93e21U, 0x063d96ddU, 0x05aedd3eU, 0xbd464de6U, + 0x8db59154U, 0x5d0571c4U, 0xd46f0406U, 0x15ff6050U, + 0xfb241998U, 0xe997d6bdU, 0x43cc8940U, 0x9e7767d9U, + 0x42bdb0e8U, 0x8b880789U, 0x5b38e719U, 0xeedb79c8U, + 0x0a47a17cU, 0x0fe97c42U, 0x1ec9f884U, 0x00000000U, + 0x86830980U, 0xed48322bU, 0x70ac1e11U, 0x724e6c5aU, + 0xfffbfd0eU, 0x38560f85U, 0xd51e3daeU, 0x3927362dU, + 0xd9640a0fU, 0xa621685cU, 0x54d19b5bU, 0x2e3a2436U, + 0x67b10c0aU, 0xe70f9357U, 0x96d2b4eeU, 0x919e1b9bU, + 0xc54f80c0U, 0x20a261dcU, 0x4b695a77U, 0x1a161c12U, + 0xba0ae293U, 0x2ae5c0a0U, 0xe0433c22U, 0x171d121bU, + 0x0d0b0e09U, 0xc7adf28bU, 0xa8b92db6U, 0xa9c8141eU, + 0x198557f1U, 0x074caf75U, 0xddbbee99U, 0x60fda37fU, + 0x269ff701U, 0xf5bc5c72U, 0x3bc54466U, 0x7e345bfbU, + 0x29768b43U, 0xc6dccb23U, 0xfc68b6edU, 0xf163b8e4U, + 0xdccad731U, 0x85104263U, 0x22401397U, 0x112084c6U, + 0x247d854aU, 0x3df8d2bbU, 0x3211aef9U, 0xa16dc729U, + 0x2f4b1d9eU, 0x30f3dcb2U, 0x52ec0d86U, 0xe3d077c1U, + 0x166c2bb3U, 0xb999a970U, 0x48fa1194U, 0x642247e9U, + 0x8cc4a8fcU, 0x3f1aa0f0U, 0x2cd8567dU, 0x90ef2233U, + 0x4ec78749U, 0xd1c1d938U, 0xa2fe8ccaU, 0x0b3698d4U, + 0x81cfa6f5U, 0xde28a57aU, 0x8e26dab7U, 0xbfa43fadU, + 0x9de42c3aU, 0x920d5078U, 0xcc9b6a5fU, 0x4662547eU, + 0x13c2f68dU, 0xb8e890d8U, 0xf75e2e39U, 0xaff582c3U, + 0x80be9f5dU, 0x937c69d0U, 0x2da96fd5U, 0x12b3cf25U, + 0x993bc8acU, 0x7da71018U, 0x636ee89cU, 0xbb7bdb3bU, + 0x7809cd26U, 0x18f46e59U, 0xb701ec9aU, 0x9aa8834fU, + 0x6e65e695U, 0xe67eaaffU, 0xcf0821bcU, 0xe8e6ef15U, + 0x9bd9bae7U, 0x36ce4a6fU, 0x09d4ea9fU, 0x7cd629b0U, + 0xb2af31a4U, 0x23312a3fU, 0x9430c6a5U, 0x66c035a2U, + 0xbc37744eU, 0xcaa6fc82U, 0xd0b0e090U, 0xd81533a7U, + 0x984af104U, 0xdaf741ecU, 0x500e7fcdU, 0xf62f1791U, + 0xd68d764dU, 0xb04d43efU, 0x4d54ccaaU, 0x04dfe496U, + 0xb5e39ed1U, 0x881b4c6aU, 0x1fb8c12cU, 0x517f4665U, + 0xea049d5eU, 0x355d018cU, 0x7473fa87U, 0x412efb0bU, + 0x1d5ab367U, 0xd25292dbU, 0x5633e910U, 0x47136dd6U, + 0x618c9ad7U, 0x0c7a37a1U, 0x148e59f8U, 0x3c89eb13U, + 0x27eecea9U, 0xc935b761U, 0xe5ede11cU, 0xb13c7a47U, + 0xdf599cd2U, 0x733f55f2U, 0xce791814U, 0x37bf73c7U, + 0xcdea53f7U, 0xaa5b5ffdU, 0x6f14df3dU, 0xdb867844U, + 0xf381caafU, 0xc43eb968U, 0x342c3824U, 0x405fc2a3U, + 0xc372161dU, 0x250cbce2U, 0x498b283cU, 0x9541ff0dU, + 0x017139a8U, 0xb3de080cU, 0xe49cd8b4U, 0xc1906456U, + 0x84617bcbU, 0xb670d532U, 0x5c74486cU, 0x5742d0b8U, +}; + +static const u32 Td3[256] = +{ + 0xf4a75051U, 0x4165537eU, 0x17a4c31aU, 0x275e963aU, + 0xab6bcb3bU, 0x9d45f11fU, 0xfa58abacU, 0xe303934bU, + 0x30fa5520U, 0x766df6adU, 0xcc769188U, 0x024c25f5U, + 0xe5d7fc4fU, 0x2acbd7c5U, 0x35448026U, 0x62a38fb5U, + 0xb15a49deU, 0xba1b6725U, 0xea0e9845U, 0xfec0e15dU, + 0x2f7502c3U, 0x4cf01281U, 0x4697a38dU, 0xd3f9c66bU, + 0x8f5fe703U, 0x929c9515U, 0x6d7aebbfU, 0x5259da95U, + 0xbe832dd4U, 0x7421d358U, 0xe0692949U, 0xc9c8448eU, + 0xc2896a75U, 0x8e7978f4U, 0x583e6b99U, 0xb971dd27U, + 0xe14fb6beU, 0x88ad17f0U, 0x20ac66c9U, 0xce3ab47dU, + 0xdf4a1863U, 0x1a3182e5U, 0x51336097U, 0x537f4562U, + 0x6477e0b1U, 0x6bae84bbU, 0x81a01cfeU, 0x082b94f9U, + 0x48685870U, 0x45fd198fU, 0xde6c8794U, 0x7bf8b752U, + 0x73d323abU, 0x4b02e272U, 0x1f8f57e3U, 0x55ab2a66U, + 0xeb2807b2U, 0xb5c2032fU, 0xc57b9a86U, 0x3708a5d3U, + 0x2887f230U, 0xbfa5b223U, 0x036aba02U, 0x16825cedU, + 0xcf1c2b8aU, 0x79b492a7U, 0x07f2f0f3U, 0x69e2a14eU, + 0xdaf4cd65U, 0x05bed506U, 0x34621fd1U, 0xa6fe8ac4U, + 0x2e539d34U, 0xf355a0a2U, 0x8ae13205U, 0xf6eb75a4U, + 0x83ec390bU, 0x60efaa40U, 0x719f065eU, 0x6e1051bdU, + 0x218af93eU, 0xdd063d96U, 0x3e05aeddU, 0xe6bd464dU, + 0x548db591U, 0xc45d0571U, 0x06d46f04U, 0x5015ff60U, + 0x98fb2419U, 0xbde997d6U, 0x4043cc89U, 0xd99e7767U, + 0xe842bdb0U, 0x898b8807U, 0x195b38e7U, 0xc8eedb79U, + 0x7c0a47a1U, 0x420fe97cU, 0x841ec9f8U, 0x00000000U, + 0x80868309U, 0x2bed4832U, 0x1170ac1eU, 0x5a724e6cU, + 0x0efffbfdU, 0x8538560fU, 0xaed51e3dU, 0x2d392736U, + 0x0fd9640aU, 0x5ca62168U, 0x5b54d19bU, 0x362e3a24U, + 0x0a67b10cU, 0x57e70f93U, 0xee96d2b4U, 0x9b919e1bU, + 0xc0c54f80U, 0xdc20a261U, 0x774b695aU, 0x121a161cU, + 0x93ba0ae2U, 0xa02ae5c0U, 0x22e0433cU, 0x1b171d12U, + 0x090d0b0eU, 0x8bc7adf2U, 0xb6a8b92dU, 0x1ea9c814U, + 0xf1198557U, 0x75074cafU, 0x99ddbbeeU, 0x7f60fda3U, + 0x01269ff7U, 0x72f5bc5cU, 0x663bc544U, 0xfb7e345bU, + 0x4329768bU, 0x23c6dccbU, 0xedfc68b6U, 0xe4f163b8U, + 0x31dccad7U, 0x63851042U, 0x97224013U, 0xc6112084U, + 0x4a247d85U, 0xbb3df8d2U, 0xf93211aeU, 0x29a16dc7U, + 0x9e2f4b1dU, 0xb230f3dcU, 0x8652ec0dU, 0xc1e3d077U, + 0xb3166c2bU, 0x70b999a9U, 0x9448fa11U, 0xe9642247U, + 0xfc8cc4a8U, 0xf03f1aa0U, 0x7d2cd856U, 0x3390ef22U, + 0x494ec787U, 0x38d1c1d9U, 0xcaa2fe8cU, 0xd40b3698U, + 0xf581cfa6U, 0x7ade28a5U, 0xb78e26daU, 0xadbfa43fU, + 0x3a9de42cU, 0x78920d50U, 0x5fcc9b6aU, 0x7e466254U, + 0x8d13c2f6U, 0xd8b8e890U, 0x39f75e2eU, 0xc3aff582U, + 0x5d80be9fU, 0xd0937c69U, 0xd52da96fU, 0x2512b3cfU, + 0xac993bc8U, 0x187da710U, 0x9c636ee8U, 0x3bbb7bdbU, + 0x267809cdU, 0x5918f46eU, 0x9ab701ecU, 0x4f9aa883U, + 0x956e65e6U, 0xffe67eaaU, 0xbccf0821U, 0x15e8e6efU, + 0xe79bd9baU, 0x6f36ce4aU, 0x9f09d4eaU, 0xb07cd629U, + 0xa4b2af31U, 0x3f23312aU, 0xa59430c6U, 0xa266c035U, + 0x4ebc3774U, 0x82caa6fcU, 0x90d0b0e0U, 0xa7d81533U, + 0x04984af1U, 0xecdaf741U, 0xcd500e7fU, 0x91f62f17U, + 0x4dd68d76U, 0xefb04d43U, 0xaa4d54ccU, 0x9604dfe4U, + 0xd1b5e39eU, 0x6a881b4cU, 0x2c1fb8c1U, 0x65517f46U, + 0x5eea049dU, 0x8c355d01U, 0x877473faU, 0x0b412efbU, + 0x671d5ab3U, 0xdbd25292U, 0x105633e9U, 0xd647136dU, + 0xd7618c9aU, 0xa10c7a37U, 0xf8148e59U, 0x133c89ebU, + 0xa927eeceU, 0x61c935b7U, 0x1ce5ede1U, 0x47b13c7aU, + 0xd2df599cU, 0xf2733f55U, 0x14ce7918U, 0xc737bf73U, + 0xf7cdea53U, 0xfdaa5b5fU, 0x3d6f14dfU, 0x44db8678U, + 0xaff381caU, 0x68c43eb9U, 0x24342c38U, 0xa3405fc2U, + 0x1dc37216U, 0xe2250cbcU, 0x3c498b28U, 0x0d9541ffU, + 0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U, + 0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U, +}; + +static const u32 Td4[256] = +{ + 0x52525252U, 0x09090909U, 0x6a6a6a6aU, 0xd5d5d5d5U, + 0x30303030U, 0x36363636U, 0xa5a5a5a5U, 0x38383838U, + 0xbfbfbfbfU, 0x40404040U, 0xa3a3a3a3U, 0x9e9e9e9eU, + 0x81818181U, 0xf3f3f3f3U, 0xd7d7d7d7U, 0xfbfbfbfbU, + 0x7c7c7c7cU, 0xe3e3e3e3U, 0x39393939U, 0x82828282U, + 0x9b9b9b9bU, 0x2f2f2f2fU, 0xffffffffU, 0x87878787U, + 0x34343434U, 0x8e8e8e8eU, 0x43434343U, 0x44444444U, + 0xc4c4c4c4U, 0xdedededeU, 0xe9e9e9e9U, 0xcbcbcbcbU, + 0x54545454U, 0x7b7b7b7bU, 0x94949494U, 0x32323232U, + 0xa6a6a6a6U, 0xc2c2c2c2U, 0x23232323U, 0x3d3d3d3dU, + 0xeeeeeeeeU, 0x4c4c4c4cU, 0x95959595U, 0x0b0b0b0bU, + 0x42424242U, 0xfafafafaU, 0xc3c3c3c3U, 0x4e4e4e4eU, + 0x08080808U, 0x2e2e2e2eU, 0xa1a1a1a1U, 0x66666666U, + 0x28282828U, 0xd9d9d9d9U, 0x24242424U, 0xb2b2b2b2U, + 0x76767676U, 0x5b5b5b5bU, 0xa2a2a2a2U, 0x49494949U, + 0x6d6d6d6dU, 0x8b8b8b8bU, 0xd1d1d1d1U, 0x25252525U, + 0x72727272U, 0xf8f8f8f8U, 0xf6f6f6f6U, 0x64646464U, + 0x86868686U, 0x68686868U, 0x98989898U, 0x16161616U, + 0xd4d4d4d4U, 0xa4a4a4a4U, 0x5c5c5c5cU, 0xccccccccU, + 0x5d5d5d5dU, 0x65656565U, 0xb6b6b6b6U, 0x92929292U, + 0x6c6c6c6cU, 0x70707070U, 0x48484848U, 0x50505050U, + 0xfdfdfdfdU, 0xededededU, 0xb9b9b9b9U, 0xdadadadaU, + 0x5e5e5e5eU, 0x15151515U, 0x46464646U, 0x57575757U, + 0xa7a7a7a7U, 0x8d8d8d8dU, 0x9d9d9d9dU, 0x84848484U, + 0x90909090U, 0xd8d8d8d8U, 0xababababU, 0x00000000U, + 0x8c8c8c8cU, 0xbcbcbcbcU, 0xd3d3d3d3U, 0x0a0a0a0aU, + 0xf7f7f7f7U, 0xe4e4e4e4U, 0x58585858U, 0x05050505U, + 0xb8b8b8b8U, 0xb3b3b3b3U, 0x45454545U, 0x06060606U, + 0xd0d0d0d0U, 0x2c2c2c2cU, 0x1e1e1e1eU, 0x8f8f8f8fU, + 0xcacacacaU, 0x3f3f3f3fU, 0x0f0f0f0fU, 0x02020202U, + 0xc1c1c1c1U, 0xafafafafU, 0xbdbdbdbdU, 0x03030303U, + 0x01010101U, 0x13131313U, 0x8a8a8a8aU, 0x6b6b6b6bU, + 0x3a3a3a3aU, 0x91919191U, 0x11111111U, 0x41414141U, + 0x4f4f4f4fU, 0x67676767U, 0xdcdcdcdcU, 0xeaeaeaeaU, + 0x97979797U, 0xf2f2f2f2U, 0xcfcfcfcfU, 0xcecececeU, + 0xf0f0f0f0U, 0xb4b4b4b4U, 0xe6e6e6e6U, 0x73737373U, + 0x96969696U, 0xacacacacU, 0x74747474U, 0x22222222U, + 0xe7e7e7e7U, 0xadadadadU, 0x35353535U, 0x85858585U, + 0xe2e2e2e2U, 0xf9f9f9f9U, 0x37373737U, 0xe8e8e8e8U, + 0x1c1c1c1cU, 0x75757575U, 0xdfdfdfdfU, 0x6e6e6e6eU, + 0x47474747U, 0xf1f1f1f1U, 0x1a1a1a1aU, 0x71717171U, + 0x1d1d1d1dU, 0x29292929U, 0xc5c5c5c5U, 0x89898989U, + 0x6f6f6f6fU, 0xb7b7b7b7U, 0x62626262U, 0x0e0e0e0eU, + 0xaaaaaaaaU, 0x18181818U, 0xbebebebeU, 0x1b1b1b1bU, + 0xfcfcfcfcU, 0x56565656U, 0x3e3e3e3eU, 0x4b4b4b4bU, + 0xc6c6c6c6U, 0xd2d2d2d2U, 0x79797979U, 0x20202020U, + 0x9a9a9a9aU, 0xdbdbdbdbU, 0xc0c0c0c0U, 0xfefefefeU, + 0x78787878U, 0xcdcdcdcdU, 0x5a5a5a5aU, 0xf4f4f4f4U, + 0x1f1f1f1fU, 0xddddddddU, 0xa8a8a8a8U, 0x33333333U, + 0x88888888U, 0x07070707U, 0xc7c7c7c7U, 0x31313131U, + 0xb1b1b1b1U, 0x12121212U, 0x10101010U, 0x59595959U, + 0x27272727U, 0x80808080U, 0xececececU, 0x5f5f5f5fU, + 0x60606060U, 0x51515151U, 0x7f7f7f7fU, 0xa9a9a9a9U, + 0x19191919U, 0xb5b5b5b5U, 0x4a4a4a4aU, 0x0d0d0d0dU, + 0x2d2d2d2dU, 0xe5e5e5e5U, 0x7a7a7a7aU, 0x9f9f9f9fU, + 0x93939393U, 0xc9c9c9c9U, 0x9c9c9c9cU, 0xefefefefU, + 0xa0a0a0a0U, 0xe0e0e0e0U, 0x3b3b3b3bU, 0x4d4d4d4dU, + 0xaeaeaeaeU, 0x2a2a2a2aU, 0xf5f5f5f5U, 0xb0b0b0b0U, + 0xc8c8c8c8U, 0xebebebebU, 0xbbbbbbbbU, 0x3c3c3c3cU, + 0x83838383U, 0x53535353U, 0x99999999U, 0x61616161U, + 0x17171717U, 0x2b2b2b2bU, 0x04040404U, 0x7e7e7e7eU, + 0xbabababaU, 0x77777777U, 0xd6d6d6d6U, 0x26262626U, + 0xe1e1e1e1U, 0x69696969U, 0x14141414U, 0x63636363U, + 0x55555555U, 0x21212121U, 0x0c0c0c0cU, 0x7d7d7d7dU, +}; + +static const u32 rcon[] = +{ + 0x01000000, 0x02000000, 0x04000000, 0x08000000, + 0x10000000, 0x20000000, 0x40000000, 0x80000000, + 0x1B000000, 0x36000000, + /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */ +}; + +#define GETU32(plaintext) (((u32)(plaintext)[0] << 24) ^ \ + ((u32)(plaintext)[1] << 16) ^ \ + ((u32)(plaintext)[2] << 8) ^ \ + ((u32)(plaintext)[3])) + +#define PUTU32(ciphertext, st) { (ciphertext)[0] = (u8)((st) >> 24); \ + (ciphertext)[1] = (u8)((st) >> 16); \ + (ciphertext)[2] = (u8)((st) >> 8); \ + (ciphertext)[3] = (u8)(st); } + +/** + * Expand the cipher key into the encryption key schedule. + * + * @return the number of rounds for the given cipher key size. + */ +int rijndaelSetupEncrypt(u32 *rk, const u8 *key, int keybits) +{ + int i = 0; + u32 temp; + + rk[0] = GETU32(key ); + rk[1] = GETU32(key + 4); + rk[2] = GETU32(key + 8); + rk[3] = GETU32(key + 12); + if (keybits == 128) + { + for (;;) + { + temp = rk[3]; + rk[4] = rk[0] ^ + (Te4[(temp >> 16) & 0xff] & 0xff000000) ^ + (Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^ + (Te4[(temp ) & 0xff] & 0x0000ff00) ^ + (Te4[(temp >> 24) ] & 0x000000ff) ^ + rcon[i]; + rk[5] = rk[1] ^ rk[4]; + rk[6] = rk[2] ^ rk[5]; + rk[7] = rk[3] ^ rk[6]; + if (++i == 10) + return 10; + rk += 4; + } + } + rk[4] = GETU32(key + 16); + rk[5] = GETU32(key + 20); + if (keybits == 192) + { + for (;;) + { + temp = rk[ 5]; + rk[ 6] = rk[ 0] ^ + (Te4[(temp >> 16) & 0xff] & 0xff000000) ^ + (Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^ + (Te4[(temp ) & 0xff] & 0x0000ff00) ^ + (Te4[(temp >> 24) ] & 0x000000ff) ^ + rcon[i]; + rk[ 7] = rk[ 1] ^ rk[ 6]; + rk[ 8] = rk[ 2] ^ rk[ 7]; + rk[ 9] = rk[ 3] ^ rk[ 8]; + if (++i == 8) + return 12; + rk[10] = rk[ 4] ^ rk[ 9]; + rk[11] = rk[ 5] ^ rk[10]; + rk += 6; + } + } + rk[6] = GETU32(key + 24); + rk[7] = GETU32(key + 28); + if (keybits == 256) + { + for (;;) + { + temp = rk[ 7]; + rk[ 8] = rk[ 0] ^ + (Te4[(temp >> 16) & 0xff] & 0xff000000) ^ + (Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^ + (Te4[(temp ) & 0xff] & 0x0000ff00) ^ + (Te4[(temp >> 24) ] & 0x000000ff) ^ + rcon[i]; + rk[ 9] = rk[ 1] ^ rk[ 8]; + rk[10] = rk[ 2] ^ rk[ 9]; + rk[11] = rk[ 3] ^ rk[10]; + if (++i == 7) + return 14; + temp = rk[11]; + rk[12] = rk[ 4] ^ + (Te4[(temp >> 24) ] & 0xff000000) ^ + (Te4[(temp >> 16) & 0xff] & 0x00ff0000) ^ + (Te4[(temp >> 8) & 0xff] & 0x0000ff00) ^ + (Te4[(temp ) & 0xff] & 0x000000ff); + rk[13] = rk[ 5] ^ rk[12]; + rk[14] = rk[ 6] ^ rk[13]; + rk[15] = rk[ 7] ^ rk[14]; + rk += 8; + } + } + return 0; +} + +/** + * Expand the cipher key into the decryption key schedule. + * + * @return the number of rounds for the given cipher key size. + */ +int rijndaelSetupDecrypt(u32 *rk, const u8 *key, int keybits) +{ + int nrounds, i, j; + u32 temp; + + /* expand the cipher key: */ + nrounds = rijndaelSetupEncrypt(rk, key, keybits); + /* invert the order of the round keys: */ + for (i = 0, j = 4*nrounds; i < j; i += 4, j -= 4) + { + temp = rk[i ]; rk[i ] = rk[j ]; rk[j ] = temp; + temp = rk[i + 1]; rk[i + 1] = rk[j + 1]; rk[j + 1] = temp; + temp = rk[i + 2]; rk[i + 2] = rk[j + 2]; rk[j + 2] = temp; + temp = rk[i + 3]; rk[i + 3] = rk[j + 3]; rk[j + 3] = temp; + } + /* apply the inverse MixColumn transform to all round keys but the first and the last: */ + for (i = 1; i < nrounds; i++) + { + rk += 4; + rk[0] = + Td0[Te4[(rk[0] >> 24) ] & 0xff] ^ + Td1[Te4[(rk[0] >> 16) & 0xff] & 0xff] ^ + Td2[Te4[(rk[0] >> 8) & 0xff] & 0xff] ^ + Td3[Te4[(rk[0] ) & 0xff] & 0xff]; + rk[1] = + Td0[Te4[(rk[1] >> 24) ] & 0xff] ^ + Td1[Te4[(rk[1] >> 16) & 0xff] & 0xff] ^ + Td2[Te4[(rk[1] >> 8) & 0xff] & 0xff] ^ + Td3[Te4[(rk[1] ) & 0xff] & 0xff]; + rk[2] = + Td0[Te4[(rk[2] >> 24) ] & 0xff] ^ + Td1[Te4[(rk[2] >> 16) & 0xff] & 0xff] ^ + Td2[Te4[(rk[2] >> 8) & 0xff] & 0xff] ^ + Td3[Te4[(rk[2] ) & 0xff] & 0xff]; + rk[3] = + Td0[Te4[(rk[3] >> 24) ] & 0xff] ^ + Td1[Te4[(rk[3] >> 16) & 0xff] & 0xff] ^ + Td2[Te4[(rk[3] >> 8) & 0xff] & 0xff] ^ + Td3[Te4[(rk[3] ) & 0xff] & 0xff]; + } + return nrounds; +} + +void rijndaelEncrypt(const u32 *rk, int nrounds, const u8 plaintext[16], + u8 ciphertext[16]) +{ + u32 s0, s1, s2, s3, t0, t1, t2, t3; + #ifndef FULL_UNROLL + int r; + #endif /* ?FULL_UNROLL */ + /* + * map byte array block to cipher state + * and add initial round key: + */ + s0 = GETU32(plaintext ) ^ rk[0]; + s1 = GETU32(plaintext + 4) ^ rk[1]; + s2 = GETU32(plaintext + 8) ^ rk[2]; + s3 = GETU32(plaintext + 12) ^ rk[3]; + #ifdef FULL_UNROLL + /* round 1: */ + t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[ 4]; + t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[ 5]; + t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[ 6]; + t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[ 7]; + /* round 2: */ + s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[ 8]; + s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[ 9]; + s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[10]; + s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[11]; + /* round 3: */ + t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[12]; + t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[13]; + t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[14]; + t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[15]; + /* round 4: */ + s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[16]; + s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[17]; + s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[18]; + s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[19]; + /* round 5: */ + t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[20]; + t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[21]; + t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[22]; + t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[23]; + /* round 6: */ + s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[24]; + s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[25]; + s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[26]; + s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[27]; + /* round 7: */ + t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[28]; + t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[29]; + t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[30]; + t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[31]; + /* round 8: */ + s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[32]; + s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[33]; + s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[34]; + s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[35]; + /* round 9: */ + t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[36]; + t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[37]; + t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[38]; + t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[39]; + if (nrounds > 10) + { + /* round 10: */ + s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[40]; + s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[41]; + s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[42]; + s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[43]; + /* round 11: */ + t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[44]; + t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[45]; + t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[46]; + t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[47]; + if (nrounds > 12) + { + /* round 12: */ + s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[48]; + s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[49]; + s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[50]; + s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[51]; + /* round 13: */ + t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[52]; + t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[53]; + t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[54]; + t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[55]; + } + } + rk += nrounds << 2; + #else /* !FULL_UNROLL */ + /* + * nrounds - 1 full rounds: + */ + r = nrounds >> 1; + for (;;) + { + t0 = + Te0[(s0 >> 24) ] ^ + Te1[(s1 >> 16) & 0xff] ^ + Te2[(s2 >> 8) & 0xff] ^ + Te3[(s3 ) & 0xff] ^ + rk[4]; + t1 = + Te0[(s1 >> 24) ] ^ + Te1[(s2 >> 16) & 0xff] ^ + Te2[(s3 >> 8) & 0xff] ^ + Te3[(s0 ) & 0xff] ^ + rk[5]; + t2 = + Te0[(s2 >> 24) ] ^ + Te1[(s3 >> 16) & 0xff] ^ + Te2[(s0 >> 8) & 0xff] ^ + Te3[(s1 ) & 0xff] ^ + rk[6]; + t3 = + Te0[(s3 >> 24) ] ^ + Te1[(s0 >> 16) & 0xff] ^ + Te2[(s1 >> 8) & 0xff] ^ + Te3[(s2 ) & 0xff] ^ + rk[7]; + rk += 8; + if (--r == 0) + break; + s0 = + Te0[(t0 >> 24) ] ^ + Te1[(t1 >> 16) & 0xff] ^ + Te2[(t2 >> 8) & 0xff] ^ + Te3[(t3 ) & 0xff] ^ + rk[0]; + s1 = + Te0[(t1 >> 24) ] ^ + Te1[(t2 >> 16) & 0xff] ^ + Te2[(t3 >> 8) & 0xff] ^ + Te3[(t0 ) & 0xff] ^ + rk[1]; + s2 = + Te0[(t2 >> 24) ] ^ + Te1[(t3 >> 16) & 0xff] ^ + Te2[(t0 >> 8) & 0xff] ^ + Te3[(t1 ) & 0xff] ^ + rk[2]; + s3 = + Te0[(t3 >> 24) ] ^ + Te1[(t0 >> 16) & 0xff] ^ + Te2[(t1 >> 8) & 0xff] ^ + Te3[(t2 ) & 0xff] ^ + rk[3]; + } + #endif /* ?FULL_UNROLL */ + /* + * apply last round and + * map cipher state to byte array block: + */ + s0 = + (Te4[(t0 >> 24) ] & 0xff000000) ^ + (Te4[(t1 >> 16) & 0xff] & 0x00ff0000) ^ + (Te4[(t2 >> 8) & 0xff] & 0x0000ff00) ^ + (Te4[(t3 ) & 0xff] & 0x000000ff) ^ + rk[0]; + PUTU32(ciphertext , s0); + s1 = + (Te4[(t1 >> 24) ] & 0xff000000) ^ + (Te4[(t2 >> 16) & 0xff] & 0x00ff0000) ^ + (Te4[(t3 >> 8) & 0xff] & 0x0000ff00) ^ + (Te4[(t0 ) & 0xff] & 0x000000ff) ^ + rk[1]; + PUTU32(ciphertext + 4, s1); + s2 = + (Te4[(t2 >> 24) ] & 0xff000000) ^ + (Te4[(t3 >> 16) & 0xff] & 0x00ff0000) ^ + (Te4[(t0 >> 8) & 0xff] & 0x0000ff00) ^ + (Te4[(t1 ) & 0xff] & 0x000000ff) ^ + rk[2]; + PUTU32(ciphertext + 8, s2); + s3 = + (Te4[(t3 >> 24) ] & 0xff000000) ^ + (Te4[(t0 >> 16) & 0xff] & 0x00ff0000) ^ + (Te4[(t1 >> 8) & 0xff] & 0x0000ff00) ^ + (Te4[(t2 ) & 0xff] & 0x000000ff) ^ + rk[3]; + PUTU32(ciphertext + 12, s3); +} + +void rijndaelDecrypt(const u32 *rk, int nrounds, const u8 ciphertext[16], + u8 plaintext[16]) +{ + u32 s0, s1, s2, s3, t0, t1, t2, t3; + #ifndef FULL_UNROLL + int r; + #endif /* ?FULL_UNROLL */ + + /* + * map byte array block to cipher state + * and add initial round key: + */ + s0 = GETU32(ciphertext ) ^ rk[0]; + s1 = GETU32(ciphertext + 4) ^ rk[1]; + s2 = GETU32(ciphertext + 8) ^ rk[2]; + s3 = GETU32(ciphertext + 12) ^ rk[3]; + #ifdef FULL_UNROLL + /* round 1: */ + t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[ 4]; + t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[ 5]; + t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[ 6]; + t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[ 7]; + /* round 2: */ + s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[ 8]; + s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[ 9]; + s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[10]; + s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[11]; + /* round 3: */ + t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[12]; + t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[13]; + t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[14]; + t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[15]; + /* round 4: */ + s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[16]; + s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[17]; + s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[18]; + s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[19]; + /* round 5: */ + t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[20]; + t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[21]; + t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[22]; + t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[23]; + /* round 6: */ + s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[24]; + s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[25]; + s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[26]; + s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[27]; + /* round 7: */ + t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[28]; + t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[29]; + t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[30]; + t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[31]; + /* round 8: */ + s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[32]; + s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[33]; + s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[34]; + s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[35]; + /* round 9: */ + t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[36]; + t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[37]; + t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[38]; + t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[39]; + if (nrounds > 10) + { + /* round 10: */ + s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[40]; + s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[41]; + s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[42]; + s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[43]; + /* round 11: */ + t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[44]; + t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[45]; + t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[46]; + t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[47]; + if (nrounds > 12) + { + /* round 12: */ + s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[48]; + s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[49]; + s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[50]; + s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[51]; + /* round 13: */ + t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[52]; + t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[53]; + t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[54]; + t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[55]; + } + } + rk += nrounds << 2; + #else /* !FULL_UNROLL */ + /* + * nrounds - 1 full rounds: + */ + r = nrounds >> 1; + for (;;) + { + t0 = + Td0[(s0 >> 24) ] ^ + Td1[(s3 >> 16) & 0xff] ^ + Td2[(s2 >> 8) & 0xff] ^ + Td3[(s1 ) & 0xff] ^ + rk[4]; + t1 = + Td0[(s1 >> 24) ] ^ + Td1[(s0 >> 16) & 0xff] ^ + Td2[(s3 >> 8) & 0xff] ^ + Td3[(s2 ) & 0xff] ^ + rk[5]; + t2 = + Td0[(s2 >> 24) ] ^ + Td1[(s1 >> 16) & 0xff] ^ + Td2[(s0 >> 8) & 0xff] ^ + Td3[(s3 ) & 0xff] ^ + rk[6]; + t3 = + Td0[(s3 >> 24) ] ^ + Td1[(s2 >> 16) & 0xff] ^ + Td2[(s1 >> 8) & 0xff] ^ + Td3[(s0 ) & 0xff] ^ + rk[7]; + rk += 8; + if (--r == 0) + break; + s0 = + Td0[(t0 >> 24) ] ^ + Td1[(t3 >> 16) & 0xff] ^ + Td2[(t2 >> 8) & 0xff] ^ + Td3[(t1 ) & 0xff] ^ + rk[0]; + s1 = + Td0[(t1 >> 24) ] ^ + Td1[(t0 >> 16) & 0xff] ^ + Td2[(t3 >> 8) & 0xff] ^ + Td3[(t2 ) & 0xff] ^ + rk[1]; + s2 = + Td0[(t2 >> 24) ] ^ + Td1[(t1 >> 16) & 0xff] ^ + Td2[(t0 >> 8) & 0xff] ^ + Td3[(t3 ) & 0xff] ^ + rk[2]; + s3 = + Td0[(t3 >> 24) ] ^ + Td1[(t2 >> 16) & 0xff] ^ + Td2[(t1 >> 8) & 0xff] ^ + Td3[(t0 ) & 0xff] ^ + rk[3]; + } + #endif /* ?FULL_UNROLL */ + /* + * apply last round and + * map cipher state to byte array block: + */ + s0 = + (Td4[(t0 >> 24) ] & 0xff000000) ^ + (Td4[(t3 >> 16) & 0xff] & 0x00ff0000) ^ + (Td4[(t2 >> 8) & 0xff] & 0x0000ff00) ^ + (Td4[(t1 ) & 0xff] & 0x000000ff) ^ + rk[0]; + PUTU32(plaintext , s0); + s1 = + (Td4[(t1 >> 24) ] & 0xff000000) ^ + (Td4[(t0 >> 16) & 0xff] & 0x00ff0000) ^ + (Td4[(t3 >> 8) & 0xff] & 0x0000ff00) ^ + (Td4[(t2 ) & 0xff] & 0x000000ff) ^ + rk[1]; + PUTU32(plaintext + 4, s1); + s2 = + (Td4[(t2 >> 24) ] & 0xff000000) ^ + (Td4[(t1 >> 16) & 0xff] & 0x00ff0000) ^ + (Td4[(t0 >> 8) & 0xff] & 0x0000ff00) ^ + (Td4[(t3 ) & 0xff] & 0x000000ff) ^ + rk[2]; + PUTU32(plaintext + 8, s2); + s3 = + (Td4[(t3 >> 24) ] & 0xff000000) ^ + (Td4[(t2 >> 16) & 0xff] & 0x00ff0000) ^ + (Td4[(t1 >> 8) & 0xff] & 0x0000ff00) ^ + (Td4[(t0 ) & 0xff] & 0x000000ff) ^ + rk[3]; + PUTU32(plaintext + 12, s3); +} diff --git a/libtests/Makefile b/libtests/Makefile new file mode 100644 index 0000000..9089905 --- /dev/null +++ b/libtests/Makefile @@ -0,0 +1 @@ +include ../make/proxy.mk diff --git a/libtests/aes.cc b/libtests/aes.cc new file mode 100644 index 0000000..ad2f0dd --- /dev/null +++ b/libtests/aes.cc @@ -0,0 +1,112 @@ +#include +#include + +#include +#include +#include +#include + +static void usage() +{ + std::cerr << "Usage: aes [+-]cbc { -encrypt | -decrypt }" + << " hex-key infile outfile" << std::endl; + exit(2); +} + +int main(int argc, char* argv[]) +{ + if (argc != 6) + { + usage(); + } + + char* cbc = argv[1]; + char* action = argv[2]; + char* hexkey = argv[3]; + char* infilename = argv[4]; + char* outfilename = argv[5]; + + bool cbc_mode = true; + if (strcmp(cbc, "-cbc") == 0) + { + cbc_mode = false; + } + else if (strcmp(cbc, "+cbc") != 0) + { + usage(); + } + + bool encrypt = true; + if (strcmp(action, "-decrypt") == 0) + { + encrypt = false; + } + else if (strcmp(action, "-encrypt") != 0) + { + usage(); + } + + unsigned int hexkeylen = (unsigned int)strlen(hexkey); + unsigned int keylen = hexkeylen / 2; + if (keylen != Pl_AES_PDF::key_size) + { + std::cerr << "key length must be " << Pl_AES_PDF::key_size + << " bytes" << std::endl; + exit(2); + } + + FILE* infile = fopen(infilename, "rb"); + if (infile == 0) + { + std::cerr << "can't open " << infilename << std::endl; + exit(2); + } + + FILE* outfile = fopen(outfilename, "wb"); + if (outfile == 0) + { + std::cerr << "can't open " << outfilename << std::endl; + exit(2); + } + + unsigned char key[Pl_AES_PDF::key_size]; + for (unsigned int i = 0; i < strlen(hexkey); i += 2) + { + char t[3]; + t[0] = hexkey[i]; + t[1] = hexkey[i + 1]; + t[2] = '\0'; + + long val = strtol(t, 0, 16); + key[i/2] = (unsigned char) val; + } + + Pl_StdioFile* out = new Pl_StdioFile("stdout", outfile); + Pl_AES_PDF* aes = new Pl_AES_PDF("aes_128_cbc", out, encrypt, key); + if (! cbc_mode) + { + aes->disableCBC(); + } + + // 16 < buffer size, buffer_size is not a multiple of 8 for testing + unsigned char buf[83]; + bool done = false; + while (! done) + { + size_t len = fread(buf, 1, sizeof(buf), infile); + if (len <= 0) + { + done = true; + } + else + { + aes->write(buf, len); + } + } + aes->finish(); + delete aes; + delete out; + fclose(infile); + fclose(outfile); + return 0; +} diff --git a/libtests/ascii85.cc b/libtests/ascii85.cc new file mode 100644 index 0000000..7fd7f69 --- /dev/null +++ b/libtests/ascii85.cc @@ -0,0 +1,37 @@ +#include + +#include +#include +#include + +int main() +{ + Pl_StdioFile out("stdout", stdout); + Pl_ASCII85Decoder decode("decode", &out); + + try + { + unsigned char buf[10000]; + bool done = false; + while (! done) + { + size_t len = fread(buf, 1, sizeof(buf), stdin); + if (len <= 0) + { + done = true; + } + else + { + decode.write(buf, len); + } + } + decode.finish(); + } + catch (std::exception& e) + { + std::cerr << e.what() << std::endl; + exit(2); + } + + return 0; +} diff --git a/libtests/bits.cc b/libtests/bits.cc new file mode 100644 index 0000000..7837ac6 --- /dev/null +++ b/libtests/bits.cc @@ -0,0 +1,177 @@ +#include +#include +#include +#include +#include + +// See comments in bits.cc +#define BITS_TESTING 1 +#define BITS_READ 1 +#define BITS_WRITE 1 +#include "../libqpdf/bits.icc" + +static void +print_values(int byte_offset, unsigned int bit_offset, + unsigned int bits_available) +{ + std::cout << "byte offset = " << byte_offset << ", " + << "bit offset = " << bit_offset << ", " + << "bits available = " << bits_available << std::endl; +} + +static void +test_read_bits(unsigned char const* buf, + unsigned char const*& p, unsigned int& bit_offset, + unsigned int& bits_available, int bits_wanted) +{ + unsigned long result = + read_bits(p, bit_offset, bits_available, bits_wanted); + + std::cout << "bits read: " << bits_wanted << ", result = " << result + << std::endl; + print_values(p - buf, bit_offset, bits_available); +} + +static void +test_write_bits(unsigned char& ch, unsigned int& bit_offset, unsigned long val, + int bits, Pl_Buffer* bp) +{ + write_bits(ch, bit_offset, val, bits, bp); + printf("ch = %02x, bit_offset = %d\n", (unsigned int) ch, bit_offset); +} + +static void +print_buffer(Pl_Buffer* bp) +{ + bp->finish(); + Buffer* b = bp->getBuffer(); + unsigned char const* p = b->getBuffer(); + size_t l = b->getSize(); + for (unsigned long i = 0; i < l; ++i) + { + printf("%02x%s", (unsigned int)(p[i]), + (i == l - 1) ? "\n" : " "); + } + printf("\n"); + delete b; +} + +static void +test() +{ + // 11110101 00010101 01100101 01111001 00010010 10001001 01110101 01001011 + // F5 15 65 79 12 89 75 4B + + // Read tests + + static unsigned char const buf[] = { + 0xF5, 0x15, 0x65, 0x79, 0x12, 0x89, 0x75, 0x4B + }; + + unsigned char const* p = buf; + unsigned int bit_offset = 7; + unsigned int bits_available = 64; + + // 11110:101 0:001010:1 01100101: 01111001 + // 0:00:1:0010 10001001 01110101 01001:011 + print_values(p - buf, bit_offset, bits_available); + test_read_bits(buf, p, bit_offset, bits_available, 5); + test_read_bits(buf, p, bit_offset, bits_available, 4); + test_read_bits(buf, p, bit_offset, bits_available, 6); + test_read_bits(buf, p, bit_offset, bits_available, 9); + test_read_bits(buf, p, bit_offset, bits_available, 9); + test_read_bits(buf, p, bit_offset, bits_available, 2); + test_read_bits(buf, p, bit_offset, bits_available, 1); + test_read_bits(buf, p, bit_offset, bits_available, 0); + test_read_bits(buf, p, bit_offset, bits_available, 25); + + try + { + test_read_bits(buf, p, bit_offset, bits_available, 4); + } + catch (std::exception& e) + { + std::cout << "exception: " << e.what() << std::endl; + print_values(p - buf, bit_offset, bits_available); + } + + test_read_bits(buf, p, bit_offset, bits_available, 3); + std::cout << std::endl; + + // 11110101 00010101 01100101 01111001: 00010010 10001001 01110101 01001011 + + p = buf; + bit_offset = 7; + bits_available = 64; + print_values(p - buf, bit_offset, bits_available); + test_read_bits(buf, p, bit_offset, bits_available, 32); + test_read_bits(buf, p, bit_offset, bits_available, 32); + std::cout << std::endl; + + BitStream b(buf, 8); + std::cout << b.getBits(32) << std::endl; + b.reset(); + std::cout << b.getBits(32) << std::endl; + std::cout << b.getBits(32) << std::endl; + std::cout << std::endl; + + b.reset(); + std::cout << b.getBits(6) << std::endl; + b.skipToNextByte(); + std::cout << b.getBits(8) << std::endl; + b.skipToNextByte(); + std::cout << b.getBits(8) << std::endl; + std::cout << std::endl; + + // Write tests + + // 11110:101 0:001010:1 01100101: 01111001 + // 0:00:1:0010 10001001 01110101 01001:011 + + unsigned char ch = 0; + bit_offset = 7; + Pl_Buffer* bp = new Pl_Buffer("buffer"); + + test_write_bits(ch, bit_offset, 30UL, 5, bp); + test_write_bits(ch, bit_offset, 10UL, 4, bp); + test_write_bits(ch, bit_offset, 10UL, 6, bp); + test_write_bits(ch, bit_offset, 16059UL, 0, bp); + test_write_bits(ch, bit_offset, 357UL, 9, bp); + print_buffer(bp); + + test_write_bits(ch, bit_offset, 242UL, 9, bp); + test_write_bits(ch, bit_offset, 0UL, 2, bp); + test_write_bits(ch, bit_offset, 1UL, 1, bp); + test_write_bits(ch, bit_offset, 5320361UL, 25, bp); + test_write_bits(ch, bit_offset, 3UL, 3, bp); + + print_buffer(bp); + test_write_bits(ch, bit_offset, 4111820153UL, 32, bp); + test_write_bits(ch, bit_offset, 310998347UL, 32, bp); + print_buffer(bp); + + BitWriter bw(bp); + bw.writeBits(30UL, 5); + bw.flush(); + bw.flush(); + bw.writeBits(0xABUL, 8); + bw.flush(); + print_buffer(bp); + + delete bp; +} + +int main() +{ + try + { + test(); + } + catch (std::exception& e) + { + std::cout << "unexpected exception: " << e.what() << std::endl; + exit(2); + } + std::cout << "done" << std::endl; + return 0; +} diff --git a/libtests/buffer.cc b/libtests/buffer.cc new file mode 100644 index 0000000..923be19 --- /dev/null +++ b/libtests/buffer.cc @@ -0,0 +1,71 @@ +#include +#include +#include +#include +#include +#include + +typedef unsigned char* uc; + +int main() +{ + try + { + Pl_Discard discard; + Pl_Count count("count", &discard); + Pl_Buffer bp1("bp1", &count); + bp1.write((uc)"12345", 5); + bp1.write((uc)"67890", 5); + bp1.finish(); + std::cout << "count: " << count.getCount() << std::endl; + bp1.write((uc)"abcde", 5); + bp1.write((uc)"fghij", 6); + bp1.finish(); + std::cout << "count: " << count.getCount() << std::endl; + Buffer* b = bp1.getBuffer(); + std::cout << "size: " << b->getSize() << std::endl; + std::cout << "data: " << b->getBuffer() << std::endl; + delete b; + bp1.write((uc)"qwert", 5); + bp1.write((uc)"yuiop", 6); + bp1.finish(); + std::cout << "count: " << count.getCount() << std::endl; + b = bp1.getBuffer(); + std::cout << "size: " << b->getSize() << std::endl; + std::cout << "data: " << b->getBuffer() << std::endl; + delete b; + + Pl_Buffer bp2("bp2"); + bp2.write((uc)"moo", 3); + bp2.write((uc)"quack", 6); + try + { + delete bp2.getBuffer(); + } + catch (std::exception& e) + { + std::cout << e.what() << std::endl; + } + bp2.finish(); + b = bp2.getBuffer(); + std::cout << "size: " << b->getSize() << std::endl; + std::cout << "data: " << b->getBuffer() << std::endl; + delete b; + + unsigned char lbuf[10]; + Buffer b1(lbuf, 10); + if (! ((b1.getBuffer() == lbuf) && + (b1.getSize() == 10))) + { + throw std::logic_error("hand-created buffer is not as expected"); + } + } + catch (std::exception& e) + { + std::cout << "unexpected exception: " << e.what() << std::endl; + exit(2); + } + + std::cout << "done" << std::endl; + return 0; +} diff --git a/libtests/build.mk b/libtests/build.mk new file mode 100644 index 0000000..6464502 --- /dev/null +++ b/libtests/build.mk @@ -0,0 +1,41 @@ +BINS_libtests = \ + aes \ + ascii85 \ + bits \ + buffer \ + concatenate \ + flate \ + hex \ + lzw \ + md5 \ + pcre \ + png_filter \ + pointer_holder \ + qutil \ + rc4 + +TARGETS_libtests = $(foreach B,$(BINS_libtests),libtests/$(OUTPUT_DIR)/$(call binname,$(B))) + +$(TARGETS_libtests): $(TARGETS_libqpdf) + +INCLUDES_libtests = include libqpdf + +TC_SRCS_libtests = $(wildcard libqpdf/*.cc) $(wildcard libtests/*.cc) \ + libqpdf/bits.icc + +# ----- + +$(foreach B,$(BINS_libtests),$(eval \ + OBJS_$(B) = $(call src_to_obj,libtests/$(B).cc))) + +ifeq ($(GENDEPS),1) +-include $(foreach B,$(BINS_libtests),$(call obj_to_dep,$(OBJS_$(B)))) +endif + +$(foreach B,$(BINS_libtests),$(eval \ + $(OBJS_$(B)): libtests/$(OUTPUT_DIR)/%.$(OBJ): libtests/$(B).cc ; \ + $(call compile,libtests/$(B).cc,$(INCLUDES_libtests)))) + +$(foreach B,$(BINS_libtests),$(eval \ + libtests/$(OUTPUT_DIR)/$(call binname,$(B)): $(OBJS_$(B)) ; \ + $(call makebin,$(OBJS_$(B)),$$@,$(LDFLAGS) $(LDFLAGS_libqpdf),$(LIBS) $(LIBS_libqpdf)))) diff --git a/libtests/concatenate.cc b/libtests/concatenate.cc new file mode 100644 index 0000000..cf4332c --- /dev/null +++ b/libtests/concatenate.cc @@ -0,0 +1,38 @@ +#include +#include +#include +#include +#include + +static void pipeStringAndFinish(Pipeline* p, std::string const& str) +{ + p->write((unsigned char*)str.c_str(), str.length()); + p->finish(); +} + +int main(int argc, char* argv[]) +{ + Pl_Buffer b1("compressed"); + Pl_Flate deflate("compress", &b1, Pl_Flate::a_deflate); + Pl_Concatenate concat("concat", &deflate); + pipeStringAndFinish(&concat, "-one-"); + pipeStringAndFinish(&concat, "-two-"); + concat.manualFinish(); + + PointerHolder b1_buf = b1.getBuffer(); + Pl_Buffer b2("uncompressed"); + Pl_Flate inflate("uncompress", &b2, Pl_Flate::a_inflate); + inflate.write(b1_buf->getBuffer(), b1_buf->getSize()); + inflate.finish(); + PointerHolder b2_buf = b2.getBuffer(); + std::string result((char const*)b2_buf->getBuffer(), b2_buf->getSize()); + if (result == "-one--two-") + { + std::cout << "concatenate test passed" << std::endl; + } + else + { + std::cout << "concatenate test failed: " << result << std::endl; + } + return 0; +} diff --git a/libtests/flate.cc b/libtests/flate.cc new file mode 100644 index 0000000..dc65c56 --- /dev/null +++ b/libtests/flate.cc @@ -0,0 +1,113 @@ + +#include +#include +#include + +#include +#include +#include +#include + +FILE* safe_fopen(char const* filename, char const* mode) +{ + FILE* result = fopen(filename, mode); + if (result == 0) + { + std::cerr << "fopen " << filename << " failed: " << strerror(errno) + << std::endl; + exit(2); + } + return result; +} + +void run(char const* filename) +{ + std::string n1 = std::string(filename) + ".1"; + std::string n2 = std::string(filename) + ".2"; + std::string n3 = std::string(filename) + ".3"; + + FILE* o1 = safe_fopen(n1.c_str(), "wb"); + FILE* o2 = safe_fopen(n2.c_str(), "wb"); + FILE* o3 = safe_fopen(n3.c_str(), "wb"); + Pipeline* out1 = new Pl_StdioFile("o1", o1); + Pipeline* out2 = new Pl_StdioFile("o2", o2); + Pipeline* out3 = new Pl_StdioFile("o3", o3); + + // Compress the file + Pipeline* def1 = new Pl_Flate("def1", out1, Pl_Flate::a_deflate); + + // Decompress the file + Pipeline* inf2 = new Pl_Flate("inf2", out2, Pl_Flate::a_inflate); + + // Count bytes written to o3 + Pl_Count* count3 = new Pl_Count("count3", out3); + + // Do both simultaneously + Pipeline* inf3 = new Pl_Flate("inf3", count3, Pl_Flate::a_inflate); + Pipeline* def3 = new Pl_Flate("def3", inf3, Pl_Flate::a_deflate); + + FILE* in1 = safe_fopen(filename, "rb"); + unsigned char buf[1024]; + size_t len; + while ((len = fread(buf, 1, sizeof(buf), in1)) > 0) + { + // Write to the compression pipeline + def1->write(buf, len); + + // Write to the both pipeline + def3->write(buf, len); + } + + def1->finish(); + delete def1; + delete out1; + fclose(o1); + + def3->finish(); + + std::cout << "bytes written to o3: " << count3->getCount() << std::endl; + + + delete def3; + delete inf3; + delete count3; + delete out3; + fclose(o3); + + // Now read the compressed data and write to the output uncompress pipeline + FILE* in2 = safe_fopen(n1.c_str(), "rb"); + while ((len = fread(buf, 1, sizeof(buf), in2)) > 0) + { + inf2->write(buf, len); + } + + inf2->finish(); + delete inf2; + delete out2; + fclose(o2); + + // At this point, filename, filename.2, and filename.3 should have + // identical contents. filename.1 should be a compressed version. + + std::cout << "done" << std::endl; +} + +int main(int argc, char* argv[]) +{ + if (argc != 2) + { + std::cerr << "Usage: pipeline filename" << std::endl; + exit(2); + } + char* filename = argv[1]; + + try + { + run(filename); + } + catch (std::exception& e) + { + std::cout << e.what() << std::endl; + } + return 0; +} diff --git a/libtests/hex.cc b/libtests/hex.cc new file mode 100644 index 0000000..4e3eefd --- /dev/null +++ b/libtests/hex.cc @@ -0,0 +1,37 @@ +#include + +#include +#include +#include + +int main() +{ + Pl_StdioFile out("stdout", stdout); + Pl_ASCIIHexDecoder decode("decode", &out); + + try + { + unsigned char buf[10000]; + bool done = false; + while (! done) + { + size_t len = fread(buf, 1, sizeof(buf), stdin); + if (len <= 0) + { + done = true; + } + else + { + decode.write(buf, len); + } + } + decode.finish(); + } + catch (std::exception& e) + { + std::cerr << e.what() << std::endl; + exit(2); + } + + return 0; +} diff --git a/libtests/libtests.testcov b/libtests/libtests.testcov new file mode 100644 index 0000000..ddbccd2 --- /dev/null +++ b/libtests/libtests.testcov @@ -0,0 +1,18 @@ +ignored-scope: qpdf +Pl_LZWDecoder intermediate reset 0 +Pl_LZWDecoder last was table size 0 +Pl_ASCII85Decoder ignore space 0 +Pl_ASCII85Decoder read z 0 +Pl_ASCII85Decoder no-op flush 0 +Pl_ASCII85Decoder partial flush 1 +bits leftover 1 +bits bit_offset 2 +bits iterations 2 +bits zero bits wanted 0 +bits write iterations 2 +bits write leftover 0 +bits write pipeline 0 +bits write zero bits 0 +Pl_ASCIIHexDecoder ignore space 0 +Pl_ASCIIHexDecoder no-op flush 0 +Pl_ASCIIHexDecoder partial flush 1 diff --git a/libtests/lzw.cc b/libtests/lzw.cc new file mode 100644 index 0000000..6fd8ca9 --- /dev/null +++ b/libtests/lzw.cc @@ -0,0 +1,60 @@ +#include + +#include +#include +#include +#include +#include + +int main(int argc, char* argv[]) +{ + bool early_code_change = true; + if ((argc == 4) && (strcmp(argv[3], "--no-early-code-change") == 0)) + { + early_code_change = false; + } + + if (argc < 3) + { + std::cerr << "Usage: lzw infile outfile [ --no-early-code-change ]" + << std::endl; + exit(2); + } + + try + { + char* infilename = argv[1]; + char* outfilename = argv[2]; + + FILE* infile = QUtil::fopen_wrapper("open input file", + fopen(infilename, "rb")); + FILE* outfile = QUtil::fopen_wrapper("open output file", + fopen(outfilename, "wb")); + + Pl_StdioFile out("output", outfile); + Pl_LZWDecoder decode("decode", &out, early_code_change); + + unsigned char buf[10000]; + bool done = false; + while (! done) + { + size_t len = fread(buf, 1, sizeof(buf), infile); + if (len <= 0) + { + done = true; + } + else + { + decode.write(buf, len); + } + } + decode.finish(); + } + catch (std::exception& e) + { + std::cerr << e.what() << std::endl; + exit(2); + } + + return 0; +} diff --git a/libtests/md5.cc b/libtests/md5.cc new file mode 100644 index 0000000..ed6a7d7 --- /dev/null +++ b/libtests/md5.cc @@ -0,0 +1,74 @@ +#include +#include +#include +#include +#include + +static void test_string(char const* str) +{ + MD5 a; + a.encodeString(str); + a.print(); +} + +int main(int, char*[]) +{ + test_string(""); + test_string("a"); + test_string("abc"); + test_string("message digest"); + test_string("abcdefghijklmnopqrstuvwxyz"); + test_string("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi" + "jklmnopqrstuvwxyz0123456789"); + test_string("1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890"); + MD5 a; + a.encodeFile("md5.in"); + std::cout << a.unparse() << std::endl; + MD5 b; + b.encodeFile("md5.in", 100); + std::cout << b.unparse() << std::endl; + + std::cout + << MD5::checkDataChecksum("900150983cd24fb0d6963f7d28e17f72", "abc", 3) + << std::endl + << MD5::checkFileChecksum("5f4b4321873433daae578f85c72f9e74", "md5.in") + << std::endl + << MD5::checkFileChecksum("6f4b4321873433daae578f85c72f9e74", "md5.in") + << std::endl + << MD5::checkDataChecksum("000150983cd24fb0d6963f7d28e17f72", "abc", 3) + << std::endl + << MD5::checkFileChecksum("6f4b4321873433daae578f85c72f9e74", "glerbl") + << std::endl; + + + Pl_Discard d; + Pl_MD5 p("MD5", &d); + for (int i = 0; i < 2; ++i) + { + FILE* f = fopen("md5.in", "rb"); + if (f) + { + // buffer size < size of md5.in + unsigned char buf[50]; + bool done = false; + while (! done) + { + size_t len = fread(buf, 1, sizeof(buf), f); + if (len <= 0) + { + done = true; + } + else + { + p.write(buf, len); + } + } + fclose(f); + p.finish(); + std::cout << p.getHexDigest() << std::endl; + } + } + + return 0; +} diff --git a/libtests/pcre.cc b/libtests/pcre.cc new file mode 100644 index 0000000..6ebec01 --- /dev/null +++ b/libtests/pcre.cc @@ -0,0 +1,30 @@ +#include +#include +#include + +int main(int argc, char* argv[]) +{ + if ((argc == 2) && (strcmp(argv[1], "--unicode-classes-supported") == 0)) + { + try + { + PCRE("^([\\p{L}]+)", PCRE_UTF8); + std::cout << "1" << std::endl; + } + catch (std::exception& e) + { + std::cout << "0" << std::endl; + } + return 0; + } + + if ((argc == 2) && (strcmp(argv[1], "--unicode-classes") == 0)) + { + PCRE::test(1); + } + else + { + PCRE::test(); + } + return 0; +} diff --git a/libtests/png_filter.cc b/libtests/png_filter.cc new file mode 100644 index 0000000..b735f33 --- /dev/null +++ b/libtests/png_filter.cc @@ -0,0 +1,86 @@ +#include +#include + +#include +#include +#include +#include +#include + +FILE* safe_fopen(char const* filename, char const* mode) +{ + FILE* result = fopen(filename, mode); + if (result == 0) + { + std::cerr << "fopen " << filename << " failed: " << strerror(errno) + << std::endl; + exit(2); + } + return result; +} + +void run(char const* filename, bool encode, unsigned int columns) +{ + // Decode the file + FILE* in = safe_fopen(filename, "rb"); + FILE* o1 = safe_fopen("out", "wb"); + Pipeline* out = new Pl_StdioFile("out", o1); + Pipeline* pl = new Pl_PNGFilter( + "png", out, + encode ? Pl_PNGFilter::a_encode : Pl_PNGFilter::a_decode, + columns, 0 /* not used */); + assert((2 * (columns + 1)) < 1024); + unsigned char buf[1024]; + size_t len; + while (true) + { + len = fread(buf, 1, (2 * columns) + 1, in); + if (len == 0) + { + break; + } + pl->write(buf, len); + len = fread(buf, 1, 1, in); + if (len == 0) + { + break; + } + pl->write(buf, len); + len = fread(buf, 1, 1, in); + if (len == 0) + { + break; + } + pl->write(buf, len); + } + + pl->finish(); + delete pl; + delete out; + fclose(o1); + fclose(in); + + std::cout << "done" << std::endl; +} + +int main(int argc, char* argv[]) +{ + if (argc != 4) + { + std::cerr << "Usage: pipeline {en,de}code filename columns" << std::endl; + exit(2); + } + bool encode = (strcmp(argv[1], "encode") == 0); + char* filename = argv[2]; + int columns = atoi(argv[3]); + + try + { + run(filename, encode, columns); + } + catch (std::exception& e) + { + std::cout << e.what() << std::endl; + } + return 0; +} diff --git a/libtests/pointer_holder.cc b/libtests/pointer_holder.cc new file mode 100644 index 0000000..c255df5 --- /dev/null +++ b/libtests/pointer_holder.cc @@ -0,0 +1,97 @@ +#include + +#include +#include +#include + +#include + +class Object +{ + public: + Object(); + ~Object(); + void hello(); + void hello() const; + + private: + static int next_id; + int id; +}; + + +int Object::next_id = 0; + +Object::Object() +{ + this->id = ++next_id; + std::cout << "created Object, id " << this->id << std::endl; +} + +Object::~Object() +{ + std::cout << "destroyed Object, id " << this->id << std::endl; +} + +void +Object::hello() +{ + std::cout << "calling Object::hello for " << this->id << std::endl; +} + +void +Object::hello() const +{ + std::cout << "calling Object::hello const for " << this->id << std::endl; +} + +typedef PointerHolder ObjectHolder; + +void callHello(ObjectHolder const& oh) +{ + oh.getPointer()->hello(); + oh->hello(); + (*oh).hello(); +} + +int main(int argc, char* argv[]) +{ + std::list ol1; + + ObjectHolder oh0; + { + std::cout << "hello" << std::endl; + Object* o1 = new Object; + ObjectHolder oh1(o1); + ObjectHolder oh2(oh1); + ObjectHolder oh3(new Object); + ObjectHolder oh4; + ObjectHolder oh5; + if (oh4 == oh5) + { + std::cout << "nulls equal" << std::endl; + } + oh3 = oh1; + oh4 = oh2; + if (oh3 == oh4) + { + std::cout << "equal okay" << std::endl; + } + if ((! (oh3 < oh4)) && (! (oh4 < oh3))) + { + std::cout << "less than okay" << std::endl; + } + ol1.push_back(oh3); + ol1.push_back(oh3); + Object* o3 = new Object; + oh0 = o3; + } + + ol1.front().getPointer()->hello(); + ol1.front()->hello(); + (*ol1.front()).hello(); + callHello(ol1.front()); + ol1.pop_front(); + std::cout << "goodbye" << std::endl; + return 0; +} diff --git a/libtests/qtest/aes.test b/libtests/qtest/aes.test new file mode 100644 index 0000000..7e48840 --- /dev/null +++ b/libtests/qtest/aes.test @@ -0,0 +1,71 @@ +#!/usr/bin/env perl +require 5.008; +BEGIN { $^W = 1; } +use strict; +use File::stat; + +chdir("aes") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +my $td = new TestDriver('AES'); + +cleanup(); + +my $key = '000102030405060708090a0b0c0d0e0f'; +$td->runtest("encrypt test vector", + {$td->COMMAND => "aes -cbc -encrypt $key test-vector.clear tmp1"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); +$td->runtest("check output", + {$td->FILE => "tmp1"}, + {$td->FILE => "test-vector.cipher"}); +$td->runtest("decrypt test vector", + {$td->COMMAND => "aes -cbc -decrypt $key tmp1 tmp2"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); +$td->runtest("check output", + {$td->FILE => "tmp2"}, + {$td->FILE => "test-vector.clear"}); + +$key = '243f6a8885243f6a8885243f6a888524'; +foreach my $d (['data1', 17072], ['data2', 16032]) +{ + my ($file, $size) = @$d; + $td->runtest("encrypt $file", + {$td->COMMAND => "aes +cbc -encrypt $key $file tmp1"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); + # sleep one second so random number will get a different seed + sleep(1); + $td->runtest("encrypt $file again", + {$td->COMMAND => "aes +cbc -encrypt $key $file tmp2"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); + foreach my $f (qw(tmp1 tmp2)) + { + $td->runtest("check size", + {$td->STRING => sprintf("%d\n", stat($f)->size)}, + {$td->STRING => "$size\n"}); + } + $td->runtest("verify files are different", + {$td->COMMAND => "cmp tmp1 tmp2"}, + {$td->REGEXP => '.*', $td->EXIT_STATUS => '!0'}); + $td->runtest("decrypt $file", + {$td->COMMAND => "aes +cbc -decrypt $key tmp1 tmp3"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); + $td->runtest("decrypt $file again", + {$td->COMMAND => "aes +cbc -decrypt $key tmp2 tmp4"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); + $td->runtest("check output", + {$td->FILE => "tmp3"}, + {$td->FILE => $file}); + $td->runtest("check output", + {$td->FILE => "tmp4"}, + {$td->FILE => $file}); +} + +cleanup(); + +$td->report(22); + +sub cleanup +{ + system("rm -f tmp?"); +} diff --git a/libtests/qtest/aes/data1 b/libtests/qtest/aes/data1 new file mode 100644 index 0000000..577a57d Binary files /dev/null and b/libtests/qtest/aes/data1 differ diff --git a/libtests/qtest/aes/data2 b/libtests/qtest/aes/data2 new file mode 100644 index 0000000..ab02cc9 Binary files /dev/null and b/libtests/qtest/aes/data2 differ diff --git a/libtests/qtest/aes/test-vector.cipher b/libtests/qtest/aes/test-vector.cipher new file mode 100644 index 0000000..77cab1f --- /dev/null +++ b/libtests/qtest/aes/test-vector.cipher @@ -0,0 +1 @@ +iÄàØj{0ØÍ·€p´ÅZ•Odòäènžî‚ÒhH™ \ No newline at end of file diff --git a/libtests/qtest/aes/test-vector.clear b/libtests/qtest/aes/test-vector.clear new file mode 100644 index 0000000..2fdaa8e Binary files /dev/null and b/libtests/qtest/aes/test-vector.clear differ diff --git a/libtests/qtest/ascii85.test b/libtests/qtest/ascii85.test new file mode 100644 index 0000000..7ea3ee4 --- /dev/null +++ b/libtests/qtest/ascii85.test @@ -0,0 +1,23 @@ +#!/usr/bin/env perl +require 5.008; +BEGIN { $^W = 1; } +use strict; + +chdir("ascii85") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +my $td = new TestDriver('ascii85'); + +$td->runtest("decode", + {$td->COMMAND => "ascii85 < base85.in"}, + {$td->FILE => "binary.out", + $td->EXIT_STATUS => 0}); + +$td->runtest("partial decode", + {$td->COMMAND => "echo '\@<5skEHbu7\$3~>' | ascii85"}, + {$td->STRING => "asdfqwer\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->report(2); diff --git a/libtests/qtest/ascii85/base85.in b/libtests/qtest/ascii85/base85.in new file mode 100644 index 0000000..0237ac5 --- /dev/null +++ b/libtests/qtest/ascii85/base85.in @@ -0,0 +1,43 @@ +70!<9iWTSm7KiWTSm7fWNCiWTSm8,rWHiWTSm8H8`MiWTSm8cSiRiWTSm +9)nrWiWTSm9E5&\iWTSm9`P/aiWTSm:&k8fiWTSm:B1AkiWTSm:]LJpiWTSm +;#gSuiWTSm;?-]%iWTSm;ZHf*iWTSm;uco/iWTSm<<*#4iWTSmiWTSm=9&>CiWTSm=TAGHiWTSm=o\P&M<.ZglicMP!!!"'J]"ig!!9c9E!!)4J#6=g,>KOe_2$i.E#lc1Zi<9Je!!!$!,nT#= +#\X23#\ZI(!!)7krVuot-+)V7#\Za0!!)7[rVuot-+Mn; +#\[$8!!)7KrVuot-+r1?#\[<@!!)7;rVuot-,AIC#\[TH!!)7+rVuot-,eaG +#\[lP!!)6prVuot--5$K#\\/X!!)6`rVuot--Y#\X2>!!)9Aqu?]r,o#>B#\XJF!!)91qu?]r,oGVF +#\XbN!!)9!qu?]r,oknJ#\Y%V!!)8fqu?]r,p;1N#\Y=^!!)8Vqu?]r,p_IR +#\YUf!!)8Fqu?]r,q.aV#\Ymn!!)86qu?]r,qS$Z#\Z1!!!)8&qu?]r,r"<^ +#\ZI)!!)7kqu?]r,rFTb#\Za1!!)7[qu?]r,rjlf#\[$9!!)7Kqu?]r,s:/j +#\[QcOH>QcOH>Q(M<0BV#_5(Ziro\gF:@ITK>7VbLuJRDs3dTsiWT +UG&;APTlc'+Liro\hahs3?M<0BV#b_gf"UKgtF:u(`!!!"Q^iTn'"=+Q:"UP +.Tahs4%OH>QcOH>QcOH>Q(M<0BV(lLfgMbOV<:]u[VM+f0#a$_0]zM,Y`'M$ +,*fQi6sbahs4"F=$ufM<0BV#`0NHMd6aJF1!q`($, +La&Mb=>67L4oV%#\-p0uu*'$.'3I^kop\iW4rW,`0m+FNP$V=!!!"m+QWb4 +7M_,io18?,Mb`F=$ufKYWH+F:?1n~>trailing garbage diff --git a/libtests/qtest/ascii85/binary.out b/libtests/qtest/ascii85/binary.out new file mode 100644 index 0000000..f33a0b4 Binary files /dev/null and b/libtests/qtest/ascii85/binary.out differ diff --git a/libtests/qtest/bits.test b/libtests/qtest/bits.test new file mode 100644 index 0000000..08bee70 --- /dev/null +++ b/libtests/qtest/bits.test @@ -0,0 +1,18 @@ +#!/usr/bin/env perl +require 5.008; +BEGIN { $^W = 1; } +use strict; + +chdir("bits") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +my $td = new TestDriver('bits'); + +$td->runtest("bits", + {$td->COMMAND => "bits"}, + {$td->FILE => "bits.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->report(1); diff --git a/libtests/qtest/bits/bits.out b/libtests/qtest/bits/bits.out new file mode 100644 index 0000000..7311153 --- /dev/null +++ b/libtests/qtest/bits/bits.out @@ -0,0 +1,59 @@ +byte offset = 0, bit offset = 7, bits available = 64 +bits read: 5, result = 30 +byte offset = 0, bit offset = 2, bits available = 59 +bits read: 4, result = 10 +byte offset = 1, bit offset = 6, bits available = 55 +bits read: 6, result = 10 +byte offset = 1, bit offset = 0, bits available = 49 +bits read: 9, result = 357 +byte offset = 3, bit offset = 7, bits available = 40 +bits read: 9, result = 242 +byte offset = 4, bit offset = 6, bits available = 31 +bits read: 2, result = 0 +byte offset = 4, bit offset = 4, bits available = 29 +bits read: 1, result = 1 +byte offset = 4, bit offset = 3, bits available = 28 +bits read: 0, result = 0 +byte offset = 4, bit offset = 3, bits available = 28 +bits read: 25, result = 5320361 +byte offset = 7, bit offset = 2, bits available = 3 +exception: overflow reading bit stream +byte offset = 7, bit offset = 2, bits available = 3 +bits read: 3, result = 3 +byte offset = 8, bit offset = 7, bits available = 0 + +byte offset = 0, bit offset = 7, bits available = 64 +bits read: 32, result = 4111820153 +byte offset = 4, bit offset = 7, bits available = 32 +bits read: 32, result = 310998347 +byte offset = 8, bit offset = 7, bits available = 0 + +4111820153 +4111820153 +310998347 + +61 +21 +101 + +ch = f0, bit_offset = 2 +ch = 00, bit_offset = 6 +ch = 14, bit_offset = 0 +ch = 14, bit_offset = 0 +ch = 00, bit_offset = 7 +f5 15 65 + +ch = 00, bit_offset = 6 +ch = 00, bit_offset = 4 +ch = 10, bit_offset = 3 +ch = 48, bit_offset = 2 +ch = 00, bit_offset = 7 +79 12 89 75 4b + +ch = 00, bit_offset = 7 +ch = 00, bit_offset = 7 +f5 15 65 79 12 89 75 4b + +f0 ab + +done diff --git a/libtests/qtest/buffer.test b/libtests/qtest/buffer.test new file mode 100644 index 0000000..38da9fc --- /dev/null +++ b/libtests/qtest/buffer.test @@ -0,0 +1,18 @@ +#!/usr/bin/env perl +require 5.008; +BEGIN { $^W = 1; } +use strict; + +chdir("buffer") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +my $td = new TestDriver('buffer'); + +$td->runtest("buffer", + {$td->COMMAND => "buffer"}, + {$td->FILE => "buffer.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->report(1); diff --git a/libtests/qtest/buffer/buffer.out b/libtests/qtest/buffer/buffer.out new file mode 100644 index 0000000..787a38e --- /dev/null +++ b/libtests/qtest/buffer/buffer.out @@ -0,0 +1,11 @@ +count: 10 +count: 21 +size: 21 +data: 1234567890abcdefghij +count: 32 +size: 11 +data: qwertyuiop +Pl_Buffer::getBuffer() called when not ready +size: 9 +data: mooquack +done diff --git a/libtests/qtest/flate.test b/libtests/qtest/flate.test new file mode 100644 index 0000000..b7acae6 --- /dev/null +++ b/libtests/qtest/flate.test @@ -0,0 +1,74 @@ +#!/usr/bin/env perl +require 5.008; +BEGIN { $^W = 1; } +use strict; +use File::Copy; +use Digest::MD5; + +chdir("flate") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +cleanup(); + +my $td = new TestDriver('flate'); + +cleanup(); + +open(F, ">farbage") or die; +binmode F; +print F "q" x 10000, "\n"; +print F "w" x 10000, "\n"; +print F "e" x 10000, "\n"; +print F "r" x 10000, "\n"; +print F "t" x 10000, "\n"; +print F "y" x 10000, "\n"; +print F "u" x 10000, "\n"; +print F "i" x 10000, "\n"; +print F "o" x 10000, "\n"; +print F "p" x 10000, "\n"; +close(F); + +check_file("farbage", "a6449c61db5b0645c0693b7560b77a60"); + +$td->runtest("run driver", + {$td->COMMAND => "flate farbage"},, + {$td->STRING => "bytes written to o3: 100010\ndone\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +check_file("farbage", "a6449c61db5b0645c0693b7560b77a60"); + +$td->runtest("compressed file correct", + {$td->FILE => "farbage.1"}, + {$td->FILE => "compressed"}); + +$td->runtest("uncompress filter works", + {$td->FILE => "farbage"}, + {$td->FILE => "farbage.2"}); + +$td->runtest("double filter works", + {$td->FILE => "farbage"}, + {$td->FILE => "farbage.3"}); + +cleanup(); + +$td->report(6); + +sub cleanup +{ + system("rm -f farbage*"); +} + +sub check_file +{ + my ($file, $sum) = @_; + open(F, "<$file") or die "open $file"; + my $md5 = new Digest::MD5; + $md5->addfile(*F); + close(F); + my $result = $md5->hexdigest; + $td->runtest("check $file", + {$td->STRING => "$result\n"}, + {$td->STRING => "$sum\n"}); +} diff --git a/libtests/qtest/flate/compressed b/libtests/qtest/flate/compressed new file mode 100644 index 0000000..79b2da1 Binary files /dev/null and b/libtests/qtest/flate/compressed differ diff --git a/libtests/qtest/hex.test b/libtests/qtest/hex.test new file mode 100644 index 0000000..32ec84b --- /dev/null +++ b/libtests/qtest/hex.test @@ -0,0 +1,22 @@ +#!/usr/bin/env perl +require 5.008; +BEGIN { $^W = 1; } +use strict; + +chdir("hex") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +my $td = new TestDriver('hex'); + +$td->runtest("decode", + {$td->COMMAND => "hex < hex.in"}, + {$td->FILE => "binary.out", + $td->EXIT_STATUS => 0}); + +$td->runtest("partial decode", + {$td->COMMAND => "echo '7a65726F203D203>' | hex"}, + {$td->STRING => "zero = 0", + $td->EXIT_STATUS => 0}); + +$td->report(2); diff --git a/libtests/qtest/hex/binary.out b/libtests/qtest/hex/binary.out new file mode 100644 index 0000000..f33a0b4 Binary files /dev/null and b/libtests/qtest/hex/binary.out differ diff --git a/libtests/qtest/hex/hex.in b/libtests/qtest/hex/hex.in new file mode 100644 index 0000000..9721a35 --- /dev/null +++ b/libtests/qtest/hex/hex.in @@ -0,0 +1,70 @@ +45000028e20508074600002ce205080747000030e205080748000034e20 +5080749000038e20508074a00003ce20508074b000040e20508074c0000 +44e20508074d000048e20508074e00004ce20508074f000050e20508075 +0000054e205080751000058e20508075200005ce205080753000060e205 +080754000064e205080755000068e20508075600006ce20508075700007 +0e205080758000074e205080759000078e20508075a00005589e55383ec +04e8000000005b81c3b44c01008b93f8ffffff85d27405e8de000000e83 +5060000e840070100585bc9c3ff3508e10508ff250ce1050800000000ff +2510e105086800000000e9e0ffffffff2514e105086808000000e9d0fff +fffff2518e105086810000000e9c0ffffffff251ce105086818000000e9 +b0ffffffff2520e105086820000000e9a0ffffffff2524e105086828000 +000e990ffffffff2528e105086830000000e980ffffffff252ce1050868 +38000000e970ffffffff2530e105086840000000e960ffffffff2534e10 +5086848000000e950ffffffff2538e105086850000000e940ffffffff25 +3ce105086858000000e930ffffffff2540e105086860000000e920fffff +fff2544e105086868000000e910ffffffff2548e105086870000000e900 +ffffffff254ce105086878000000e9f0feffffff2550e10508688000000 +0e9e0feffffff2554e105086888000000e9d0feffffff2558e105086890 +000000e9c0feffffff255ce105086898000000e9b0feffffff2560e1050 +868a0000000e9a0feffffff2564e1050868a8000000e990feffffff2568 +e1050868b0000000e980feffffff256ce1050868b8000000e970fefffff +f2570e1050868c0000000e960feffffff2574e1050868c8000000e950fe +ffffff2578e1050868d0000000e940feffffff257ce1050868d8000000e +930feffffff2580e1050868e0000000e920feffffff2584e1050868e800 +0000e910feffffff2588e1050868f0000000e900feffffff258ce105086 +8f8000000e9f0fdffffff2590e105086800010000e9e0fdffffff2594e1 +05086808010000e9d0fdffffff2598e105086810010000e9c0fdffffff2 +59ce105086818010000e9b0fdffffff25a0e105086820010000e9a0fdff +ffff25a4e105086828010000e990fdffffff25a8e105086830010000e98 +0fdffffff25ace105086838010000e970fdffffff25b0e1050868400100 +00e960fdffffff25b4e105086848010000e950fdffffff25b8e10508685 +0010000e940fdffffff25bce105086858010000e930fdffffff25c0e105 +086860010000e920fdffffff25c4e105086868010000e910fdffffff25c +8e105086870010000e900fdffffff25cce105086878010000e9f0fcffff +FF25D0E105086880010000E9E0FCFFFFFF25D4E105086888010000E9D0F +CFFFFFF25D8E105086890010000E9C0FCFFFFFF25DCE105086898010000 +E9B0FCFFFFFF25E0E1050868A0010000E9A0FCFFFFFF25E4E1050868A80 +10000E990FCFFFFFF25E8E1050868B0010000E980FCFFFFFF25ECE10508 +68B8010000E970FCFFFFFF25F0E1050868C0010000E960FCFFFFFF25F4E +1050868C8010000E950FCFFFFFF25F8E1050868D0010000E940FCFFFFFF +25FCE1050868D801 0000E930FCFFFFFF2500E2050868E0010000E920FCF +FFFFF2504E2050868E8010000E910FCFFFFFF2508E2050868F0010000E9 +00FCFFFFFF250CE2050868F8010000E9F0FBFFFFFF2510E205086800020 +000E9E0FBFFFFFF2514E205086808020000E9D0FBFFFFFF2518E2050868 +10020000E9C0FBFFFFFF251CE205086818020000E9B0FBFFFFFF2520E20 +5086820020000E9A0FBFFFFFF2524E205086828020000E990FBFFFFFF25 +28E2050 8683 0020000E980FBFFFFFF252CE205086838020000E970FBFFF +FFF2530E205086840020000E960FBFFFFFF2534E205086848020000E950 +FBFFFFFF2538E205086850020000E940FBFFFFFF253CE20508685802000 +0E930FBFFFFFF2540E205086860020000E920FBFFFFFF2544E205086868 +020000E910FBFFFFFF2548E205086870020000E900FBFFFFFF254CE2050 +86878020000E9F0FAFFFFFF2550E205086880020000E9E0FAFFFFFF2554 +e205086888020000e9d0faffffff2558e205086890020000e9c0fafffff +f255ce205086898020000e9b0faffffff2560e2050868a0020000e9a0fa +ffffff2564e2050868a8020000e990faffffff2568e2050868b0020000e +980faffffff256ce2050868b8020000e970faffffff2570e2050868c002 +0000e960faffffff2574e2050868c8020000e950faffffff2578e205086 +8d0020000e940faffff00000000000000000000000031ed5e89e183e4f0 +50545268009b050868109b0508515668f0e60408e893fbfffff49090909 +0909090909090909090905589e583ec08803dc8e3050800740ceb1c83c0 +04a388e20508ffd2a188e205088b1085d275ebc605c8e3050801c9c3905 +589e583ec08a110e0050885c07412b80000000085c07409c7042410e005 +08ffd0c9c3909090909090909090909090905589e583ec188b45088b4d0 +c8b50048b00894c2408c744240c0000000089542404890424e897fe0000 +c9c3908d7426005589e583ec08891c248b5d0c897424048b75088b4b048 +b56048b06330331d131d209c1751a8b4b088b46088b5b0c8b560c31c831 +da09d00f94c089c283e2018b1c2489d08b74240489ec5dc38d742600a12 +0e505085589e585c075088b4508a320e505085dc38d76008dbc27000000 +00a120e505085589e585c0750da124e5050883c001a324e505085dc3908 +d7426005584c089e5740cc705>trailing farbage diff --git a/libtests/qtest/lzw.test b/libtests/qtest/lzw.test new file mode 100644 index 0000000..e614211 --- /dev/null +++ b/libtests/qtest/lzw.test @@ -0,0 +1,39 @@ +#!/usr/bin/env perl +require 5.008; +BEGIN { $^W = 1; } +use strict; + +chdir("lzw") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +my $td = new TestDriver('lzw'); + +cleanup(); + +$td->runtest("decode: early code change", + {$td->COMMAND => "lzw lzw1.in tmp"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); + +$td->runtest("check output", + {$td->FILE => "tmp"}, + {$td->FILE => "lzw1.out"}); + +$td->runtest("decode: no early code change", + {$td->COMMAND => "lzw lzw2.in tmp --no-early-code-change"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); + +$td->runtest("check output", + {$td->FILE => "tmp"}, + {$td->FILE => "lzw2.out"}); + +cleanup(); + +$td->report(4); + +sub cleanup +{ + unlink "tmp"; +} diff --git a/libtests/qtest/lzw/lzw1.in b/libtests/qtest/lzw/lzw1.in new file mode 100644 index 0000000..d95d596 Binary files /dev/null and b/libtests/qtest/lzw/lzw1.in differ diff --git a/libtests/qtest/lzw/lzw1.out b/libtests/qtest/lzw/lzw1.out new file mode 100644 index 0000000..21b5a27 --- /dev/null +++ b/libtests/qtest/lzw/lzw1.out @@ -0,0 +1,4299 @@ +This is a test to see if I can use libtiff to get lzw. +wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +Let's make something very long. +‹ülH¥Ymsܶþ\ý +ŒFK™;åØk'imÙrÜqÇvâN›T’à" P¼ËK{Ÿ]€÷RˮîHpw±Ø}öz¬jç•xÕF—âµ2Jµ÷åu?{{âSñº³"μë¦3q%ÍÔëŠ×Ÿ©(p-\-¢ +Ѭ +ñž«Jm•P¶ÒvðºÑ…—^«0¹, aB<“ËôÙEm&µ6êäf¤üy캸DzŸ|ûæ£;ÊpitT,çÀô1–Ò_¿ÏX4Ì‘µƒ±Ž†å_÷þ”¤g·Ä'Ÿ0mº;bŠDG?­GÖûõQ¹°1ZgÍâG»ÿ‰çOe0?}PBóÞ@´ÆžÉ—ŧ°æõ—ú~x3Dúüê{úZH[‰—/DÑEa^¾¸Ê¥ÿ•7e.õ¸†_}Û¿g¹u¿ó$úèÍéóç_«ùEiŽ—^*½tWˆñ©%&Ü@‘“HïßK”#ñâŸï†ËM!Ç,åéѲY’ +„'j^B²o ƒû7#±p]²*¦ÑNáfäÀø¾QH‡òyZ#aøYŠ÷”X«ŠÙd¡Ž g•S¢S}í³Z“”MŒä^Á h:§á]¿h#…%¾a+ÔË”Ö[·Ø(Î1 ïJ”UåTÏ5*¤˜’H9lNl+d…\†Ysʳ6Y%YZFl‰MeÀ‘nm ͲP +~mA=tÈh-{,!)ÌReÚòÿÆã’ë’!…{O â'C=èYª&8`Ì° _a“¿S<µ"§ ƒrœî“Þà1cÈð¾s|ë{ϸ†˜½õPÐ4‘ýM=$;sµ„²)Ã’th$zê:-on©ls¨L~_‰Ïë®Ìýæ=‚»_à‡?`ø¹KÁsJ$"õnáøˆ·z æ (B6 DêQÓˆù— ;êf8`ø6•ZêÅÙvª”Ôtõ)ù29¿…§ŒB]D¹0ƒýîI"˲£BK¨¨ILOPÃ(R€"×óasAeF´èeGlöyPꩾYuS…šjk¹tZÖÄ 6â¶1y1, G”ï[ŽTÏ™«É¬ƒ1êJËœâÓigL§É—-ÒAѳª¯gëØ„ K½Ä‹U3 Øê+]¥r›:êyr]Nx©T(½n#Õ;U”³ƒ ˜1£ã­ÀÆ¡2GɆ"¿ëø†^0*8Q ¨:^b¢GùÎeÝaE/D¸V –£¦u¨Ùì«ÀËIt­ãa¤6ô_Bê1%r{•ÍY:4ö!¦fN¢¡Žä î«I à‚®1¤”¡u)´ %*ÊC@p¡(\”T”ý¶]N¬l•\Y¥rïGÖ#;Г5¥tÞ “Ä(¹¥4]ê'\`íˆ'ÉX¡·§­'Ùt»môà@KÂë—溩­RªËæJ‰úù­†ÀStfÁÔ/#­onpØ%$O‡‚u3<~5ч™Å3a‹ÜK0Ó…§þ¬\€t^à h6A׶¦ÜR>ª\‘êc6ãŒÊ5‰¸ÒªOáQÇžÚÖh[Œ¦˜2àÅ¡z°½É' Šüà(äz´‚³…žBeiˆ×U² ¡!µ”© hPàh A5㦧VW4¨ðØ^±ë¹×!ƒÜÊõžÛf«Qœ–üœ¹)Ü™jCùM%4K]ë2Ø&t(>ÎÌ?S±Y†ùg­zóäáÕ­04?֥܃$¥cJ1iFT6u]z!‚º±,Š˜ç(Åa¿ä†ÚÉq[‰ï_eu’ a•c¦‰¹y0’^GÑÀÆ à oTbNÊyëÚ©†Ó$Îaœ¦šzrPÕ^).ð£¡G àJ<¢­‘Aÿ©=çÚ›¤ÖkçsØ·†ýóuwrorçöíû<òÝâî»Ð‹§ÛG¢0j³g²¹%•/:Rܾ Ï)G¯ê4ÉÂ#{ÙVõ1÷øA" ð Í'åðÛ‡°oí +3 Ñf½ª\2™æ¤Þ0öU2GÏ1ÁùþšäžzòOÅS$<.Ø©ŽgP=Àí”2éÜÏÂw©p’æ‚^y±¸¡ OŽ?ç–67ãÉr©$åô+à ÂeIzÄ!ôù=“ѧ×¹žY + ¯ПþË©=®O"Ù@†$)ïŸMœÕUêì_X9é“ÛŒð;28pmÇ[aFÁW¦™‚ð”º@-Ác”ºT—=šƒU¬†|½{”Tç}Éþyzø‰ŒÆÒL¹ð>C¨#· DU×Lc¸´5\±~§lÑûâF£»Âe’$çzŽÃ e<òeá#šl³»köžÌ”j·Fu¡¤¼wk†™í!CW+ùD1íÔ> +RRdÐZÂÁ.Ì€¢‚n©™C¹Úx™%êÚŽLr:ÅÂmç½Tݪ>GlYÑ Çˆ:EdØÅb­@çüYp§{*ŸíÄ'áo#À®ÐL}ªR¸ÿ€¨½(íBôT¼ù§íü÷Ê2 æ°E¾é‰åÕâ|JÂ|., Ïq,vÃ1 Δš§wm±—% Gý¾y$GÆ[YÉÚš{Ö´¶fŠeó†}1o¨ò¾>ª~Já0‰Æ"ƒ²à{‰¡–wÖŒc½NÚËêŠ^FeÙ3*Íþÿ®Úl# YCæžò}±4oçÉ>s¼CqåØe$ÕB%UN¼GAï<á5­|+’‹\#¯ç (ótu;ËÆF€€ +BÌŒõÈ1 +ÌA`8‘¡¼•]Øt"ŒK¬é$ùlRpSþ³% T×,ž*ù-Ëjxž ÊÝóÛ‚ø¢’Øò0}Œ ŽûËOòXQã‹ã§¡†2ßQc:‰m0µx†Sñ_ƒá5Údø ¾¤P"`[ {bZ³j™7Ü„‹Oܳá$²¢ßZ,§‚ÛèÄlKÙŒëØ_mñrŽ¯Y¯ªË@±´gEÂþf¤}/°<1z+r2³>HÉ)y»RÒ¼úþ !gWïsu®›»(/×õù +úvå]ˆä‹»Ü†ˆ®zj{V »ÙMT½¤ýH\ÒþÊ÷¾t»‡õõa}­êô÷°ÈÞÜ"» ‹ä‹\F­á¿ËµTÝ_¨°“»›¥ôÑ¢/.³‡Eöa‘}Xdÿ Y÷f³µÆÎx—øëXš¿’•yÁ7ª¿Ý59èN·¼Ö]Ãû¹ç5ý<÷v¿ªezvKrÑì`_û*ý°H?,Ò³Þ0»®ÍEîË&Q=®Ï¾Œ7áñ cö¯;på%AV_Ú}M/Ù—m~Þ=îìþpÐùy÷ÕþÑñÒß •{·?é…r}á/ßÿøãÁ¯òΊú»ôÍÃçž|ph;­ÎÆF§õ<Á.O.7éK‡îD­_ŒF³¶ÑäŸg››ð·õüi·è7ÿl¶7ZíoZÍv»ý´ùü¼o77ڛ߰æ";š÷™€àeì.CÎã^Q¹0Io¡Ûýú>᪞¥¡ 5輟òVEù‘¡m ÀÔè8îÇW|*PðAòÅ»’Щn>ð ^e ¸¨›ˆ‚KÞ&X·/’ Ùû|*oR +Ø¢ºkêÅv^ö=[kad6¼©ðˆ0cfdÂ2µÌ—¶‰¾Ê(€ Vh°^*×Ãvv#ò¥;_h"¹úu¤|?` +q^›sãhrÚº[åæ? +”£Yä¤fÍFŽÅ’8½e–È'™©Ãþ-®äÓÃD’HÙPKð_j1~Ã-@Ö‹¬•ø/÷à 1Ü™ýÝïgŸqð¼ášëK⌦|Øn0}µ…hqF#4Ø,[È-¶ª(².gt‹÷õLrLj i]ÈŒŸ ¸ˆHm*)­‡1rq)h‰„5±2hÜ°áŽïÅÄ 1$^ø +ûÊñý/â bªÐ<>öêKŠô†8Y}[f]@–r˜¯EµìSب{‡i7…ž&—eߢ尓r¢…ÄJ%¹^ì¶Ð: ;ç…œtbÃz%²°g©JJáÑ€ÕSófÛl­¶ì40|Ð[÷p1Î5‰YF1ц ¼Ø¼øºnÛàô¶,“…±©ˆùÜš$˜nYÊ7Euë Q€g: èÞÙ¶[‹n£qÔ'dH2YJ +q²mô5Süv) Æð ¹nÀ'÷úOVþl‹°) XË0q´*`M_¿4%Òxß-×ó¥ð²à8yYbîÆáoC/\ˆ +–2~-@ “v5°Ì-a<APÛâ'1ÅKv†¿3²Aæ~Ãyà³NE!” óÑ…p£B:r¾¿ÂM|1²‡}ô’zm-2)gèî†k‘J“ Ô„/?60WŸ¼Ói(nNT\()¹««ƒŽç|€á5ïš’[¿5?8çnjN3¥/¯iôGš =õ¨k¿ÿnöÍ'ès«Ör©RB“@ç2œ‚&:Î’!3ð&~FÒXõ²ïÙK;¬ÕwÏjU +­$y~¢ÑüÐ$³«Zy+6ëôSÊ‚Úãú㺃³ESŠ-^wû1 +b^kF3ÛÊ<ïÔo‚w2\4Ö[ÖÓ¡I2ìsw½ùþvço®®èÇñ:üÿäŸ!­­¬§™þe5ä*èãÑt¿Ï§\¹7hC X: +»— J“Òç¢gý[ #€Z}–n"\»Å +þvÈõØqrÍL!7Š#Îv {0x¶Â Ë>YHAŽ™‘ÝÐpu~Q_ÆFp·"Ê›pâ2‚×Êa }飼¼DE9/™ƒ`ËxÉ?kkÙaÊUßòà‹M»°³ˆ¶!¤¬„_ј£là˜£ë v®–ãkP¥P—^ÅDsû?Ó[%áYô©VÏùûã©a¦“³b˜Z$ä+NºŽ3-5‡h¬áÜYd Cvd-˜ÿÌŸaØ.»Sk×^¡Š·¯ñnγ‚[€¥5%a<+›]E±î*`Ö`­¦ã’½(Šœý0Nÿd«ø̼$|VÇCÛ»Æ7¼ÃP¤ÉL!|ÑÁç*â#.dF:9e—Žxu¹ûRs÷=ŸR7W›¥ËÑ¢úEØ%ç&%±è­ô,W@‘<“o4ƒeå_Ý®„¼añÐÄ êoU“F53s1 L|ÜáNø³j`Ϧ;¬v8%ؤØdJ°ãj`ÇS‚½¬örJ°ŸØBÆe–P*Âà“½C²m)88‚ëS!Øÿô¹×ë}ÑxTÜŒ}~ìO3âcâD§XRcnšÖ3W<ój%:òB\þ ù›Ëpr /Ãäš‚šr™-îM¦¶¬ž‚’%¥?gJíq"?Ê'ò—ÇùN¡dªåšU­UÅö›\+LI¿s –h†–žƒì^©%eìžQL¦åüʪÆTƒTu4dW¦ug‘i9])쇟 +з ±ÿ—m´óµç°ŠÀo?¯*î+¨×°y¤móYÔ5u6¥A&³Ó7茖FD ¶TYca¾Ù؆CDê?¶åi¾Ô(gÎÌ¡¢GÙ%Üßs–Õ„ ‹×³c±&s’FçÆâýìX,ýÙ€Sç9Ú·—VYµž_ÇЄ2óð÷!KÑþºb8I¾y“ }5«o:W[Ö†æñ%ÛáSò Âwœ§º“ŸòeŸ­\Zg+ÞþËû—yò6˜Ý1_‡BÜä¤á¿'&%X®äžgñÝœoñÒðY×2¢]‚Ÿe-(Zë¥Ôƒ–»[Ç“ +iücߢyáÛi 7÷cën™¾iÿ^p6ôY$ŽG©a{ü¾Ò>ëû‚=úh}s˜¡,”K²¥Û†·™³ÄL³òeDaÊ(—)º‡Œ âÿEÜ ¤µðdù@§æK• N¡-5¸ZШÔ&f'¼ç‰¦0ÏÆçU²´Ò…²§ß(D+î]·{å§ir²OÄrÖ2¨«†4½Áª†¹ú† Ý +"¸FxfÀ±\RŒ¬Š2ìúØ\é²ÚB< íÖ…ç ]TLÅ¥E¸ ‡¼ÙÓï¢`#ÓŽÙ->掑ysXNA¤ê*$¦ Ýîäà ükœÎÞ{d´èWH¼{ÆÓ‹âª{d[ÎàH‹” Ü7âÎШu ¸)ü2·e9‹ü—|?Ÿ;öSr=4•¹þ*‰à2£Û¢†Z3ŽÅávLÒÉëx?»Â/_Ä0Þâ^(}ꢡiY—‡tQB0$äSƒÚVµ•»ön¹¾óÕ¬ëâ2{¼œ–,?øyZš¦;~Ó ™kÝ0•SþÏ +:×Á^|bçî튉sÂdØE·¶dšv&¿h_kë ‹@ì˼røžfw„&[•7.sJµö¥(_ß?–Þÿä8 ôU9äkK‡o;Ç'¯:'ûG»'oä£Ë¤;«ÜóøKð…îNpÞÐ96]Îwä­$ìÁñ +ÃQ6îx«s‚C¢gpù_N¥ ¿§¤vt]]­ñrÒsïPl³JÕ¸š>KÍ•™Ú{Yó“‰]Šèaò’=¯¾¶Œ@¯µüõ¶|c7)4yëΘg4%×:!øCf ͤwU_­Òúñ +ù±ÛQöý2S¶“í jÎÒ³¦Ë™ûУYæ1s®ýzgö}üâÉúÀ~˜^x¹bîð@9Q‡ð-Ú9ñÚÍææ_6ô»ÑØ?ÙY³4_ôŸW‘&LaÙœðoÌ8X´.ÀãÍ–«$€Ó`NrŠ™ÁöèR|èÀ³'ÄéÉÑîÁÉ1ˆÓÎÁáÞë÷¯ö_9ÁxŠJzÃúì½=üñà' +ë#eÿ SÄðû,:§~‹5Àç—·GÿØ=zûþðU,®ì*N>I<ö,ÀFµn—,m>+Ð^Bõ¿ÛÝÛ7"ìðû ^†ÄUœ+MÛê·° Ã*¨››3*Q6ÐQq›í KÏ UÄ$ê«ý½×NTvH­±ßÔêdR4Cñ8áM,³”êKü%(8P‡ttdB”þbU~“h8ÞhwÄ-wlÙ +$›ÏÆ’–7ÇŠ(tššD‘׫CT i6Â@×uœx¢D]èž>`]Y;S¹3ŒáØ  ÷Ll§F( +¾³2œøöÝzÝꀊ˜¤(oOÚÝׯ EÐ ’¹F4°¡Õ·§†Ø%Ñ H®Ë! ÝÚð¬w2¢"0q†·÷aĪ6`£«hh”¢Âo¸³pŸ˜Lu– +G"js†EƒS^Â|"숒¡úÂøn9ÇügÍÁ¤JëRµ:Ô´Bq`Ä”(eÔ2ùÛÀ² ‘¿¶<²DÐËz(¢s83a9²•À¤9›ù‰5ƒ¼"ÙPIŠ²ó‰Á«¯@^uS”Ý×¢P¤ª4Ì€±$)¯„ìÎ-åD³æ¬Ö ëJá/@â-ª¹rošNK?Qmf¨ê?È@GÝ$RÒùöäçý£Î/{?ïuNDpHL‚}*Uó É] Üõº +ûýKiï[_Œë߆iC¥Kx‘“ÑQ’ò{äÿ\³ÓIÔïÑíú'ÿÛÝ’Ó™\YíÍñ?÷Ô%º²º¨¶Q¯$±ÞÎ%¸-sƒËW!Íé\·¥»C*-ä]V•õy¥ÈŸ®+ù¥$¨Ï¿Øh˜B.óf ”­-`y¸™þå.³w°xé°kϼ‚¸`’%'T¿6ºkµz!¦~• àÁl·Ÿòøÿ£y‚ÿSfÿo>mñgÊþßnÿ>k?Øÿoåóÿÿæâÿ‹™3§ù_ÿÿÇpÂ5ê7q’ð…á—åcð߈è¿ä ÑbüÿãÍ»Üÿòo3Ë!‚ÇxÎ;á˜?·¾Ø*ÏY ÁÇh¢PJ@‘ßÎ<…s\½-oEMÝ‘àÿ[ëƒ?­åŸ©ò_o¨}–„aMb&œx#ðKêgªÚ2 ò<¹Å®EûœB>&•¾àY(5\g­&Pû"üV êë½PÔ +kÙüõ`XÝ©!võa¹¶Äó{™E>_ùã4qi2Ä€ }ÐÁ\…+Ïó†jA¤¢ h½±ñ’-}†ét3ÔÞˆì.—é7{Éšømàä¸â%wj…w4EO1“[]Þ8È2+ŒÀæâ3—£À‡D¼Åze cþ!®­Ñ_°Nò‚Ü7ÃÊÂETcÖ ˜u~Æ\e¹%wjŠ÷ç!K™ I¾ÝÿY^f&&„ +léÂ,uKNaZôn§„é5ÝJ(\¬¶D" 8 ³q]‡Ö›Òqe„—÷T +d,iÜÐ/ðçȸ2R¼¦F‘KyNÚkX-ä¹5GŸ‰IeŒâ€ ¡«D[ó¸ÖÒh³ZÄ^°3\¼©ýÁvxa‘ÙPwü·èôÓ|òLJzÝpó5ýÇ÷¶~ýCßeË4ò2ӈц Ê4ŠÑJjÿa9yã®Ë-Æ @KG¬QZ)/œðÐr]´Ôºþ°Í»·Ÿ¢ýßÕF{!`Åû¿§›OÛÏ!ÿÛ³Íç-þü¿Z|Sø°ÿ»Ïƒÿ×¢÷~¾Y3ç°²X¦mïŽì^ªª×WqÙÌV¯ón÷¤³ÿëÞþ»“‚=Û†ðS7KÀD˯öÜ}ÿ:ƒn±;Ñ¡#nצn[öRyòó_(ó°¦@O„*=˜ŒiG\ˆû»£ƒ7»Gÿ‚>ƒÏr>Ââp £Ž J¿ýáö÷N:{»{?ï‘[ ãŒäf÷"tãæÜ[à€oéo£$8ŒOõ!o¼¹‘뙧\l i{óùwÏê¹¾oL&¶;Ë&éC+yÈ÷R=0S¤1ßJ 3Á\wytÿ„Aͪ$·^Œ¡)±ƒ;Ã+ø¼Nó + D‹mžÚm©3¾~7êÑé)N˜®ñ"î£A†‹›×{¯Ö³õSŽ=$('/`?¿Ãºàþ`<@z—Ÿw_½Þ_—øcÌ.ÐÑQtĉÄÈ[ÒÌå÷K4Üh³ÝwS®xÃȈÉÅ/"`§:v0sN«ú•=ubcÂvšŒ: +0(þ󥌯¡›ãPòf®¼ œÊOÙgiÍ=þ ŒvYÑ*¤ ?Óµ¡ó Þ½úmÑ‹Z››^rÖøÛ·1—š2ºöX]ÆÝcM·Ö\ œûåé›@`¾ÙØ7¤)ÇÓ:'ç4g9™-«« Z3 w¹?ňû°.jKu¥˜}J[;Ø4,u]àÐãPêÈu«£YŒë”~esü­ýXy^!UêLÂRº;¶ \!0iXØ°+9§œÄÓëÌMÏZk2Ì°6Ö Iájhƒ ýØwµZ–·§_obýt¦W…FÆK.äFúÕçŸù!f˜æšd +Ž„˜Â‘+ÐC¡‘’·&P8ϸ¾:NeŒ*¼OS![´·Y:¥ò¾2z-}w„WO]úîh²Ð £‚p ROBq-8}ÛYŠ†}ØDëZ^Ä„!k+Û*uG?¡‹¶5Ù8Ùåå/ö’õsnåòZ?¸†xU@êù)„㋸'î”%á¿'Øt(!•Lã9 ’$¾ÒqÊfØsXè0JEä²Ï#s¯O»n˜V…A0z!Nî2XÒkαŸ(Ÿ•£‚`?ò-DbáõÕ¥n|áD´2¢8@(4Y,B“ßU"ñL.í NxF8 ÆùËuÈ•Í÷]«E²O•Ãàuö=kò‹ÖvDä-} ”Á•B±wL”³ælnÔ£³¤Å{#¸#/ê; µ÷š PNL¿ºžjþ®’䓸]µ-±~ÎØÖ0gÚõšV0Iý\ 97á}^Zö¼Î¨ú™¾è–p™’ùk/4?EË|‰³[lHX*4’éoiúµš¦‰A˜¦Á9¸#äO:™ Ž¼}õv ¼äùjw¤l 6-ð‰²à’£?- 6kˆäËÂU¤@N¨¥£H–ø¨dJB¾'ŒP)À¨Ålw‘¬[Ä°M’Qœ +_W¹Iç_„K¯ÞvÁKt5v‘W„9ÇÓôqÐÏ©¤ 4}V“•E€ ‹Áø;.ZòøK›Sä<â=ÆD{PûöýÙzr@L°¨n±o͈ÂX7È«ƒ°òµ6aüß8Sd0 Iå Íi’† BÿëÆ—eÆѽÊŸ² äÈz؃µ@ÝÌ#HĵÊ·p¡(om38áÏ+7>mü—ºz +Ò´dìÐd&WJD ¯ˆ¬ôеö Ë+#€Ãè Áÿ¼t‡òä&¡‘¸H™ð¯øÛà¬?2Zÿ’27Lô “Ú²V g‰I2ª_‹L‚‘Ï ”]^f+üou¸—ž¹(B.U:£Œ“|By¼Ä„|UcYEКŒV¢ÄY2hš5…EBÚNCj1#ìŸöz…‚ë:ff½  Iå/E[ µIàr]Þ(«²SÛƒ¬M „Î;Uv ¾MƒïòmE%½la-[WqY5FVÑš¼q +m¿@CË™P™ ¢¼{u÷Ù1A¶Q® £Xl*øUP¿: µ»¼=¶Œ°|êgá(kMØ‹ >?œ|PŽ…V¯}…ŒNµžA§4Ò¾âè",yôÒBë},ˆ„‘tVÁK÷àÕ¼Œ‹ÂÔöjþìÏd.Œ žÙÍ窒î}»ÌM&FOvOöÀm;<©9%i7Ajz &|jn6›u<ºL¸¼? Ù^ ÷_Áð´¦…<F]ˆúŽÀ¿+Þž8ˆ/„¼qvÆ g]4äÁ{¡ÌÃÙ8Ž 'ÿz·ßbçI<-Íe³;AëÊn _”ÊèÌ–•cPv•¦·Xwè‘r þ:&ˆtsõøÚktP6(>1&;KÒ 6`´vXÙ¥­f$²+ØxH{ÑPÍÔ'¬žëL|dÙXÆvPPÝàæ¼)ˆÓâÒì!´ “°€:À1È!67i²¼?YWF&ähùöÝp9¨Z‰æ6ÎHA×@ÈEµq(oì"CO¬ø[òý%5Y®‰â¹ÍEäX^Á†NÃóhíßTã‘ÉRéh|òÙíÂx9…CœÑd‹BÍiv+³t)Øî†Òü/ŽÑ)oòc‹ÎìþA´÷—;n¾H÷ÂO$l)µ_ÿ^YÐ d®Hï@3]¾*Äñ}ž¶mó ­¿ø&²ñƒð7 ˜°ñ +[ÕºRœü M:MÑeéc²RzP‡-mÒÌýhÀ½° ¶5` W0†ïA.[Ö’‹°?ÂÝŒzX&õp&Vfæó`þöÕ^ +«oasêÍ<e\ïU‘ð \Â]‘‹0 ERµ”RªÉ!ÆrS8˜ü^‹¹‰³@@ò½’2SöÁ)‘ Çæ-'€ììmÙ¿'C°j\´€Ø)$zº +1V +ïKdÜsÊl"Rwñ5”Ê©Wâ.~v…ú:z>E<ËÊ<«Vî’$Í]”è½oYRo¼ “3|M-«’ý„¯K2ÅY"õ(EŸÀ3CN>\~Ò7äÁ4øUO†x -oå „Û10Ù^¯s]. Õa œªÁÂ[3vÂÌä~6¦@=Ì…8uçÌ`9‘ÃRUɶ*ýLÜ«riev Æ´ªâR>òS‹«6]}]q¬1›ÀR†B®Ö¬W ~ÛÒzv%,/gSéŸٵÀ-i0Õ¥O)ðÀ¨ªl§tÊ뫉{ sd\å€G¹¬a=’¼’s.ú·èŒ=¢k½šòÿ9ÙóîõîɾNDûç£÷{üûqýw—Y——Ù#q«B…´­i—ùŸ*­ ¾e¯V±ÓùáíÑëÝÃW{¯Šþ§O[uwW‹ã¯–Œ¿É#·Ù”,®hÂMEãf? •mI3eÃìãCŠ‹~‡Cð`M!µ:Dí÷i59a·@í¬™)ºý\,wžyšŸ/P†zrúWÎ`ŠJe7ë õÇ1) (£¢Û\Sß||;Ïo‡³m¶Î°`o\/„˜§,s?N4ê¹\vwî?N®PnS;V0yh‡›pÌsÑÈÀ,¤Ä‡–p0 f°°¼ÀÕÔr)tæ÷ù¬ñ̓ÕµáSœ¸ZÛƒ¦I¼æm.@zK¾Ø)£*†·Kb‚ÁX QJki/„[º·€l4("lN•w—´*¼uÃ7` #‹—}¼Hf’ }šê¶,%ií@Ę Ò`+À uúy´ I|%ý +ýGuà»àùê!lɨ¼™Œ'¹iR¤nT¨À‰è2mŠBGÌÛTT¢Qõ ÏYY¢–I¢£>0kÿµ×ñŒ’âu§¦ŠØ®(ÅTfI…Aw¿ÂOÎ9vã<—”k2"œÏ}KŠ.¢üm}]7¢ÿXç‘ú¤1?4–¿rö¨rÛ¾ “Ý(N=÷ùžQÑö/”@â\Ã^^tu9ƒn'âÝEœs£Fšt„H…_ qö]àÙiR.ÿVJ•ñà›½rŒ ?^³ópúGÖÿXs1·¼:²Tµ¢Oä¼ÎÓ¹RYݬ|:.Z´Œ¯ÖEÀŽ‹‰|R “êˆÔîϨdIž‹W.Lf/¤‰µ3 +':ý}ißMzóþdÿ×ÎÁáÁ‰=BXØL½MÆ›¼<0i<ªÏÕŸØê®Ã:Wþ”çòDвâøßív³ ùŸÚ›ígí§íÞ†ÏCüïÛø<Äÿ¾™ÜOžY³´  à—Pâdâ*ØlTz•ÀeÜQ˜Œ£0'x•èÚžtM…J:ƒãñ¿OvEË}Aœk.² Ã^iôìý££·G`jí½ höá[¾N½Úëî¾Ù§Ó=Dš¯É¸Øax;†Ë3¦yú’ðÚZ\Ç7Ž0 Ïd„‘àåjV~MĤöcC.LrK*Ie—kÒí§Ï 8^Q%£í›a›â‰i¸eâzÂZÚ›‡¾à»•[˜bŸæi¦± +=³%Tï1w/7,Þå‡Ib°10ãà4âÆNÞøû¾j4IÎ ªºë!«O[0äØ0*r¤i°¤¡ëÕºàRãñÞkâåfdA¶Åj¼ÜŽ·ùÌ '¸.ÙÁË|é ]´}ªÃY‹²¨»ÞàëL]x^gF9Éë³ðµóÊè¶0IU„bEŸ0~ÌÓ‰iaýÌ+n‡ËÖN°·'¥%×Á÷:| dfÎï܆E0ÔòÕnnŽq!ñÛ7/t€ã÷~ýí†ÆÓ8=ët܇oå3 +ÈúæàìŽê']5·ª«5ãàðäèàð˜ooD8×:Þp@îþjÜýæÁûãŸNðÝ=!e.š½SMÕÅÌTcA¶ÿˆe7Âh¶J|b÷Òp ·È÷Õ×]UÇ/åLYûf÷ûþàuM˜ +Éším>Ö¹Íþü³¨dR¹ä™SÒã.CË ‘Ó?ñý8»ÎPíï3Tûîé¤TÆ*Š2¶ÙÅéW“ +)hþ2°èZ¦ÔÂ3WÞýy3 +CÊ]Ê7ÄèÀ,êa8pî÷«m\ƒ +qŽ¿Œz“ ÉBŒäBa*ÓEŠ Œƒ¸&°Óh G/E¨p®PtF1f>ìp˜ç¡ù Oý<÷ÒÚ䆣+³š³Ì8¤ñ_fI®‘‰×?EÝø< Fœ"}LÿÉ÷[úXf¾ñ3g‡ +Î ³#Q“· ±kÐÿ ­ÖQú#’á¿ùÈX(Id¾lç‹Ÿ1óú‚•ž¯æ¸©ž°^0~{ÞßTÙ‹ÇÁã{܇†ðÏþÆžâœYEþ:áEêŸÞó>ÅþÍgÏŸ?ÿ¦ÕÜh>Ûh¶77Ÿ}Ól·šüуÿß-|rüÿZÿûwkíf³ý—u¼Q@wætçý§Âˆ³¹«8ù$`À+ôòû禞(øÐéÍãß—St~Ï>×ËmÉïåf:@˜Îu.V¸$ç‹ì¼Û=:9Ø}Ý9~·¿Çÿü/Žq=«ýêsIò¿r¡”‰0q²µ¥ +BˆÝó˜ï3O¶sªâ²O]⣟ä…Á4IPÏ+wÿ]Üy’‡°3ýOò*$¡«*¨':¤¥uç_›%OŠš*+n-?ŠºÂ²§‚…bîÍÒzî°„'—”7ªè‰5Ì拳3úñ²‰²ÛfÂen<è°cpîcDϱq"¡On­»´ÏÈé´x¹Ø®›¶ò¢ÙŽV–L)æ'™a>Ô,…¨ý·ÔÓC—Vü"”¥Mez¬Mèň›m¹•÷÷ûW1†O(y¨Èöy°÷÷q2vLnÅhY¾‡71NÙ<`L!ÞpR6=Új1²ö´Æ²Šc‚f¨ÂÎ9¬9†G·UÜeO‹†¿Ò:ãŸøžøäuçÝÛ£˯³ƒ_íÿðþ§zel­èœòåBÙµ àó\›1ƒ–ñË1x¥þ4*WÓôv‰d·2m͉Àz¢íã¢ËúU:á´$t™©µF••Ñv±9Ùa4+¢)Ç£»/líYªpÿ/ y¿»áÌ»ÿ +ûÿg-¸ÿ×n?m>ö´Å÷ÿÍÍg͇ýÿm|öÿ7wB¢.àêß;™U“ Ž)Õúx4áÈð¿|•¢û€i$Ý  +1k4ëCîªâú0†ÜDp îíC†ÂsôÙEôÀè.ÄIÏíôšz È7 ëÄÌ”ò‡'ÈÂøjXb› /Gû|ë¾·_d™ÈôØæ7U¸Òþ-Rû@HqyæòCÔ‹87-ƒ¾û’$½ü%ŽØl8Ì’°5ç%Y#®±ûñ¶Í‡+I§¯Å1,ªDš…ìCŒ_ˆ“'qæ´ÌÂ+«.œÎ㢲œ»»³~ ¢BÁ7 ¶‰Ï…³rð1×Ýyƒa¡Ê¢‘ˆú ˆcÒmˆÈs­Nµþ°SÙœÕÕ¨ËÙÛ}4›;øÌúT«¯‹.™(Ì©è siÂKR“5˜ÄNˆK3øµêjm%ªÿÖü°n'3¥~•õ +±ëÄÃþµÝ/7ëÔêªÊ~õåFFžzãzqLÈzã”ø%W%a%\'³*‹©[•Ly!‚—‘»%«ÄY®I;â`W Æëˆä ’²É3®ÞËÍ«l7\ÖïôƒÅз ã*ö—1©DàA>ZÚç‚€EƒÀ˜«„¤eÔ`©Nì$"8Ë‘tV—²èF_õ˜ÞÆ4º§Ãœ°Þáž{מc “…6g*ËÎþ¯Âþ?¸êœNÀÈ?«  lÿ¿ùü™{þßzþ°ÿ¿•ÏÃþÿæöÿöÌ™Óp\7w ,â„m1¸y%Q±>÷aƒ´ûKç.Êör·öN/˜½·‡?üT¬‡/Dgѹ¥G– úçq/;ÆÃ._x;;+c9axæ¶.Ã1¦›íŒøÄâŽæàɦ€xBKø^®0º‡d¥ŠÜÔàððP] ‚'¹§o:pñŒ¯³ß5œçp‰›?Ž;Œ¼ÃS þE{§´…vN ­j-l–·°™ÓÂFµ¾+oaN*µž•7Ñz–G§§F# +€S[5%îŠßõ­-³dc) ¿BU(‰ÍÓÑ.)¨ ßR®Sçx番 ß¿Ö↥p†/œg/ùB'N,uÿ…ÿ'SGz( +¸ð“ô4fºµ%‘Û"CÉ@ʛ石Ÿ«Â> –e•Ó‚¾V:ÐÐF” +ØÏÅAâ€J¡ÆN¤V5Ÿè\~ +ÞþǪ`Zx¶¶TØ^ØÇa Û4£ƒèÈÞ(à´„:v[Œ.œ’°ÉT¡ _VÇÊ¥^¡©‚­1¼úB¤hxþñp'v¨d¦‰=ç +&Ø!Z*ÇîP[n &8OëJÙÏ]‰¸²‘Œ®Œb¾áÊ^?É€ üC&F§ D + u¾¶DrÜMÒ—Ó/¸ýœÅz +œ"¾ì~ª‰Ugœøs‡è{½b¨vjP–Ð;#äÊY³ÛƒÄ&]žö![=èCÞz'1+×Ù.C31ŠSÎ’Ar½•mX³f1'bÊ@HWöë6Ä!RéU0ª“v/ê9¹œAA9!% Äº1{­2tJÀ”ʾ'yƒà+–Àh Ò|g ~S¦8AŒÏdÿ_ +j4qÃZÁòŽÅË †à†WµaÝLFE£yøvÿg™—Šè’At•n_/~S]zô.£ /e7Ó_á§hÿ?JøÞ²]u`YŸÝ dÿß~ÖÞ„óÿ§©p³ûÿæ3þçaÿ ŸÿÆø¿7ºõ7´×&ªˆ“Eºÿ«í©¿žÖà<¯{Tëýjß–Öd6§Iã‚|N9ìJÎìß½=Ùß;Ù…«oÑ¡½§ä­Ý&ÈÙ&§œ_ƒî¸c 9{Ëà}~ +»®o“¶…‹—ÜÅð…q”²ónwm“%ß:†áÂh„ñ2JÆ“ Ïþ“Ó~­þù‹µ­*AævZ£ýÞëâü r–‡nÓÎi•È`dÓë³ÚÉÖÖ +/ÝÅ…¿.v19mÕNVXÜ`ª8SéÚ·€Çjq^ÖFuV±ãØ€=¥ƒw6ÿ–KãÇò%ÓPMØÑPxCk;Øcì,\üa¯¼Û”ÿEë¿O”Í¢®ÿ­öFó9¬ÿíͧ­ÍæÓ6ØÿŸm<¬ÿ·òyXÿÖÿ×ÿv!n±Xöñf^Wü4U 8(i/ ~Žãö(ˆy.Êãê J× {fNÁZ³Áš°žÅEDVQµn+¿^C n—AèŠÈ_è6!ï—·GÿØ=zûþðUMgÄi°¬µÑlÖ­QÉ¿ÔI~¯¨Õžôæê g+èƒÎLäRÿ8ü÷N¶Eþt™¥EÍX¶+…µL ѱÛÊTâ-¢ÞRºEDl ¿5?Øo¨'àG¦ ï°DœNk}àh6…(7™— Ãœ¸x'! Ç~}˦¾;‰5é²vkuQ“UžêÂi^šåLEÄÐHƒ‰Éu¶d»öØ :Ãð¨ñÒȪˆÏ/‚´#pO³oe´aÏÃÕó¿Äƒ4ˆè!ó9VB¾vu ïF?´yZÜM”©hº.ìÄúpøHÍ!©dtmäÎtÎÌ1©1uÒL*L1:¢Q1·|¯BîYÔ¿E”‘b±¸´ivŸI¨ìôûsÅþó16†ã$oq! ˜˜©<Èa5ÅçlàÐVràŸ/Ù úÀZü[ÝåóéZ ÿ=á;¨>×Q*1».nŒ¾ù° +ÓÏ66é”#Ct†9ärZzòÄ‹vêb¿NW‡c+Ò¨z»E³/E BÍrk{^ h*¢«f„1.…âüÔÑ÷cýÈø‰ ­'Lˆ³ŽpeËGJÊ=QPc燇œR ‹åÁ2Ðò©3¤¶¬B¼ŒQŽœ9}J04á– ™™”¦–%BfÁE|µÉSΰ½,4dzœz…¢’iòÉesÍ@ÛJ–ÀFzÂæ…Þjÿ(Ì…¤epElgæ‡ ÇXxp…[¤x"¹JõÕûQ3Ú‚ +ŠËOŠ‡ŽÁãÃeJ—Á´ÄŒó*¤ø›Jô‚ÇDH‘ÃõgaÊ4ñ´ÓC`Úƒ–EÐ\¶@#=+ZÔoâã†( !((ï÷cÞk¾¬ð‚á5WÙ‡çì:—º1¶=£.ßvÕœZ¢èÚÓkøÖÖܱ.g ÔôÜqÁ^Á »Ì®lyÇñÙ¨ßtjÏÉá=¶×å DR%LHm ×íSú¢vH·Ð­Iµ”ž`V{OûV†#&¢ãúX¢yãEf8ƒ+€€àËyÍA™ã›C Y—¨@‰©ZlLAðŽ•óÁØL‚°UìŸë £±Ž Jé¶Ú§:+]íñ¯Ö2#ÞT(û®/a“:ç€ÐÖ–ãÄïukq›w°§Š>ˆ¥0tTÙ‡G¶ˆ™Úu‰Àru¯.+ÉP ‚¥Ízy&qmŽë¿cÐcÅ‘ˆzˆncÚ7 ú$sX Tæf>)ð¾Í•ää´6û¨¾ôUÄo+Ö‹›ì»’¶Ý sÝD¾X,4>ÑG}ÎS°%è¬ÜlX%hâçhôÁnTšlÜ Å©Ô–˜UyKžæºH˘ôvws‘AÓ®°vrlð`%Ž0 64I(mm‰d[V&Û«$ÀĪç‚ô¢Ò6– cÄÃËpá +«‰ÊFÂ)ßð¸ðñb$²¼¥Ã@ÏÑ]_ag{½2˘õY²¢¦ç(`®q ;Ž.CRbH%TR7vŽø2ÁIzÛ&l•œ ãLJŸà JVÁÃÓ û‘RQÚÖ7l®MÐ?—«JLÖ¨‚· ]´ ~âœ3Ñ=®‘´mùH³p{‚&鶮x #Ø Ò=Å g•€ÜÀÁE™0‹M—ȃ^{™°%t=†àùá:2D™™ÒЙªëgÛD…Ï"¶o­MÊê2{G±>2ú´-c´q³å©Rv ™ZÆ Rs´ŒõOC ®š6w§u}Y¥~{i­v!Z |Ú~ac ù4ɸFi͉(âŒA„9? ++À•‘nÐïN0 LÝtŽ¦mÂ_¾ázÏ÷ùèŒÖ%¾ð 'ý¾S”iÇZõØq}Z$?ó2ùšÌy¢‘ÖTNñš­ÇvÛ´ÚiÉ”ih4vZ©PÖ§zQ Zµqíà4„ì§è{œÓ ¬Tù4ÊÃ|Žº!oËN·Q´·¤–‚àõ†Òj+5©½èIßêÕ¼ÖÄÆ‚)ž˜‹] 59|¬5…#²»¥®åÛÎ;hlZ¯£ôd’‚ÇÅÖ;“bà +R \åf àÓÜ×ýßžbÅÜ,„yùËNØDUÍÉ ˜_5PUsÒ2ŠªÆ’ 7²e8c‘Ž9 s._5Øò[mIëU¯¸Ÿ…Ë©QO¯\…õ¸ÄèóíïSYM/;…Õ&|ΛÕôšQX-hðõBU³Î“M=‚4ϱÄ)cP#¿ÑõüBFGó Ý’…<Á¼âÀ•'UÄÃÔ!¥²0‡¢–Žª‡˜È”jv|UoWX¹2q!æû{L8ç4%jÊ­<ßÛÃ<'‹" „WrÍ¢Û§×t™„mÑ¥.HU´å-âÚ‰„šŠt»d+SY¡@«ýfa¢ÍB‹?Ù óÙÚÀXUm „cša¢³ IÔ†ñ•Þ८1¢@D×t-Çò‘±T¹HÈKbuÕl.¡·§1ddÙ¦F”^K$†R”Ï4ot·¹}‰ŒÅ‡Slâ…iÉØÞ(Ë/ÄÖ¢§Á#&!yž¹uN»øCY–UÞb`.žS/—ÓHÙ\îŽ8§úl,/ÎÌiÄçà{…€AZêŽñÆâxg¢Úm+þˆ‚0ÕŒPV¾)×(ݨ50ã’&Xž†!Ú ô9ß…Ÿ¢j + ®£Jv­5a1°¹rõxäţ̢! ×ÝKƒÃ؇@Cì|ÄL•s†©¬>þ‘]ß©­’ +¼¶½JÄ€±é!’µnÞ–…&×v(¹'\—oV܃ÿÁAX…üâ†ú#Óô…µnCÚà +"ÍÁi\á¨5ÄxÉå{Ê™­%üËEœm¸Âpje£ãL H˜gƒeH%êšÀÊoöà}¨F‘æjvÕl ¸‚øR9 Ãè’çš3m>®jÚ·³ + õvßÌT˜Ý-ðºäªÛØðu”éÒ¼uÛ]GZ§¿·,úÊXoŽ—y(°Ã7úŠJiUÕ¼Y­cr;g6ñ ÝEK]E 1ØÚ²}^ø—íŸ4‹ë)£Ó bÈÅg<<¡Þî¬äÎw_áÉCÜ v},–…RW‹¿£¨#Ó»LÎà®pjq5 dp]Z&T\3¸l »¡âÊuÇ­«Á2oÐkHã DRòùÛ·]·ŒæM/,¾ÎxɧÅ)âÁëjJ…˜”hÎ —n‹·¾b§î¶Ö%æ’?²zrKÞ<’El²ó÷êO9l~(æxPogQoW@½]‚z» +êíéP·´»WmÚÛzüTþx°¡ ÉX¬‚Ž»Éˆ2¦£ÿe7î‹„îàÍÊÕq¾\ ë Ë.}ö¹ +Õ =󋶔°ö —a +³µÿ-¨1K!çõÇðšs9\qËÜpët~:|¿×éÀý¶ c±0»ÏYCÜ,#ý]•Š†$@$sÙ¯ZâU&ªxÚÊ)èA-êP±5ó=ÓWÛ\ˆ?[~ŒÚùµ=µÑßla%Ž”Z¿mЙ’žŽÆœ’$–'KVÕ¶ªª¦ƒÁÓþªÅ„8[ó¨;A »ÁÿØ-¦LÐm¢M Ú’òV£âô´%­Ÿ/áÌE¿“¸lWkåðÓ.ӮƳ |¶ZPƒbÿì +-›ü›¸$ÕD7¿¨hÀ(ûEµ¹'<žöùv)òm…Q[aÔö#ï/:%òUÚ3.·ñÎîðJ~±÷‡àó–~. •a¡ê”fßU¦yp•«TŒÿOÛí¼¼–Ž‰­`d(a +î¡X³ª×ÉÏl¹•ÛPÛh¨ím¨×PVa‚`!c@AÉ:ûiMž¦WuÊì5+éOÖÊ\®‘Þà²g*Éž…ÆBÈ©½dig”Dƒ ¹¶Vs‘É[Tº©\l¥ÝѳsVˆb\ºh?mâܯ‘—[¶ñ³~Jï1ÿ×Åý¨ºg†Ó¡ø3øƒ&à¡D92¹*”aÔbqœ ç½'¾5 &}þ^}¥ûnZ] +›¼¼|¥O +)ZÑÖï·ýÙv0KçïW!%Œ@:¼0¢S”!}yÂÆ|)ãÿ¶í4 㟛ã6À5b{aP¦F!F_x^³U· kQv½V%ÓY°²~/¹{nTNÿ÷ȦN䇪…ÆðãwÖî-í+Èêîu¾ íZƒp -Xk;äÚ4 ëç®ý"öúÊžEbÿ¾Yµø:P³³£å†ÿyÁj|¢¿`˜N÷‡ƒ“ú6dŠò§ØÊÝÜgdúN-ª»}K#}Y`*°—)ˆ Å–ߢÎû/¥Âüí?PÕ#øu˜£„Ò‘·³,¥`Ž½E€ÍÛmÎ +ök5Ö¨ª‚.dý¬ÃeU9ËbU´kï‚^»a¨\ÐΆ4œä,4ø@f7rÌ݈æmçXvGǬ-¦-PLa2É—&™æ]âæÈ?½]úl”Ó‡Ù"‘^ð•gj×8øÕvD +“6}ÊÍ–æÁ°Ú`M¨/~œxÅð2LÄ­óh(Ø]ÜÛ2YÍ¿ +ÂV;_÷á87 + Ö*)ÙvoOgAy.¨êP(ÃÊ ‡Ù-ðŒçóFˆ›üóÔéG9Ç¢ƒŠÇŒƒiŽ9LjÔ耼«óuŠS·PˆÒ.šÄr¦ï`úU;ìU¬† XC¸¨sî¿üP6=ªØMç×gÞ²ãóeÉÒÄqµ-`ê$ëÞZeæe±|ËÕÛÏ/¹ëweåF[Ã8¨¬Šƒ×,Ú Ùpp$8:˲È<ª9ϼ¡fò”ÄkxUl +Õ/ý«+V$éÆ›òTª× œÛt”^0Ô9`s¶.èû˜œ„Œ®»莫fE~T]”»p+É>@»‡¯!ŸÑ9tÐHÌäó×çs‚ǨÍU“Ùõ #¤®Ú¡rü_,#I“çh[Õ *SM4^—f /€d*Œ~¶•lĵǑV7Jµs†áë;žwZˆÙº™ †š;›ôÙ(HRT!+¸x±ÿ&1£[ˆîu7Qµt.Ì¢$aÉâ)ö±ƒ ËY"s/„2XÏt¹Á ‚ƒ½ü4ÉèêƒÙ¬sOÙ…‚'<é‡a +bTÝVFH™+ÌÕ` ‚h¨ i–š·MY,cš¡<¯³\Ó †|YìÀezoÄ1PÃåÞ‘öw¡Á¼h-×ü‚†z5—u—)ÄíhÔÓ]60oN“[™}™º„¾pye¥pïAÜ?t|‰(U×!¼•s[¸á[áº<É]ÒWôE'¥§\E\ÖŒ«#îÒƒ! +éÉ{ºUðº—Aõª¤Lz'hš-+(]—Ír̺&cŽð±£Q²ö¬–¨ ÷â¢CX_Û‰z¨z´WW·­VÎhKâÉùEžAœ³Wvpà \3riaÛõ£¨tf–ÏÒ­?&ƒQ>=á­Ñ"o}dßã*¯5Ì^YpÎe¢ò¶£\ÚVÑ™drºwæø›¯<Ø©Z<²n¬Œ7ƒ¹F©‚B}\¸Œ¨#CigÃx¸–„Ý _½¹–«7r î*êEHÝh½JÊŠ4Æ|m, ®@¸‹Q*âÖó$UK;©©JŸ%O`Ú^ñ´TÇ ®ËC²ÁN'cjµ`DÞCHé@òý2LÎøþ:%RLZ~2ô;î,ga½”bø‘í½}³Z__ruÐ4¸„E J87ÂñX¦ÀÁ³£¾Š®&#.©åZ„lÔáß¡BýŸùÚ/iý]¬Çççýæ]hKMÛÊÝýÈd˜¼B‹ QÞ=.!¸¦U}/›ãxÈ ©·[%õ«^¦ÐH4šànGúÏÇp–Š6²!úÒó]‘QïrjàÿZ É0R~¹ DÑ@œòÙþ±hd0\&RqwØß×Fçâ²Uã +UþêqÊùÏâ"ÈÙi‰[¹ã÷÷±zänø+´ÃwçÍYŒé®AÌÙçÔ¡î’ E˜Ö”L¸ªô9Í{p]xlf,&'CqTPÜGÁ2¢o;ýp»…d3%0žœÓ'ýòEÒVœ žÖ6´¹]µ°Ø47Ëë.¨W@ÃlU‰6¶z+ÉQvè‚#ÁaÌꆣ±c²üì=@‹püÁ˜àa hm‡††*Ô*ŸsøĘ=ôÄN|§C4ª3$cÉÀ×9²©Ìá¬>Æé}PäÓ³êX¡Ð1½h +ºŠ“JÑC÷¨´‹ÓIÔ' 0#z¦vΫçñ–^1/e.sÑ$U™ä\Fw³Ëu³Æ­k¹èluÙ¯‘ãÎ…u<êH KŠZ?@˜2°ìnÚ¢P£X§ÂrU•_l±Ç\ 3zæÛâçà•Ûjù7‚lú1Ò¢\Ÿ°Àèã–?6ãì@ä~l‰à4`Æm´üI )u]ÆœÀ¹ê,3”~É–`T¡Pú(Df$„¢f¾ÔùªßQ÷†ÉËêõUcÙ•øjm6Ê«ªiœ|,Jì”|´·jÕ–g.¼×Z¶H†ã²ÊuÛùGå9vDsoª ÁîÕ‰eÕX–ñ±¯¬Ê•0V¸Í‚S©¾{÷bÄXæx£zD< ëî²ùjAè ‰Å£˜¦¹+.å ÷áØ‹JkšFn{?#bͱãÛïS16o¨<Û¦ŠÛϳH㳓[zÕ@»*çük }¦\qÔGÎ2U7ãGp@=°ZN²üª’32þJåU-†)S‘#pƒåri|‚ƒsú 3Í25¹×ZÛîKÿ\Åè +`¦’X%v¦ˆG02K62-²KˆbrmÝ Q,ÇÄOŠïèÙ^fÿu£•ºuï?s¯l0¾î5¾f°+’FYÓr)ÉåòQDl…f\»h>›ˆ–!iøKÕì´³ÀÛ¨ÉɱP̦¤qõŽ`@rä2oèˆ8lPˆíÝÃWvà ;áˆu]§˜E?s˜x²âÄú£ÊŽÙ:Ð{öö +3dùrN;º‰ñ—.l~AˆÉ€¸Ã]4ÜÑ>À•¿üñæëÕŠ)°VØ삽:Vþ `1 Ìh}7˜m‡YÂ'X“Í;†™rû÷9?gf° 2,wÉÆЉR¤äŒ¿â +ræЩˆR Î@t,«#Øù&+Ó`™k%ÊÚŒÜò•–ÎÜySnD¾§r);:Αàoúžéw+õ7³C©`ƒ *¸¼ÁrTÍ<ã9V50skSˆþÞS?PÌoß7i™‘¯hC”3bYOˆrŽvgYNI&ÒAŽ®!eõeORaÙ3Uõ©&šYá}ÉÞãô|³û«_.çàéR$Rá;‚ùÈ*ˆHæÊEßÿƒ©DÓôc.E5W ðaT"È3Hé$°É#Ͳç$q¤½4gÇ0KK—¡LäíïY).&Cðœ'Nã«X¦ÙÈð'‰ÕMxüU!g¥5I}lñ—C15ƒOÖR?®º^r*Ãiîc +ÏtæÀ Ê?úŽ,†’¾¢YóôH¹Ë”öqÖe(Ï|ê4©#ÁÞ3 ¯Ðn¦¼ùûeûúba3»^_Í›m†ä¹*bº€Ü%³s:9E3>¥Ga7 +úÌ1®/ȹÔ1f•YbXõÙ›+a‹cf²çFŠ¬à–bƒ¶&ƒ—ç —Ïaè–laþ7Ù›]Á‹•WpmQ®” .)[òIÅU=|SúE•¸ŠùKåúnûöÐ}!B4È›$(Å«$Â@­îè¡óE$b"¬öO«&Bʸ¾Ê墠y®Á ‡'uBŠËšJ €Aá"`b%© +Ž/‚&‹IšT€X~*- Y@tÏ-y§.voà„zÚ|½æ‘³š/pŠy/£!Z8¹fUåé(‡! +FôÖç .Õ ÄýÈ¡œZ¢Ž1à €V I¤QÅŒ.,š‘éÎjßškâÆ¢²U¦šqë±^£ÎJ æšDô£YGñ"–ݤHA)ñÎè2Õ¥%žîWÊ­X–}™Æ\H®ÑØ[ø¢h×^¶e/ݯWÛ¬WÝ©c§Ç­—çƒÇ—^Þ{¸zkÚy}‹ÝpT‡@jÐ=z î S‚É×1a¸n•¦“A(fß³ñá¹ Éüñ0\Ï$ÛI~Ùꄸm1á[ñ'Êx‡óäk`ÊHsAfs„–i«¦d¸©$ÏÇMÉqÇm*–³¹ãÏ— a­3Vç _jÖê\Y¾öù.œ•ìÔ¥+ªFØ]„Ýœ% …¿B„âB?‚¡ƒ#ŒÕ”­“ë+ÚU¬®žˆ<¶Fizlú7 ȹF䕇K$äWÓk»rY—§*ÍÈYZ½û(¢JÖDŸ¢CÙÓ8æÛÑÉêÅB>XOÇ’®˜Ò¨xã—Õ[=…¬x¦ºjL ÐR½±MJ‚„C¾’&x{™..Ô™Ÿ@ËàÌT³– m('t¿âçÝãÎîŸ÷w_í/ý <¸»ýI/”0øËã÷?þxð«Ì“!ÿ~óðùê?ÈVgc£Óz‚?žà +øär“¾th±Y¿fm£É?Ï67áoëùÓ&þnÑoøö´ý´õM«¹Ñj7[íg­ošífûyëÖ\dGó>hŒ}sÎ{÷ŠÊñíïm t»Ÿ'+K þc{ñè:‰Î/Ƭ֭³ÖßÿþÝZ»Ùlëÿ‰/†ìMÐëÅ1K¿ÂAÌ¥@Ô¥˜ò Ï@BÞ$:о I'§„Ý1Æ̹ÔüxŒÇgã+(ñ:ê†CöON^¨ÖZo®³Ú1׌‚." +†× CϸÐÃú¯öö÷9Ë6×ÇŸÆ ƒ„Œ®Áûb<m=yruuµŽœ¼'çOœòuêÀ“¥%]ç{ývo÷äàíá +uÞ²jaÀ= »p‚rI¯ ?¼Þ7ä¶=sD™rËÛ«oˆ6¾O$(^rG}µ¼wtðŽÐz—Ä—Q/L-¸N„'Äã +÷¡–îGû?íÿÚùç¦ør¼¿{´÷sççwï–þÆ ÁIBY9#ó ­ŸgY@Þí› ˆ«”ÿõ¢‘ÇCêæ»ý~Ü5ä›M²ÔLX2â–õ Î{™Ë ŒÑéaG¸Ÿ¼°qRØì,³·¶™9ʤ Z…@+dÀ+pÿ Ÿ ÀN©cõ×H{ÒÔx+BdÉò‡X| ¸Cð†§ Õ ØÚÉngµp½ 2ìÒNµ“”mäaT»äQ˜ôéîA˜äQ@õHäH +ÆÑÜ6xETY‡£Ä1Ó'KènÈŽýe8Œ0Œ5Î<ãó«ÒäðmçÇ÷‡{ ”:'ûoÞ½Þ=Ùï¼=âÓþàð'íÃQ +6c®ðSTºß2À³8jŽR3&ä̳És˜,‰€tý˜´ç5dÃÒñU á;Ûá‹(Ü9à ™pÈ"…ÉUlVCLÖ·ŠÍ™™¡ã’èTYÖœ°â<óEÑˈ¾I`V¬2 æ› +b + „ýãÿ°Ueç¤`ð¦n1¨_+JïN'JÏÕˆ,tgKÒZ<ÞåtI}t±‡DqË AØè¡‘˜«ÂøÍ8ps˜'Ÿ;J˜÷ªr~ÉYÉåBÆ/ãû."[…¯±[ca|IÝ`Z ;W¢…Lkl<Ê]+ôzšþ¡Ù`{Z ‚ý™]Û¨p#Å™œY~A²Œ&WhÈ—±ÈUu¹º]&¹Z4—(ŠXŒ¢ž–ðJqï§é÷Õ r‹Ðþ«Èl’¯9âY|RÅ÷@~T¨\yD»®^Í™0õéW2Áyk˜ø\U¦Ò­Ì JëŽed¬´u¹ñÊmlîæÞVäo§vÄ|ÎœKTÙÚ +¤ö"Ϫq2ÃC}d]m+ãV­¾£)”*z‹ËŠö;ÓlbªÆ#œ_ï¿ß:ûô +û-êç÷HkÎQ™!`|fg«è…èÏ7±¶•®þ3*Ê”ƒÕ$of‰+W–fUo]™ºnJKÉS¬TâšÛשnˆ™nžZ‚i0IJ3ÍŒWîvÆ9çÐÔ¤F§èâ®Êþ¢Ÿòóßó$Ísú[zþÛj¶6ìóßÖóçOÎoåópþ{sç¿ræ,öô ÎröûÓÑþ»ò“_UêFÎ}Í“§st»’—ÜÀ +”f\t‚Ñ“EP&mF>sâbÛ¿'xHEÑ a»02”wIØΠ冤²Õ@è VðpMæü¬üâã³8LU'×"áÑHfÝKŠÏ­Ú*e‰P«š@¦6X¨¦9†5ì'uãÉÐÍ`[,,ÿþÕU¬ erÎzµ'U1¦{Ò}ó¤ôŠ +áó˜ÅC lð[óƒHÉ`U¾æ ”£6x£p¯Rá { ¡tœ\ã@³yÙc“/j¹Öf×Ŷ§n9UÂ¥¸¹èY¾•W09'€†k\Ãö)}.`ÉéHZU>Ü1æ³? xæ)0æ(†(µñÐpË,ò[ðqç˜6°mó4Ÿtà*2Ý40„mwð)·ÿÂä<œË\lÿmn>o?ý¦Å_m¶7ž¶66áþOk³ý`ÿ½Ïƒý÷æ쿼_/i&ˆÖ!žŒG|ï˜ð¿|UÆWò^8 _†ú|ЬO<‚eÂd®3vC¹a³ î|‡\Û¾ƒ^˜ÝÅÒÓóA;½¦Þò` ÂJr­Ša뙲øªš‰úÍþÑOûå6j]ìV.'½EJ»Æc÷7é ÖÆNmålÌ«5çÍ|]‘9–ä +Ñ4™_nN»±µ›?ªgÖ¨'×€4̲¸‚6ìÂÆ®¸zŽÝ€WÊÞÀhåòÆrÑM¹`L‹F+¯?Vëe]/Ø®-|ÆÜà„I+ͯŸš·ÎÞ£}œ¹(N¡ÿéÿçuÃt>÷2ÿçÏ7ðþ»ý|óéó§›àÿñìéƒþ+ŸÛÔÿçTÿ¿í_Ï›îܪÿ+Ôƒ¹˜¾ˆ!ø¢Þª Êí¤D™Ôi}šz?:M‚„«ëœ÷@Å¡LúˆÌÍb, u*õu:ÑÂ.a+Ùu> ’^ZÁµzŠÛˆšÑˆoÆÑŽÏ8ŸÎø¶³ÿëÉþÑáîkuŽvìSç#5±%Ñ®ä¦Äi±Aù0á;:Ž,áé.gÔ³0ÓÃéLßD +#ž¨|oÂJ>*‰ð4ñu†êp“„3Ê· °-¿5m~`'G»'Çγ ’¯Yƒ‰¨‰´(ÑŠùÂÓòŽã~ssCZnÜõ©CE<`áû‰Æ`‰q­ÓùáíÑëÝÃW{N-/3ë Dmÿô¬Ù¬/`÷e²D98<>Ù=<9à\%øg”çƒ@$|`£IzÁÖþçü‚³@¸Wû{¯-µÃÇ^ªïl—µÍÞBIÉÂ_X™£›ã“WÝ×(“Þ•6ÅõÉ9^-Ùn>+)ðÌ8àä‘fÎAŒGÆð- JUŸ³°}œñæøŸ{uÈL¡û`ïu½:Æ„T§óÓá{Îøâ!S3U X§~C‚ãxÈç|‡x»â­¨†®¹rêЙ¦’DI÷Ϧ-_f‡|­Á ©û_ñe;8åòs‹m¶Ÿ¶ø?üŸgÏšõ[˜LtæDoy{ôÝ£·ï_£ÕàÂ¥µ²e¡óNÐñ/9ý¤5›ñ_þãý›_vö¡¯~ )žóÂû¶êõßaë˹ÀOö_wö~åÛRkL`™—ì;>€pÎñO|Þž¼î¼{{tbOLþª&tu1S÷Þ‹Ùº·\¿9®Ên6³C–9мEŽ› Á 7ÎØM—S«ë(&‰„È™B¶Å£ºO&:²s2tZ+…Á•$Ý¥¢C¿  éF}Š¥bê%A/|žSxàà’×ûõª“Àò³æ0—·–pÌaôøRÀ7.sÌ0²­Ÿ¢ÁéIJˆeÖ¯o/4—iÂöi÷7FÌHRÄÁL@0)"¥tFI4à[¢Z¾ðµ¢yÔ®ÓÛíûÝÑ¿jûqüq2êtùf†cü~³=Å8Ñ3a +3à:ú‚©èÆ“Ÿ›’ +è•AKK‹§R?¼ÿé§uöNþõn¿óãîÞþIQЩh6‚‹ ÏyX²nƒù¢ñkÌIÛÖØTѽßÁ4gZÆQ>i—í0>òÒ‰ º_½èS½”m g´Š(ò%<èÇçcJYmð¼›­ÒÕÚ„ f»0rÏ™é;æ6ð3;Í“Ÿø>ó¸°a ý<˜ŒÁ“¬zÓXAuÌQxr›³vW•7WË( fªºµÕ‹;|ZDçÃÚ’yÖ’' Ê µU!ãÄ¥hpgÅœÔìF‰«N¯ç¡é9&ôb‡ábáÅÀòÏC´¸¿}}zG¢*ŒeO¦Ô ÷»ÛÊŠE2éŽ1×”ÝõgCØÈù3 ,>wIY(ïGgÇ^'qcî¨^ü°÷îlª,ë>ÿõWþ¼Î¦ØàgŠ:–„ì{ל–pX>¬MnvK«Z‚”]…vþ?Óîz +i0üEIŠ¯Ö1ÔYŒ|ùŠI7“¬úŠû›#÷þ6« ªšû‡ãý‘sŠºTݤÈÿc²Ñ&RHšÍèR–ÿ?tò?´Ú­ÍÿÛøäø´›Í×ïYœ?¼“fQþßàÓy¿ÑÊ—pÞPäkí/|[Ù 8¥¡CA_ÅoX¢—8Ö fg`”Å…ë^Q¤ˆl“è*A R»“ÝG°Ô÷Öp]nÀjNõ1m¤W•L*ÃàDâ (‘\Ï…`\$Ã÷IBC6|ñN»i*h…ÅûAçFŒA.’8 "ŸKK£Éi|F|¼ïŒMÍEw…9TA52 +•Ðɶ¶x§Ž¯Ã¢Á×VFÒy¸vVÿŒWÿQí@}ÎßÅꀒ2š€f/é… % <@Uíhȸð$cЈ `K¤Q­ŒbËèß妑Fo¨—/Ù2¾”¨™IÆÄ£Úr®ƒÝ©Œ +·uÖ­ÇtÎR  |Í¿ÓCá+“—+¾€¾B„ŠÃ# XOí‚:”‡U’Dòígü³s™ñ.Ôˆ6²Ã4a5µ! ]ÍI™Ê ÅÖù<8‹>Õê¢^2)UCÎÊ ˜ñº—à’ï$Åý¼íSî=æ‚—3,^³cXpt!¾2hŠ´ã 0Ê ú‘2€ë£ 3¶M ‡óküìÞ–À=O%8\ŠwÑ~vŽ˜óƒúI`Œþa¿)?3ŸìVqå‘ UûŒ’èRæ¸-ŸYt*N^V‹ íoÏ»\1¿ €\d—P¶‘L¥¬øB“Ÿs)ÌÕ¨žÆvœ›ÎòU¦á¯1Yya-rÈ‘ÔÖ–ô±ì’yÔ€]}N¯ÌTk™oÉäGjŸ-npÕ¼1ÎS ”A;½àB¼×“ðn‡¨ˆ±Ê¢ê£t‘)?¦êâƒ[I•ñ|.ƒþ$ÌÂ]8'”F›êã÷“„xGw0ã óÅx²ÐåŠ@ù:Co3/ÜÜé\W…h0çqrh{…_MèBÙþu+ÈSËNË2–Ê$Õâá²÷m²•¸ÄØæ¬Iÿƒ$ ®õ]0åh'èˆC,…‹à’Ô…áà”5p%>ê÷aZ„£1oôµ+pIÄðÉù†ÐÁ€ß\! 1¾7¯¥2ø7…xCTD,±È ^íT™øÐ-í +óï“(í ,QRè‹wÖ*ëq—óoù·žýWž·6Ÿc½¹ìYXÑ¡ð“cðç"•<ç +mü¦UZG‡Ù=„—‚å¦@Á9ïMë/á8LXp¦ðxX€Ï@ dø`É¢oᢠK" i*®ªÐ[—xJ?‡Ô™ °Ééšî; t8䢀Óƒ5ÒÖë2ìâ>i8öžœÔp±Á¦°€+ ~o 0½ÏGD}+tþ(rúÀ­ÃÌï@Šÿ™1¬.ec nP{™]ÎÚ‰v¢v Ç6¥âO^eW\B Pö#.ä®ÁM‚è@.Ž8ù¸Î?òÎó_pÅ.ðó»N°·—­þôéÓ¦8Çpד›gž“er‘òjV¶qŒà¦pâU¨(‘âø„«Â{Ýããý£“šŠ4 WùàCÂOٻ͋ÑÿåB‘Àvà{ÉàO|V;©³'ò»îâoÍ +ׯk&”3$ñ?/ €Ûlu5òXè³³]¶}p-ó“Ùkô›íîÞÂ@ƒx«-k4ë¿í~XÄ€Pqïp1Ô#5‰-ʧîPeÂbx:3½sžà%œ%³=³€3¹$ó‡5èeúÛᨼ֪³ï™åÆ)ŽžZx¬%ŠjZ0e–3ýíäá&-³S§ ô¥“nfà]çA˜”u6¥ôkéG‡Wæ- ¼¶›«†½¦Up[,œ!·ä¼¨»æuc´_{í"‡êõ¡ûª’×£¿ÊtþætÖËQj—E~ŽœÒ‡‚û2c¯X\mq!¡ø}ˆ÷4tuõÐ3£ªN¨)çÒ¢=5óó#;.ù2¼¢Ø7tÌ+¿d•Œ«e9ÉÊiX’ÔÙõïäT&v¢Ñ/}ñ†ÆOÉBI)Œp^ °¦lÒìZ++á¤x”@ç.^3 I¯ßi‰hÌu*®7—ªc/¼-OÔ2»Å­z¡–!“õ@-«1ƒ÷iá•>¨ÕlSÙσjæóWóAµ™=ã‰ê¼žÞµ²ó©À˜ÌKdÕã[„ìÖ«’S*}r]Se S8©2ŸcÞÝÒ*Ï®Ud©X$õþœô{0ŸÝkóÙ¢˜¸„‡KÌk÷Ži‹ U…vª[¢hÖŽå3cÝ?¢~V@½Bu|j¯·zEµÿæoxÛû‹Ý(ëãWv —îüN€³¯¬r3À©òp?À&HÞ-»”ÇÝß Æsc`@îíºÀHÿ8™>KâÌ-xž@&o¹YdQo+ã˜[D Û;×+¹‹®duÿ›sÖ-èFîµs×0Ío[y×¼T+¹¬pç„+¿Ä¡Ý”× +gN +^m¸súÝæ•E_|ðRÎë79>·t!¡ú¬×"æžU®HÜ›é0ÝÕ WÄL‘f¿&j³´[Fî®ï×Jß.öx_çš9M¹˜ÞÊ.~QÈ‹Zmï onÕm°éü5,·1l÷{1¾½éSe•¾wÓh¾ÕÚ½š ´XŸóö¬ŒN=Ð Ýس>Nou×Zv +óµ®Èw´ðÞ#B~å»Ú{Gχ]n…övÆë~/´w¸žÞÃé²€]pá&øåK¾Ê¶üô0uŸjw’Àw™µzüô¯ýStÿ¿ÌóÝü”Äo>ú웵ÙÞxÚj·¾i¶ž=Ö|¸ÿŸœûÿ­¿ÿý»µv³Ù~0Kš9ݹ¯ü¿ +¹ +’„©ÌLaæ ÙA’s%îFâ¾gÆÃðl2ÄíLŠeQ Óuv§Ýa—ØÁ¯éRßECÞÓäš\‘PVéNäI + _^°!c¹Píî½~ÿjÿU&º€¯Œ\ :î¨?IáÿK¾ÜõAŸ.Þ÷bpÙ’ D4d{ìné§ù# ì½=üñà'Švà\q'ùÇWȳèܺÚW¼XR–vÀ},HâÉ°gß™÷Aþñ—³«^)n"MS>^B5@ý«ÚÑî/øz»TÜÓ0IDB•R| ~³{²÷sçÇ×»?çƒÔZÐâФ¾'ÁUç5BÀw»'ý_÷öß@c®_ ;á'ÓP>¼û¸y«8ZiÜ.N5j¼ ¸×¹_"?„• ñ/?ìryZF\¸ƒRžR¼ªôßqþ®Ÿ#{°§EL>lC¶N wïh_ÇN©¿ÓMBfšvÞí—ñµÙÌ(HÒΖ<òþ1‹ÙDÁJaþøöˆÃ«2!?q0®.+Žöß¿.c+èEØïŽÞžìï/+äl+>Jâ1×jÂ^§ËןRèˆvÙ°™i±,ˆ~F-¹*pñê‘9ÿ¸¨ðeß=Ü=:zû‹›®ÜÇ*!{—7/%VõIv½E¬|9˜d«zÉ5)DØÚ|(ürðjÿ+§ˆAOòx¢º´ùr+Â^ûí ð(YOêE„œ !ÿ`ØcéEœxéùþø/BÍl0#ߌz ºšò 3ut`9iÕ÷•àÑÛ¡‡Ûù§Õh‚ƒ€â)À¼’@¼Â– È:¡èâ»íœ¢Fšå¬Ù2UËzâk]÷¯*`p•‡Â•Â¡È”+›«¬RÕV=eT:Þß=ª˜® +—B¶ã³ƒ4cÎo<¡ßŠAgƒÚU£ÇOGûïªÀ?OÂQu¨èëݽr]ý¯ŸÝJ©àŒý£Ÿ*A„Éy9Üãw¯*©C|¯¹{2`O[ûaã¹€¹TòÉÚŠì™»}7’ÿ±¹ñ´ù\ÛÿZÏ!ÿãÆó§ö¿ÛøäÇÿ|0ýÍnúÓËÅœ@uI‹{Ä$ ûp‡‹S|êU +é³á™®÷òØȈ‰'mwÅë§ÓþOoþ• Ô_Òwj½. *ÉqätG§})W‹Ë‹ ÓT6«²é2›uæô÷`g‰\?—p~Žp)?ç¿}¤é^H?Ø1žIÉÉøëb¾rkï-© 5¸ÏÔ  C ÂŒÁeå¶"À²4M­‹Û+*\WNÌ_§)Eç+≘Ü6(B”:”õR¹C 'âà8‹&̪˜„§Ñ°gÞ呃bäƒÀÔ‘ñµ4^@v„ŒAPR_ª ‹3¼9|)%ät‹™ì$ðBnÅqÜa² ?ƒ|»µe˜ÿ¡ÿЭS0iDqÐïyuTÃô +BL9#¨šC$Ìì;àa÷ø˜kpo~à[ڃþ·{}ð¿(è}䦽ˆdX?É5¡Œ]†NÚ}×ËøÌŸÒóßN—v]sœ—è›OŸ=µÏÛͧñßoçó_{þËnA 4¦Îœz žØRäN”ÛC®Ê‰\ Lƒõb6Œõ (Ýóï_¯ûôAòRâƒ3ÅÉGî"ì– ¸–?Lá̪–uh”¦ØeOì¨Ð9Å¢a]©3£ +§C·MùÉc¿‚F8ûv¸š9àsÛÓWª¿Ì$í!ú¬:o#ü¬Œ(©ƒÐñ; Ò,{ñ’µ<·ëÓu®}¥a-2có&aðѽR¯8ˆésx§;º® VmIZ‰ßmÑ8@‘g$f€ëð„@Õ žCrxÌ!~*Š‹3!²å*Ìåà^ÐA=-Tõ£¶ªXó%mðO.½ÉÈX+l$Z?O'g r_уßôÄ¿iëƒpõ•=âå†éÌmûvO?A®\îæ€Ï’0¬9øõø&gþö¸sŒ V‡bGS×ÓÔZÜî›oi¹þÏWÀîǹ¼@Kü?Û­vSëÿÏ@ÿ‡?úÿ-|þkõÿ[PÿÕÌ™×,ÃrñÆÙ5D)­±´ /Ll,õêû‡1—ãâ„Ü9xÝH¹ú«ü¢2[ŒÐ)‹¯ +3NŸìîý#Wÿ×ooÔYs!¾Sl!æM|$ö ´²ý#Œ{2Äg¸`À3Æ10)Dó2 +ÃOFñÊS<&ÚÖ]Aî©I¿Ç¸<“úñ¼•r²³ƒ~Fœ; Ô!G"ÑϺ…ç/E/^íÿ¸ûþ5ïÍkœVo ÿƒŒD,úðÙ¢Ö0¢‘R‡}+c'-½PZ&yW(v¤mQ>ÉB~Yc'žÌÏ •-°}š%äÞ¦8yHYÌ‚yâ†Ë†âaÜ M­~¯`Lx©&sw²”шbhG|Tõk#ÄÅvÞÂ#‘#H¦wâ ÎCaË^ÂwK¢Ä`4¾¦„"…™`PdÂ-q i§‚LÛgvhÄXøtü­¦ÓŠ¬°Ö3¸ŸDD¡:[ã{ rD>þ i!ûH=UC»ÌsncP D¬ZÑAÄ–¦ÂLÆHL|@2ßóf2äŽÂ‘ÃÊtµdŽ4;å€?Rª»,£¼ò9Ý &ŸDø¸í‚‚ÔKn[i›hÖt»`7x¶)· +&Iø õâÑ!ZÿÄOê^¦uHЯìÀk’1¯ˆNx™ W£Wë;]Îd/°ÈNM“y] J(JÔõ°#hÚéhk¶ÖþÏ2³j^n8Õƒµd}V'%Ulµ¥Ú0ª’¥è¥ùsQdÀ¯Z#ÓÖL]"6<ª„°ÛÀ¿xd‘!=N?›î2£ÆÀAö%¸R`þu,mò<Ž{•Z|䶑$í9-ž,{x›¯n™t%Ó5…ÜšfyšùxàûÛB&W*,ê Ðˆ¾.2{!—ÝñuÍ‚eDlÌ>/Û6“$fvÜaîdiw»â’·¦˜&¿o"UÍÀ”f× NOÖÖüÊn¨V±GAâìóÈ*s;K$ã]í'»tøV ê–±Rò…í+´Jᦥ Ix2P˲\ñI‘T6 +®ÔU’½øUJf k•+ª¤¸{’8þQ÷“L"Y˜0ŸäGØóͯÌùšŽp³Œû¾:y{¼E¦®s¾¡æê“^6áŽ%d›AjÚë«(»c(Ì ¼,AÂvÛ©§VS‘aæÀXH r$mœ´0wC714–&åJ¼«òòrÝ›—z1ì«ôP‰)Öz&­–ÖPŽœžënŒ)*ƒ©FrT™_ýÝWzõœã¤è…ƒ¡h‹Î‘hq—‚ Wã­‡ |6¤/63¹*¥/3é­íª5ˆ\PICÔ¼K]Ô$äNngr™Õñ»êÏ—Y ŪY¼‹=Œ>÷ùSnÿϺüOÛF±ý£Õ~ñøßf«ýlüÚÍgþ?·òÉ÷ÿÞx0ýÏnúÏNš¥ùÎÞ%ñeÄ·)^øÌN Vd‡/ +{ã³Ì†Éq è:!™ßo›Ö’'™(ÑL:Â|ÿCœôaŠ@œŠ (WŸ5pÖü3J'E°xÖXR©‡8WóÍA4¾À©ƒ1µÇ‘ÚäÅ ĆŠª + »+i°Q¿3*¯×µ¼)À vœO€oÞÚÐJ¿e³FÃÍcwèõºª\Éka•œ¬Ì}‚RšjGÄgöD¦â;7ßs.éÀ®»µùëÉ;–U2š)uÌ°s™ÇD%yjâ›òNÎ@f]sï rÕ_€ÌKäW-Ÿyü€ûë’fNMˆÙ"κ“$ŠõpßäÍHä|ÐÀíåáüïMÂRTdœqÈS  +34‰\BÂK 0;µ#¤&ˆŽ×æý` “m±Ù„ˆ¢ø`É¢¯¿¦hŸ²ÿ +$MÉ/K¼EXú9ܦ¿.°ÉéšáâyèpÈeE"b eâØyÁC–×m Þ‹ÕPë¢ËOŸ]DŸ5×úgO²t™£çFðÍ‹x9k0v_Z»„c-èúòünÕÅú¦ÒÞÝ g”䴫Ʀ­cõ?ñ.þTÔº­#ì^æý",üâdGßÕ¡z¦*¹ùbIiÖu~«»ø[S§žwSŠámªjSf»•fæ±l!Ò-ÏÒ’L|{‡7=ÊÙ<{{¾D{Óv ÷C:3 ‡‡˜§ÏßmôK°p<4OBÑ£à%•’Ï¢³šG¡†/3ùÖ±û"/:¦yƒ‹ÙÎY­1 UÍŽùÎfM“î4g±*ß=œöxvr¢[”ѯ+'D·š«†½'ºh™ÃÏâûâ¤è™¤‡œ.25ß2¾ôá"Ïš—“"×vÐÁ£®ê¬[ëF¶[ ±8„Âx"m¿FÎQð—[äP½>t_!S4?ÈŬ§yUä 9uè±aÂ&êšY +1ëQRFjŒzl(  CéCÁz™×£+ +®¶¸PÌ.¼û=ü¹ºzè™NUgÓ”éÉŽšh]1´C>½Þ mœýù’=Y!™Êk_v‚Ë ê³?Wžä…[ÆãÎi|ªœMråxıoøXVzÉòV˲’’Qô¤c¾QÐï 'ý>'3ñ³Œ~蓇74€JJ2HQ„5e“~d×ZYù&…£:‡|tñšYDš.‰•£›6¶J¥œkÿ~Ë„™Ü0Mn¯Þïq•÷ä_ïöwßì3ˎ:$ã ø­BDQ•g÷P1ÎY';¬È²7gŽO^)s%4¤Ü ­¨ / Õžs¥è*HzV$“8ev£OÊtfRqµI¤sé%ÔèdV¦®±Ìô>^*nþ`8ÐßFƒ9)¨dÛ¢”ù¼Û¡´®Û>§aõ)°xe?96°Êƒì‰Ç;7ã +¼(F0'ëü¸Ÿ$®š±R¸pMªt¹"P•5RAgÇ/o&—ÀÍ„mA´ó„tMx{ß-({þHgS(Þdêõù¯ß¡Ê²nøL'÷.kýƒ±îÎŒu‹âÐ-1æÝ;Ž,6‹å[Ån‰œY«™Ïhvÿ¨êXÌ +Rù^e4 à×:Ë_²ªm2<6„Ì„¸®ì`ÂqŒCª­ +iÿz¦ [#ú¡±ƒn)à]„ù*kÒpŠ¸ÕœˆA”­•L3õ:©"Ù>š®ƒ¢ÁGµi÷ÂÛyÆÙÌJÍE M=òCXQÖv| –k&¢ã.ËêªmZêÆW5ÓäÑ„n °dˆòìæ³Óƒe¶Ôcy7†R`¯2ñò–§]?‘ß¼`?° kΦ~â–…‰ÙÐ3)a¢€i'G×kñpí*á8h"™ Êf’#ë“aôï‰ßÖfL ©•šÅ¤®…í:'H´¯Èv1€âÐÑ~€e‘¤ 05JÏŠmA˜é|s|@¬œ‚Ò¥CD¦(¡öÉJf›ŒYè +ÖÊB®—ù;âÛJÁ>u)o#ýØÚIçraV ¶üu¬žï@y²B€Å¡¸Ì1õh•5°|ïra´ÊËÔèI#ëÙy¶ÕxßaùÎç¥O}½¡¤Ë÷q~N5._ãt½ëñ½ýi[!áî}[ï Së}œŒÕÙw÷{ë³ð!IïÃÇ÷)ºÿÕUAŸæk£øþW{³ù¼eçÿh=oµ7îÝÆç6ã¿Íy쫹&æÍÓÿ¾{{|ð«TxɧmU†³: +Ï÷?± >œ¬^†}v•£Q˜ä¦éÝ«’§×WhñÚ*'­šyÖ—DØŠ ÝãowÄQ†~AÏ×/¬ä­sÆq[QeøE:ïö_az² ¯°óÉ8Ýv§3`ó Èñ¼Ž' ;¤|è¸f¾µVµ]å4”w‹ªAø"µÓ]_" Çìzƒ±¨ñÈ ‡ +”¼ÈYȘL3,¿O 9¥X2褱æouIŽŒ‚„–Y84 +‹›pª(6N}à3Dÿ ²©V¦¼Äno!*@DLU &Hþiȇû¿žpÚî¿¢ç-õü`o÷xŸ¶ÕÃ÷Çï ‡›úáþ/¯©l«i–}·O͵õSHx¶©Ÿ½zÿæÜÏúN‚z§T…”EƒÓ LPéïY¤~ÿ\g¦`Ö´š™‹¹Raºùzúûçß¿TÁæh÷ð'À¦Õr¨ÃóVçJcöŽúÔj (GÁ‚àÊ wk¥Ž½CY¾! ÆlÞÝ,IFá8Â-~<ªÄ–([Äæu2äZ]Ø… -”ãªyyWþ{úTRߨ<ŽcvW ºÅNÈK“˶8Š’%È&22˜­ø›w'ÿ ×S@äi: ÉëÞýKôSã‡ß²G¶ŠäzóŽ+„ÖwÛ´’‚¯þ'ØkÕÐVPNûšÏ­¿ ² D(íLËûöþð‡oê·›Ûćñ•\JpÍï_Ç¢¶9x +ð;â›ìä2äsÖœLjصX ‘ףݚÜ­˜9bV𨽾…¦6°~˜ˆû.x9®Œ»âLg¥¡Aøàçb ëên- ÓÄYAnz}~_²ec/Å M½`Ç8½‘@Q¸ËÝÛ\$ÿÅCrhBŸê¿Ô2`]ÌJxƒF:c”Ün¿?<Ø{ûj_ì´^Eô5_ÐS$²^ñ~©þ™/…ˆ]££I íh~$vó‘ØÍCb7‰Ý<$vç0Ù9ÇTSž\i‹›s’å$m€˜NY,;Ô]p JDQò[ê,k$e®ÓOèàrç¢%‰ vh=Þ6Ã1™I-Œ2¯Ð»QÄòç‹[¯eýj[¿6¬_›ü–åE›¤‹ ¶©N)ÑÇ×›ËgÜ|up¼ûÃëýÎ/‡mmØD÷\ w/ìöÙÊO\¡Ù ú}ÐnëbZcï–»¾]TýǨº ÈHɧú#ßEÐ4jݵ´ˆ»³ÐnTFßdºŒ@ÄvœË‡Æ:Å€+ÒËÖ¸ˆ/…Û0}·péÍÌb¼?¼v4¶Ê¾Ý†ˆ\Ñ(à&oA-+û^š_Ybã¸ÝÛHæ"ÌF…el<êʧ<™×vtét´{·eÝ=Çûj¬íÖó»V +¡¾v}…mƒÊK¤ ˆÌ(näÉ°"²‹Ñ©u•Ã„ë£dÄp’Té–.ƒ¿.M2‘Y(„„sÑdÛ Ä%K5XÚ]Ÿ`$¢þfè‡c +50'Ò”y±ÀòÐ¶Æ UÍr¬{j©¼Sö¦2ðy;‰°\õnš~JFól‘]®ÐÐBº9_ïQ¾ÞgºÑÞûŽÐùf +| +ÀãÉ‹4.¯5wÕÎÌXj¥tMÂî$Ñòu>¢•¶oQlhØ´¤æ¡5­©* 1—ÒNj=åvèW ›# n¿¥¢æ,²oÂä<ô­ÑÐ߇Á8÷Ö¦5ºfœk*âæ!EC¨±Cz#h¸çÜÇ\/ËÕ™dJC³Ò ÔÉ‚ÛüG¤L²ô¥¶»- >Ðbó0iߌ†l'à‘‚zµböæ]œ¢Å·¦;:“Yð5¹!ûŠi]‡oÐÊ༠’i-ó’ÆøŽ*$;ÿÛ*JÅô$ ÈßTÕ°8š˜ GqJÃ{–D`®›X3‹í|ËŠ´Ë‹l”Ù¤¨>7ê†kºãJ@ç“ é=$zø«}Šüae¿óy=€KüŸ>kƒÿïÖl·67Àÿwó!ÿóí|þkó?³u6§Î¢œ€/ƒ$Š')ƒ›<—ͽpÄ5 ƒôácàs ¦°pR(o‘pmìÌì4ü±H=šÀÅ4> ƒ`Ôj¹År÷RâSì/vc^Åf~‚Ò}—m…îtöþõÓ/‡Žc…¦Çí+´‚û ¡ÿFgßÇIrÝùÑ'öâŠg|•®_ìPê‡ã“×è ƒ3ë¼ÛÅ[Nñd‹Eè7Œú’ÁyÀ:¬¯Þ°µ5‘³`m®‰f¾õfûøñ€Œå7»þt ¼úît^ýÙ&$ƒE²¾›èIZ͈!GRÞŽTìiÖ³:«úŸáðÌó=ìÕ[ASä!—æyªýãÁá«Î«Ý“Ý]Ƨp<¶:dA—å~Þ=|Å…™z{ÁY°/R>äfËÓ(mXD®-?Áׯ:Ô\‡ÿx¿o•ç‚ Åjg÷ääèà‡÷'ûÐõý½“·GÿZì—C(5võ%¯Ï¿õ(Š­'] ƒùD…€0žGšU‹D‹ùäîp #ëô¿?|wô¶³·W_ÏßsÚpDël…Ó›Ý_;ïvO~V„‘Wœî"'½Ø–X¬ã8…÷®À¼°;&e ¤-°ûf]xqÈûMvãíg ¨pà#Rq¤õ|%Ë™\ÖÌ°TkiÉ€¯È,’¤cÀÑ2!ôGí†ÝozEÖ8‹â›pÜæJp‡á'‚æ¶w!k7ìT ÷úqZ¯¾ˆ½aÑ4Ï™åÔ¤EÂ%ö·É0ûÔ¾GjRɪ fË# ¬ÂôDM1ÞV»»Ù1¶ +Êöv3ƒgÖìÁXº‹YhÈ.B0H|eÙhƒ¢†—çòŽYå{DVþ x²m>ॶݻ.nÞz Q’õi,¼–³Ø2Ë©ð9tg±¨Õ?Sãì%¶I¾É¹#7…YWÖÊ.W…sõ¹FÇÑñ?"]œiò úç`yÏQ¶|/«¸4W´•ñIÎ ÉEñ·.†¤Ç›dŽ¢Pëv ¶fDy2Ð(Y#Š`vuŒ§­~û–aì5Èe¡B•p ©Ÿ)† ó#F,®„°æ¯\Øù V<ÊêD‹ õ3bAà \¨ õûBÚ™]ErZ¸ €ÄÅK2¬ÖéäLf&Ùlþý +F=Úµ¦Å$­Ú‰%&Ãü2¾ â’³|–c çœ)ånr¶¨‹©¢ ©ÞàÜðœæ#wмÀ·zrP˜Ìœ°Kéy!Š +ó«Úç: þ¥”ÇUa +Yä»q©BX#íèd—Yʉ]Ž¿ø.°:^Ýpâ–ÙÕ¾â³‡Ó 6݄ÇA¿cÎF÷!q°!ÞZÏ°Äggi8Ö“x$ŒPƒb®É0ù0ß³&=æ’ ~¯ítD®Œ¸š›«¢H;ÐÔÑ‘ÅT{²u7>'²¤øiÓ ÌÍÆy;|"§ìI3áÂëBÙÿ7[Ö‰Àç‰iî\¼Í|Šâu£’]ðɉPn]aõ||Q¼uØn¤;Ó¹|–õ…à6ä—{›}–ƒÄç­aŠüŽäsCÊhÆmgÉyGr‹&‰`ŸÉ“¬að…Y×DzªBΪPÀ$ƒ +lÖvpUÁÅDó{qG0‘¯{ѺšÁºÑºšî&öѺ1­§Äò?Ù‘ôÌHPP°¢ R,¨%]×®pµ#Ÿz_ªÂ¨2dJ8%9CÒìØ¢AÍÿlɲ &är‡ +Y·R[Á²*Á;¸ˆ[b p¬5ͬ?&Ò¿}`5)m³ØgtŠñ`äD3åOØêK¨ž‰Ü;U!ó*—-ÓšY„\ß !­­•B‚"©dìW_t1I¢V½¹ÝrÌ´µ6M[kemjˆˆÀåšìaêË{õ‡ü–¶4ñ!úÓø64óé)N6ñTÊx.سʇò£Z„TlùÅÂŽÖ1|Á) j)Àdçf0Ù™“‹ ›(/g Ê á²ãÅÅ@&WÀ€¦W€’šæÛUÉùݱ×d¯ÈŽ\áHí/•°Y›¾kbÐè]58³ÚšoÐÐáEÝ®Aë[ŽÀe)L9(õ1'ˆhyaÄ_%ìñï¿?†£âÇOg¯^‰+=Žm šÐ†i«#®ÛÒv*c‡¥±°,º¬£bâ# Ñg‹ö‘yI{ð¨)XÇãmã÷(_¿ù¾ÆÎÅâ pä¦Ûpn5r÷ å› §FñöbÅÙ_l,ð ÛÍø“³¥p´Ð,Õ,ÓÅUÔùÞþSµ¢ÍûžrÙ¾*&0ø5דX"kKÎÈF~É3u¦00uŽ(D†M#K®äbŽ ÓDáý‹ºÉ`/GmeHÈ´}R«“fGŒ„FGÛåÊ(Þ±`g-)ÖÜm¯^U;k­#Q.Îhö`Jdxm—”ª¨å€k!ˆ?âˆ*ü­lù Æ0a½«€ýýIkãI³ÉÅt:á6NÒi$œ…À’$¢†.yÑ|áÇÒ¢HU$Pü’/6Õ + -p¢óDg–ÎbŽ{^äÑéAd_p!‹{^½¬x-ñWµE´(—·ÙÚ‹º–ƒ5ÕRjšYKj^SÉj_‡µÜó¾½%©]]l/ªÎðتD {Z(hNÀjÓ}Ð_Êòx\Ê~nÙÿ·Èÿ;±r”Îî^ìÿÝÚÜh=ÿïV»Ùj?Ûh}Ól7Ÿ=}þàÿ}Ÿÿïv³¹ñ—uý¾QÏïì¤YšÏÿû]_F½0u 3;×rž¶EߊŸïszõ—ÌxQëÍ“úB‘Ì•¶S¬ +Hèéo‰ÎMÕìTĵP®JÌI’R,€4OuWyÅ-UÊEiR ‡JžœÑYMæ—\ƗʨœLBCÈt + ;b+"ë¬[I1v’é4ùw¡-ÓEVñ˜zƒ/ ‹¿5?¬ _#QÀzjLCpÚÊ”¤Çæñ¨°?—OÇe†©‘6²Ã4C5©i¯d’ïÉNÀ+ÌÊ÷ѧZ]ô«óRª†dzö§¼ÒËë^v‚K®qªóc/?Aûšì.xY1ÃÖ5ƒih¼!¾"O™õ 0Jüm†ñ¸œýÎpÒWˆ"«y5~voKàžÆ§œ¸×¥²ëˆ)¡gçE'–ÙI‚at;r.ÅÙm/ÌáY&yò²å毓Á®U“F¶Úõ~oÿUÈBä~óŽ°ƒ-U9Ì¿µ¥íMyK¦ 1Ùaþ•”eCšŽlK(g½®lºu|Ηh츳éBU¦¶Ñ#•nifB9æ<vuY³2S­e¶£jiW>“Q픦9臞IÅ•lã Òõ^À»Êl»í3†ªOÊ”ý˜J”X%¥ÊóÉ1¥.œÌÉ:ÿ§Èl¬>Äóûʶž­m´táx„é|q‡s†3ýS± ß×uQ* Ðaj=BA¡Ð…<éŒï ›ë‚¼1:ƒ}ßr ñQ¿CMu°ܧl0ïC©A}Ö +†]»å¯­Òâa% úGüä´iÀÎËŒi)’P@HÕáH4ìI¡z©ÚøÓ‡îŸY4ð¬”OÖë1œP>òUd: +» aN‡qçô#x—‚…½Å^¼`ßåö–Cÿ½ÇkŒ¡³ñUØÓ0SÎÆß‹`ˆ(`„\z¦"“´Æzg AµòFÜö€ ÄZ&’ä’Bª•3úù䢨Ó*f8HŽ.€R…ñYT‹ù˜%è>¡žzüÿ|; ;‡ºÝyÝÚFaç³MUh«"× Kæ³ îvQP†Å¼ÃÁÿöÛÖÞëÝãã­üüƒáK>WÊ8ˆûü©qýņó1Dìü»ïp0Àû÷Uü¿¯a\žI%–!ì÷?qMúp{‡+!—¡dåptScVñú@'§TÍœãeIéÌ¢é¦Ý€/N\AôÍ_Ïrâãß#‘#p4Haýúm}}ýƒ„K Õ ð¸”>/›¿aE€"…Í`²? 4?uÑ–/Š¸ą&¹ÛÀ³ êóµNË—J@Ò `‰–/‘ a´ ¤‘ ÅY T¿ðÜß{³{ÜM"œìö«ÿ .ƒ¼WÎs4[LjV‚¥”“uÎ\àÄÁ‡à,¶míôœïóÌq¯â¤‡ú£óÍ~ !:ÏO'güñ†û¸ÇÑp‚œ²  cOÝÇgѧ°'^>S‡~ Þ.HñEåy‘¿&XÛ¸šy +¿GqôUnæ~È´*™Îî–•ï³&Ÿ»Ïñˆî­-åÈŽ»¥­-õVöM ælañNÕZx¶¨x'‹JA-ˆoôdÓЇ«x+‹vŠ*ùç ¯dAC¤e‹Ê—²°¥Öd‹ë×F¡ÃxK›RÂѼ¼C§ +•ÝÏ[Ï,cTÍj"~†É“”jwà­†/ea©ýgKⳘ|ã4‹±(ì,.ž!0…£±„dKÊ—™eÂ×¾)'åêá oì5"[ˆ?wÖ…lxá. žæÌbw½6xd:Û+¬±;ßö\²¤bîAÁÜ)?Åß»¶ÉÞæ§Èþ‚Ätþ›ñ$ Øþßl?o>ÓöÿÖóošíÖý`ÿ¿…OþýŸ…šþç´ü5†ÿì”Yà€ÞQJß\© dš}±#òÎö~Þ=¿NŽvNŽ‹N ü…oàÜÀx¢{k'dúÚ‰ µ;ÅÍ=MÀˆF!—VæÆ<ÇqC:7{šÒþË>¯èϦ÷‹0Xa§ØŽ}ÖaÅw$w×;TíÀ°Ì¤¤lÓ(¤°[$‹ +zÙ«µ¹ ï{¥ž o¼ÎË×þþ‹·e$H/âd¼((„2&v”Í]7«¦¹¹æÑXÊïÿ¢ m.€âõcãY3sÿ·Õ~ú°þßÆçáüÿæ.«™3§pžO¸`\³Ô©©ƒþyœDã‹A*±>‡ñ8Ä|ß`û†* 3»ƒ^˜ÈÌO(F¼¹£N¯©3€\ƒõb4ðJÅ•5¾jovOö~ÎU/ôÛ›¸F¬lr]sP–ð@œåR¼ñ•ðd„,ìt`à¥yn +Xöê"æ´‹©"FÏYç\õû)äÔÌäØ\T|׿Œ«8øl·æ~ã×—TܘS=ª™ ˜¸Gj=£û¯Kî{î×hŒ.;Ëlà«\ÉÁ1¯Í²¬ªÒ©Qç¿Û95ÉÃÔôÝÄ‚òR­¸ÿ‹‹Ø^ƒÁ{…뤨³N4õú¦FÎxUžÈš¨lXn²öÈk÷çI³y”dæù§réD¤iøïI˜\,èße8ŒàâI¥3>ïÓ­¬nùãûÃ=ƒ“ý7ï^ïžìwÞñépø“€*Äœf‰“§¢‘ÁUyˆ¥¸H5_›˜гɯ8»ïÇAdêš2ã—{!ÂGZ9à…d¡(1¹ŠÍjˆ)E¤,qÏLJ<Ã_–S8_…½·”|ÞvÜ.ðóqçLÓ?ÆØ=þ[eŽS9X·8“<“]R›>äÓ‰Ýbò—û„§åxwíû!®³ã¥ÝÆSé6îŽÑ4(æaþÛcÜüiV a§`ír¡[‰ïoÍoù2—|§CFÂÌVX K8½|È0Û:RÈ%&N¸žî†Óô3)ïc…*‚áß– ÇÇ[[Â@ÀJäù(q½Ì›ðçû4d¨ÀH¾8 °Ñ}½«œäNw.iF#ÛTM6Æ[SîŒÝî‚÷‹'iO~Çì÷À|·CˆûÅzfþ]‘‘º,ýôÝòéÕFûSo‹÷‹WUÂ[ï![1å]øR_UgÍ«[U¯Ìwéq3]õ±•VP…³¦"ÇMj…‹ç+sž èH¾Þšà»S¼;¢Ü?^­¢-Þ[>0åäþ±äµÈ[âߌõÀÁ·D”ûÇÃB»¬"]ØM96]ñI{Þ½a±ÂaÂz} VÄÂèY7h†žYO\<ËÜ âmóÕÝ› ïŠùîF4ÝSá=à²ÿ +[¸&w y76Á»gÉÛ6Þ­àÞtQYÿ*q¡uÞ-•ÚbÊ{úï…’!G>¾ âbxtÂ݆ápŠá¸¿:á=cÊûe}¼cö½/VÇ{Âè•õϯ‚§8úÎL–÷„ŸoF×ý˜ÿÎìž÷‘ýïÀÞyO&€eòÔ™fo6`u&7¬qÑ鮳¾êOÑýOóºM‡ÞÍt´øþ糧Mþ¬ÕÜØh=oo<{Ú†øÏž={¸ÿyŸ[ŠÿðßsõÓ7iâ ÓðAèÉøÌj„ ÂÁ)\å·™ŒPÂKž :påi<¾À±á½šðæ/CÉa<\ÓObiIÄéwûG¯IÀíuöÞ¾yóö°(žD^ñùï{ +Îo^ï¾Úët Þ( ΈÞÉF“ô‚­]­}×l~GŸ=ËIáÉEþٟɯô*§¼_1ÕEFûÞcùEOÌ’˜]‹óovRFÅ%¯ö B(X×44tC+À§&§ù’Ï­ÀsfÖ)m#Ý&¬ÓuBHZW*È(N‘×U‘Ó û1Ç£Ú)%e ëN4„Ú˜ˆ”žÔêЀ¿î…#æ5×0K=‰)%1€dÜuâÓ?,~«-ë×B§Aª$“.¥Â¬âá¿_3`öŸ)ÁÁ¤êpù²Þ~¶²µYñ@•ò¥Â32àeR³±LŽ¶èŒ +'ÏøºVwÓA€Œ˜O6œ‹vp’„[,„+ê\2OE=BE0§l‘C|Ó ’ó $6dá§Ú·CUܽ±ãô­Jq$Â/’øª£¢×ÖÂOFêØ×(,]êhÚÎ{†OeÄÃ$¤t¶)«…b),¦ãˆÃ 9°Ol@ð|çƒÇ Ž_H®ìÔš"-d~«Ù(,³ýÖùS|åóåS=“4®f¡ÇÉèzN<ô?#šžˆOZéÐô¦ÀFC'±åå%}ñòÒL ËxªÔ¬®‘ Ãê«35’倢š)xŸÜQ0)oÒ}Щ b?èÔ[ÕdqM§ã@z`‘ׂ©“Î!jFwÌ*ËRänÛkªÜæòo{ï¹2òÏ}bsΉÝ‘¨Zò>ÈÝɨcL ±JÒDæK{5L:D+6Sy3ŒßzÊy½$QH!²µ5I£+ÚšòÍNíñÕãºÀ q¤:Ñýëý8Q¸‚«-_5ØòÕj‹*J4O£1Vö!ùxýñ–^Ò¸Ú)Û1±²â+íÔjgŠ Ü8ïì{f-óÉEÄk¾fÞŠŠw³¨'.s®ƃ×ȹPµòw®ˆå‘ˆ$FÕMŽ +Tlá>GÃ} ÛˆM)ãC*ºÀ‹€Ôͤ#ÐxŠ¡Wq›°y †j–[jDü’3LÔZy)¾y±ëGï´F„ò%'áðùCX²; Ý>Õ¹À[cëì‰ –KìçäHiåPš¦mwògÀ}d«ª›Hè{Æ^LòŸ¥W¡Iþq_± þÿ~Ìç&†e ÿ=¡@©˜§n_m;˯ã±÷öýáI67ƒÝÅ›c(¹÷ÎOïw^ÍG4äM«Ø'ñ˜ \ No newline at end of file diff --git a/libtests/qtest/lzw/lzw2.in b/libtests/qtest/lzw/lzw2.in new file mode 100644 index 0000000..5109c45 Binary files /dev/null and b/libtests/qtest/lzw/lzw2.in differ diff --git a/libtests/qtest/lzw/lzw2.out b/libtests/qtest/lzw/lzw2.out new file mode 100644 index 0000000..ab10503 Binary files /dev/null and b/libtests/qtest/lzw/lzw2.out differ diff --git a/libtests/qtest/md5.test b/libtests/qtest/md5.test new file mode 100644 index 0000000..076a37e --- /dev/null +++ b/libtests/qtest/md5.test @@ -0,0 +1,18 @@ +#!/usr/bin/env perl +require 5.008; +BEGIN { $^W = 1; } +use strict; + +chdir("md5") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +my $td = new TestDriver('md5'); + +$td->runtest("md5", + {$td->COMMAND => "md5"}, + {$td->FILE => "md5.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->report(1); diff --git a/libtests/qtest/md5/md5.in b/libtests/qtest/md5/md5.in new file mode 100644 index 0000000..408a68b Binary files /dev/null and b/libtests/qtest/md5/md5.in differ diff --git a/libtests/qtest/md5/md5.out b/libtests/qtest/md5/md5.out new file mode 100644 index 0000000..148b4e6 --- /dev/null +++ b/libtests/qtest/md5/md5.out @@ -0,0 +1,16 @@ +d41d8cd98f00b204e9800998ecf8427e +0cc175b9c0f1b6a831c399e269772661 +900150983cd24fb0d6963f7d28e17f72 +f96b697d7cb7938d525a2f31aaf161d0 +c3fcd3d76192e4007dfb496cca67e13b +d174ab98d277d9f5a5611c2c9f419d9f +57edf4a22be3c955ac49da2e2107b67a +5f4b4321873433daae578f85c72f9e74 +914b11f5990cf99f1161bfeb5865a4fc +1 +1 +0 +0 +0 +5f4b4321873433daae578f85c72f9e74 +5f4b4321873433daae578f85c72f9e74 diff --git a/libtests/qtest/pcre.test b/libtests/qtest/pcre.test new file mode 100644 index 0000000..9e0ebe1 --- /dev/null +++ b/libtests/qtest/pcre.test @@ -0,0 +1,47 @@ +#!/usr/bin/env perl +require 5.008; +BEGIN { $^W = 1; } +use strict; + +chdir("pcre") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +my $td = new TestDriver('pcre'); + +$td->runtest("PCRE", + {$td->COMMAND => "pcre"}, + {$td->FILE => "pcre.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +chop(my $supported = `pcre --unicode-classes-supported`); +if ($supported =~ m/^1/) +{ + my $xflags = 0; + if (`pcre --unicode-classes | wc -l` == 1) + { + # On Red Hat Enterprise Linux 5, the version of pcre provided + # by default claims to support unicode character classes, but + # they don't actually work. Since qpdf doesn't use this + # functionality, we won't care if this particular test case + # fails. If someone were to make general use of this wrapper, + # this test should be re-enabled, but on the other hand, they + # could just use the C++ interface that's been added to pcre + # since this code was written. + $xflags |= $td->EXPECT_FAILURE; + } + $td->runtest("unicode character classes", + {$td->COMMAND => "pcre --unicode-classes"}, + {$td->FILE => "pcre-unicode-classes.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES | $xflags); +} +else +{ + $td->runtest("unicode classes are not supported", + {$td->STRING => "1"}, + {$td->STRING => "1"}); +} + +$td->report(2); diff --git a/libtests/qtest/pcre/pcre-unicode-classes.out b/libtests/qtest/pcre/pcre-unicode-classes.out new file mode 100644 index 0000000..443febc --- /dev/null +++ b/libtests/qtest/pcre/pcre-unicode-classes.out @@ -0,0 +1,2 @@ +no utf8: ab +utf8: abÏ€defq diff --git a/libtests/qtest/pcre/pcre.out b/libtests/qtest/pcre/pcre.out new file mode 100644 index 0000000..27e94e6 --- /dev/null +++ b/libtests/qtest/pcre/pcre.out @@ -0,0 +1,68 @@ +PCRE error: compilation of a** failed at offset 2: nothing to repeat +3 +key: value one two three +0 +25 +key +0 +3 +value one two three +5 +19 +PCRE error: no match +PCRE error: no match +2 +aaa +aaa +-- +hello +PCRE error: no match +qqqcqqq: no match +ab,c: 0: ab,c +ab,c: 0: 0, 4 +ab,c: 1: ab,c +ab,c: 1: 0, 4 +ab,c: 2: ab +ab,c: 2: 0, 2 +ab,c: 3: b +ab,c: 3: 1, 1 +ab,c: 4: c +ab,c: 4: 3, 1 +ab: 0: ab +ab: 0: 0, 2 +ab: 1: ab +ab: 1: 0, 2 +ab: 2: ab +ab: 2: 0, 2 +ab: 3: b +ab: 3: 1, 1 +a: 0: a +a: 0: 0, 1 +a: 1: a +a: 1: 0, 1 +a: 2: a +a: 2: 0, 1 +a,c: 0: a,c +a,c: 0: 0, 3 +a,c: 1: a,c +a,c: 1: 0, 3 +a,c: 2: a +a,c: 2: 0, 1 +a,c: 3: no backref (getMatch) +a,c: 3: no backref (getOffsetLength) +a,c: 4: c +a,c: 4: 2, 1 +c: 0: c +c: 0: 0, 1 +c: 1: c +c: 1: 0, 1 +c: 2: no backref (getMatch) +c: 2: no backref (getOffsetLength) +c: 3: no backref (getMatch) +c: 3: no backref (getOffsetLength) +c: 4: no backref (getMatch) +c: 4: no backref (getOffsetLength) +c: 5: c +c: 5: 0, 1 +: 0: +: 0: 0, 0 diff --git a/libtests/qtest/ph.test b/libtests/qtest/ph.test new file mode 100644 index 0000000..9c0ffb8 --- /dev/null +++ b/libtests/qtest/ph.test @@ -0,0 +1,18 @@ +#!/usr/bin/env perl +require 5.008; +BEGIN { $^W = 1; } +use strict; + +chdir("ph") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +my $td = new TestDriver('ph'); + +$td->runtest("PointerHolder", + {$td->COMMAND => "pointer_holder"}, + {$td->FILE => "ph.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->report(1); diff --git a/libtests/qtest/ph/ph.out b/libtests/qtest/ph/ph.out new file mode 100644 index 0000000..1326e48 --- /dev/null +++ b/libtests/qtest/ph/ph.out @@ -0,0 +1,17 @@ +hello +created Object, id 1 +created Object, id 2 +nulls equal +destroyed Object, id 2 +equal okay +less than okay +created Object, id 3 +calling Object::hello for 1 +calling Object::hello for 1 +calling Object::hello for 1 +calling Object::hello const for 1 +calling Object::hello const for 1 +calling Object::hello const for 1 +goodbye +destroyed Object, id 3 +destroyed Object, id 1 diff --git a/libtests/qtest/png_filter.test b/libtests/qtest/png_filter.test new file mode 100644 index 0000000..5b75a20 --- /dev/null +++ b/libtests/qtest/png_filter.test @@ -0,0 +1,63 @@ +#!/usr/bin/env perl +require 5.008; +BEGIN { $^W = 1; } +use strict; +use File::Copy; +use Digest::MD5; + +chdir("png_filter") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +my $td = new TestDriver('png_filter'); + +cleanup(); + +$td->runtest("decode columns = 4", + {$td->COMMAND => "png_filter decode in1 4"}, + {$td->STRING => "done\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("check output", + {$td->FILE => "out"}, + {$td->FILE => "out1"}); + +$td->runtest("decode columns = 5", + {$td->COMMAND => "png_filter decode in2 5"}, + {$td->STRING => "done\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("check output", + {$td->FILE => "out"}, + {$td->FILE => "out2"}); + +$td->runtest("encode columns = 4", + {$td->COMMAND => "png_filter encode out1 4"}, + {$td->STRING => "done\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("check output", + {$td->FILE => "out"}, + {$td->FILE => "in1"}); + +$td->runtest("encode columns = 5", + {$td->COMMAND => "png_filter encode out2 5"}, + {$td->STRING => "done\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("check output", + {$td->FILE => "out"}, + {$td->FILE => "in2"}); + +cleanup(); + +$td->report(8); + +sub cleanup +{ + unlink "out"; +} diff --git a/libtests/qtest/png_filter/in1 b/libtests/qtest/png_filter/in1 new file mode 100644 index 0000000..bb830ec Binary files /dev/null and b/libtests/qtest/png_filter/in1 differ diff --git a/libtests/qtest/png_filter/in2 b/libtests/qtest/png_filter/in2 new file mode 100644 index 0000000..430a074 Binary files /dev/null and b/libtests/qtest/png_filter/in2 differ diff --git a/libtests/qtest/png_filter/out1 b/libtests/qtest/png_filter/out1 new file mode 100644 index 0000000..5625f33 Binary files /dev/null and b/libtests/qtest/png_filter/out1 differ diff --git a/libtests/qtest/png_filter/out2 b/libtests/qtest/png_filter/out2 new file mode 100644 index 0000000..dad129d Binary files /dev/null and b/libtests/qtest/png_filter/out2 differ diff --git a/libtests/qtest/qutil.test b/libtests/qtest/qutil.test new file mode 100644 index 0000000..9c0410e --- /dev/null +++ b/libtests/qtest/qutil.test @@ -0,0 +1,18 @@ +#!/usr/bin/env perl +require 5.008; +BEGIN { $^W = 1; } +use strict; + +chdir("qutil") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +my $td = new TestDriver('qutil'); + +$td->runtest("QUtil", + {$td->COMMAND => "qutil"}, + {$td->FILE => "qutil.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->report(1); diff --git a/libtests/qtest/qutil/qutil.out b/libtests/qtest/qutil/qutil.out new file mode 100644 index 0000000..a48e626 --- /dev/null +++ b/libtests/qtest/qutil/qutil.out @@ -0,0 +1,30 @@ +16059 +0016059 +16059 +3.141590 +3.142 +1000.123000 +exception 1: Util::int_to_string has been called with a padding value greater than its internal limit +exception 2: Util::int_to_string has been called with a padding value greater than its internal limit +exception 3: Util::int_to_string has been called with a padding value greater than its internal limit +exception 4: Util::double_to_string has been called with a number and a decimal places specification that would break an internal limit +exception 5: Util::double_to_string has been called with a number and a decimal places specification that would break an internal limit +one +7 +compare okay +---- +before open +exception: open file: No such file or directory +---- +before fopen +exception: fopen file: No such file or directory +---- +IN_TESTSUITE: 1: 1 +HAGOOGAMAGOOGLE: 0 +---- +0x41 -> A +0xf7 -> ÷ +0x3c0 -> Ï€ +0x16059 -> f0 96 81 99 +0x7fffffff -> fd bf bf bf bf bf +0x80000000: bounds error in QUtil::toUTF8 diff --git a/libtests/qtest/rc4.test b/libtests/qtest/rc4.test new file mode 100644 index 0000000..0207317 --- /dev/null +++ b/libtests/qtest/rc4.test @@ -0,0 +1,45 @@ +#!/usr/bin/env perl +require 5.008; +BEGIN { $^W = 1; } +use strict; + +chdir("rc4") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +my $td = new TestDriver('RC4'); + +cleanup(); + +my @tests = ('0123456789abcdef', + '0123456789abcdef', + '0000000000000000', + 'ef012345', + '0123456789abcdef'); + +my $n = 0; +foreach my $key (@tests) +{ + ++$n; + $td->runtest("test $n", + {$td->COMMAND => "rc4 $key test$n.in tmp1-$n.out"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); + $td->runtest("check output", + {$td->FILE => "tmp1-$n.out"}, + {$td->FILE => "test$n.out"}); + $td->runtest("test $n reverse", + {$td->COMMAND => "rc4 $key test$n.out tmp2-$n.out"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); + $td->runtest("check output", + {$td->FILE => "tmp2-$n.out"}, + {$td->FILE => "test$n.in"}); +} + +cleanup(); + +$td->report(4 * scalar(@tests)); + +sub cleanup +{ + system("rm -f tmp*-*"); +} diff --git a/libtests/qtest/rc4/test1.in b/libtests/qtest/rc4/test1.in new file mode 100644 index 0000000..be687ec --- /dev/null +++ b/libtests/qtest/rc4/test1.in @@ -0,0 +1 @@ +#Eg‰«Íï \ No newline at end of file diff --git a/libtests/qtest/rc4/test1.out b/libtests/qtest/rc4/test1.out new file mode 100644 index 0000000..0a8617e --- /dev/null +++ b/libtests/qtest/rc4/test1.out @@ -0,0 +1 @@ +u·‡€™àÅ– \ No newline at end of file diff --git a/libtests/qtest/rc4/test2.in b/libtests/qtest/rc4/test2.in new file mode 100644 index 0000000..1b1cb4d Binary files /dev/null and b/libtests/qtest/rc4/test2.in differ diff --git a/libtests/qtest/rc4/test2.out b/libtests/qtest/rc4/test2.out new file mode 100644 index 0000000..9bdb590 --- /dev/null +++ b/libtests/qtest/rc4/test2.out @@ -0,0 +1 @@ +t”ÂçKy \ No newline at end of file diff --git a/libtests/qtest/rc4/test3.in b/libtests/qtest/rc4/test3.in new file mode 100644 index 0000000..1b1cb4d Binary files /dev/null and b/libtests/qtest/rc4/test3.in differ diff --git a/libtests/qtest/rc4/test3.out b/libtests/qtest/rc4/test3.out new file mode 100644 index 0000000..11f99ca --- /dev/null +++ b/libtests/qtest/rc4/test3.out @@ -0,0 +1 @@ +Þ‰A£7]: \ No newline at end of file diff --git a/libtests/qtest/rc4/test4.in b/libtests/qtest/rc4/test4.in new file mode 100644 index 0000000..cb43b5c Binary files /dev/null and b/libtests/qtest/rc4/test4.in differ diff --git a/libtests/qtest/rc4/test4.out b/libtests/qtest/rc4/test4.out new file mode 100644 index 0000000..1394b33 --- /dev/null +++ b/libtests/qtest/rc4/test4.out @@ -0,0 +1 @@ +Ö¡A§ì<8ß½a \ No newline at end of file diff --git a/libtests/qtest/rc4/test5.in b/libtests/qtest/rc4/test5.in new file mode 100644 index 0000000..60e5cd0 --- /dev/null +++ b/libtests/qtest/rc4/test5.in @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libtests/qtest/rc4/test5.out b/libtests/qtest/rc4/test5.out new file mode 100644 index 0000000..d64d1a4 Binary files /dev/null and b/libtests/qtest/rc4/test5.out differ diff --git a/libtests/qutil.cc b/libtests/qutil.cc new file mode 100644 index 0000000..d1c090f --- /dev/null +++ b/libtests/qutil.cc @@ -0,0 +1,199 @@ +#include +#include +#include +#include +#include +#include +#include + +#ifdef _WIN32 +# include +#else +# include +#endif + +void string_conversion_test() +{ + std::cout << QUtil::int_to_string(16059) << std::endl + << QUtil::int_to_string(16059, 7) << std::endl + << QUtil::int_to_string(16059, -7) << std::endl + << QUtil::double_to_string(3.14159) << std::endl + << QUtil::double_to_string(3.14159, 3) << std::endl + << QUtil::double_to_string(1000.123, -1024) << std::endl; + + try + { + // int_to_string bounds error + std::cout << QUtil::int_to_string(1, 50) << std::endl; + } + catch (std::logic_error &e) + { + std::cout << "exception 1: " << e.what() << std::endl; + } + + try + { + // QUtil::int_to_string bounds error + std::cout << QUtil::int_to_string(1, -50) << std::endl; + } + catch (std::logic_error& e) + { + std::cout << "exception 2: " << e.what() << std::endl; + } + + try + { + // QUtil::int_to_string bounds error + std::cout << QUtil::int_to_string(-1, 49) << std::endl; + } + catch (std::logic_error& e) + { + std::cout << "exception 3: " << e.what() << std::endl; + } + + + try + { + // QUtil::double_to_string bounds error + std::cout << QUtil::double_to_string(3.14159, 1024) << std::endl; + } + catch (std::logic_error& e) + { + std::cout << "exception 4: " << e.what() << std::endl; + } + + try + { + // QUtil::double_to_string bounds error + std::cout << QUtil::double_to_string(1000.0, 95) << std::endl; + } + catch (std::logic_error& e) + { + std::cout << "exception 5: " << e.what() << std::endl; + } + + std::string embedded_null = "one"; + embedded_null += '\0'; + embedded_null += "two"; + std::cout << embedded_null.c_str() << std::endl; + std::cout << embedded_null.length() << std::endl; + char* tmp = QUtil::copy_string(embedded_null); + if (memcmp(tmp, embedded_null.c_str(), 7) == 0) + { + std::cout << "compare okay" << std::endl; + } + else + { + std::cout << "compare failed" << std::endl; + } + delete [] tmp; +} + +void os_wrapper_test() +{ + int fd = -1; + try + { + std::cout << "before open" << std::endl; + fd = QUtil::os_wrapper("open file", + open("/this/file/does/not/exist", O_RDONLY)); + std::cout << "after open" << std::endl; + (void) close(fd); + } + catch (std::runtime_error& s) + { + std::cout << "exception: " << s.what() << std::endl; + } +} + +void fopen_wrapper_test() +{ + FILE* f = 0; + try + { + std::cout << "before fopen" << std::endl; + f = QUtil::fopen_wrapper("fopen file", + fopen("/this/file/does/not/exist", "r")); + std::cout << "after fopen" << std::endl; + (void) fclose(f); + } + catch (std::runtime_error& s) + { + std::cout << "exception: " << s.what() << std::endl; + } +} + +void getenv_test() +{ + std::string val; + std::cout << "IN_TESTSUITE: " << QUtil::get_env("IN_TESTSUITE", &val) + << ": " << val << std::endl; + // Hopefully this environment variable is not defined. + std::cout << "HAGOOGAMAGOOGLE: " << QUtil::get_env("HAGOOGAMAGOOGLE") + << std::endl; +} + +static void print_utf8(unsigned long val) +{ + char t[20]; + sprintf(t, "%lx", val); + std::string result = QUtil::toUTF8(val); + std::cout << "0x" << t << " ->"; + if (val < 0xfffe) + { + std::cout << " " << result; + } + else + { + // Emacs has trouble with utf-8 encoding files with characters + // outside the 16-bit portion, so just show the character + // values. + for (std::string::iterator iter = result.begin(); + iter != result.end(); ++iter) + { + char t[3]; + sprintf(t, "%02x", (unsigned char) (*iter)); + std::cout << " " << t; + } + } + std::cout << std::endl; +} + +void to_utf8_test() +{ + print_utf8(0x41UL); + print_utf8(0xF7UL); + print_utf8(0x3c0UL); + print_utf8(0x16059UL); + print_utf8(0x7fffffffUL); + try + { + print_utf8(0x80000000UL); + } + catch (std::runtime_error& e) + { + std::cout << "0x80000000: " << e.what() << std::endl; + } +} + +int main(int argc, char* argv[]) +{ + try + { + string_conversion_test(); + std::cout << "----" << std::endl; + os_wrapper_test(); + std::cout << "----" << std::endl; + fopen_wrapper_test(); + std::cout << "----" << std::endl; + getenv_test(); + std::cout << "----" << std::endl; + to_utf8_test(); + } + catch (std::exception& e) + { + std::cout << "unexpected exception: " << e.what() << std::endl; + } + + return 0; +} diff --git a/libtests/rc4.cc b/libtests/rc4.cc new file mode 100644 index 0000000..1328fc8 --- /dev/null +++ b/libtests/rc4.cc @@ -0,0 +1,75 @@ +#include +#include + +#include +#include +#include +#include + +int main(int argc, char* argv[]) +{ + if (argc != 4) + { + std::cerr << "Usage: rc4 hex-key infile outfile" << std::endl; + exit(2); + } + + char* hexkey = argv[1]; + char* infilename = argv[2]; + char* outfilename = argv[3]; + unsigned int hexkeylen = (unsigned int)strlen(hexkey); + unsigned int keylen = hexkeylen / 2; + unsigned char* key = new unsigned char[keylen + 1]; + key[keylen] = '\0'; + + FILE* infile = fopen(infilename, "rb"); + if (infile == 0) + { + std::cerr << "can't open " << infilename << std::endl; + exit(2); + } + + for (unsigned int i = 0; i < strlen(hexkey); i += 2) + { + char t[3]; + t[0] = hexkey[i]; + t[1] = hexkey[i + 1]; + t[2] = '\0'; + + long val = strtol(t, 0, 16); + key[i/2] = (unsigned char) val; + } + + FILE* outfile = fopen(outfilename, "wb"); + if (outfile == 0) + { + std::cerr << "can't open " << outfilename << std::endl; + exit(2); + } + Pl_StdioFile* out = new Pl_StdioFile("stdout", outfile); + // Use a small buffer size (64) for testing + Pl_RC4* rc4 = new Pl_RC4("rc4", out, key, keylen, 64); + delete [] key; + + // 64 < buffer size < 512, buffer_size is not a power of 2 for testing + unsigned char buf[100]; + bool done = false; + while (! done) + { + size_t len = fread(buf, 1, sizeof(buf), infile); + if (len <= 0) + { + done = true; + } + else + { + rc4->write(buf, len); + } + } + rc4->finish(); + delete rc4; + delete out; + fclose(infile); + fclose(outfile); + return 0; +} diff --git a/ltmain.sh b/ltmain.sh new file mode 100644 index 0000000..c7d06c3 --- /dev/null +++ b/ltmain.sh @@ -0,0 +1,9661 @@ + +# libtool (GNU libtool) 2.4.2 +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [OPTION]... [MODE-ARG]... +# +# Provide generalized library-building support services. +# +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --no-warn don't display warning messages +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message +# +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . + +PROGRAM=libtool +PACKAGE=libtool +VERSION="2.4.2 Debian-2.4.2-1" +TIMESTAMP="" +package_revision=1.3337 + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# NLS nuisances: We save the old values to restore during execute mode. +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL + +$lt_unset CDPATH + + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + + + +: ${CP="cp -f"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +exit_status=$EXIT_SUCCESS + +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" + +dirname="s,/[^/]*$,," +basename="s,^.*/,," + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} # func_dirname may be replaced by extended shell implementation + + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} # func_basename may be replaced by extended shell implementation + + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} # func_dirname_and_basename may be replaced by extended shell implementation + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname may be replaced by extended shell implementation + + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' + +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} + +# The name of this program: +func_dirname_and_basename "$progpath" +progname=$func_basename_result + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS="$save_IFS" + test -x "$progdir/$progname" && break + done + IFS="$save_IFS" + test -n "$progdir" || progdir=`pwd` + progpath="$progdir/$progname" + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed="${SED}"' -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' + +# Sed substitution that converts a w32 file name or path +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" + +# Standard options: +opt_dry_run=false +opt_help=false +opt_quiet=false +opt_verbose=false +opt_warning=: + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" +} + +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +} + +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help="Try \`$progname --help' for more information." ## default + + +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + my_directory_path="$1" + my_dir_list= + + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" + + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + done + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "$my_tmpdir" +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "$1" | $SED \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $opt_debug + + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $opt_debug + + $SED -n '/^# Usage:/,/^# *.*--help/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + echo + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () +{ + $opt_debug + + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ + p + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $opt_debug + + func_error "missing argument for $1." + exit_cmd=exit +} + + +# func_split_short_opt shortopt +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +func_split_short_opt () +{ + my_sed_short_opt='1s/^\(..\).*$/\1/;q' + my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` +} # func_split_short_opt may be replaced by extended shell implementation + + +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=' sign. +func_split_long_opt () +{ + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' + my_sed_long_arg='1s/^--[^=]*=//' + + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` +} # func_split_long_opt may be replaced by extended shell implementation + +exit_cmd=: + + + + + +magic="%%%MAGIC variable%%%" +magic_exe="%%%MAGIC EXE variable%%%" + +# Global variables. +nonopt= +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "${1}=\$${1}\${2}" +} # func_append may be replaced by extended shell implementation + +# func_append_quoted var value +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +func_append_quoted () +{ + func_quote_for_eval "${2}" + eval "${1}=\$${1}\\ \$func_quote_for_eval_result" +} # func_append_quoted may be replaced by extended shell implementation + + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "${@}"` +} # func_arith may be replaced by extended shell implementation + + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` +} # func_len may be replaced by extended shell implementation + + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} # func_lo2o may be replaced by extended shell implementation + + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} # func_xform may be replaced by extended shell implementation + + +# func_fatal_configuration arg... +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func_error ${1+"$@"} + func_error "See the $PACKAGE documentation for more information." + func_fatal_error "Fatal configuration error." +} + + +# func_config +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + +# func_features +# Display the features supported by this script. +func_features () +{ + echo "host: $host" + if test "$build_libtool_libs" = yes; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + + exit $? +} + +# func_enable_tag tagname +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname="$1" + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf="/$re_begincf/,/$re_endcf/p" + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# Shorthand for --mode=foo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac + + + +# Option defaults: +opt_debug=: +opt_dry_run=false +opt_config=false +opt_preserve_dup_deps=false +opt_features=false +opt_finish=false +opt_help=false +opt_help_all=false +opt_silent=: +opt_warning=: +opt_verbose=: +opt_silent=false +opt_verbose=false + + +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. +{ + # this just eases exit handling + while test $# -gt 0; do + opt="$1" + shift + case $opt in + --debug|-x) opt_debug='set -x' + func_echo "enabling shell trace mode" + $opt_debug + ;; + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + --config) + opt_config=: +func_config + ;; + --dlopen|-dlopen) + optarg="$1" + opt_dlopen="${opt_dlopen+$opt_dlopen +}$optarg" + shift + ;; + --preserve-dup-deps) + opt_preserve_dup_deps=: + ;; + --features) + opt_features=: +func_features + ;; + --finish) + opt_finish=: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=: + ;; + --help-all) + opt_help_all=: +opt_help=': help-all' + ;; + --mode) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_mode="$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; +esac + shift + ;; + --no-silent|--no-quiet) + opt_silent=false +func_append preserve_args " $opt" + ;; + --no-warning|--no-warn) + opt_warning=false +func_append preserve_args " $opt" + ;; + --no-verbose) + opt_verbose=false +func_append preserve_args " $opt" + ;; + --silent|--quiet) + opt_silent=: +func_append preserve_args " $opt" + opt_verbose=false + ;; + --verbose|-v) + opt_verbose=: +func_append preserve_args " $opt" +opt_silent=false + ;; + --tag) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_tag="$optarg" +func_append preserve_args " $opt $optarg" +func_enable_tag "$optarg" + shift + ;; + + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + + # Separate optargs to long options: + --*=*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; + esac + done + + # Validate options: + + # save first non-option argument + if test "$#" -gt 0; then + nonopt="$opt" + shift + fi + + # preserve --debug + test "$opt_debug" = : || func_append preserve_args " --debug" + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$opt_mode' for more information." + } + + + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} + + + + +## ----------- ## +## Main. ## +## ----------- ## + +# func_lalib_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if `file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case "$lalib_p_line" in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test "$lalib_p" = yes +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + func_lalib_p "$1" +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $opt_debug + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$save_ifs + eval cmd=\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# `FILE.' does not work on cygwin managed mounts. +func_source () +{ + $opt_debug + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case "$lt_sysroot:$1" in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result="=$func_stripname_result" + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $opt_debug + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with \`--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' + else + write_lobj=none + fi + + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T </dev/null` + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$lt_sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $opt_debug + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result="" + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $opt_debug + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $opt_debug + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $opt_debug + if test -z "$2" && test -n "$1" ; then + func_error "Could not determine host file name corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result="$1" + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $opt_debug + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " \`$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result="$3" + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $opt_debug + case $4 in + $1 ) func_to_host_path_result="$3$func_to_host_path_result" + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via `$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $opt_debug + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $opt_debug + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result="$1" +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result="$func_convert_core_msys_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via `$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $opt_debug + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd="func_convert_path_${func_stripname_result}" + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $opt_debug + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result="$1" +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_msys_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_mode_compile arg... +func_mode_compile () +{ + $opt_debug + # Get the compilation command and the source file. + base_compile= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + pie_flag= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; + + target ) + libobj="$arg" + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + test -n "$libobj" && \ + func_fatal_error "you cannot specify \`-o' more than once" + arg_mode=target + continue + ;; + + -pie | -fpie | -fPIE) + func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + func_append later " $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + func_append_quoted lastarg "$arg" + done + IFS="$save_ifs" + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to base_compile. + func_append base_compile " $lastarg" + continue + ;; + + *) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in + arg) + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) + func_fatal_error "you must specify a target with \`-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" + libobj="$func_basename_result" + } + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + case $libobj in + *.[cCFSifmso] | \ + *.ada | *.adb | *.ads | *.asm | \ + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) + func_xform "$libobj" + libobj=$func_xform_result + ;; + esac + + case $libobj in + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; + *) + func_fatal_error "cannot determine name of library object from \`$libobj'" + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_libtool_libs=no + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + func_quote_for_eval "$libobj" + test "X$libobj" != "X$func_quote_for_eval_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test "$pic_mode" != no; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test "$suppress_opt" = yes; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test "$compiler_c_o" = yes; then + func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode \`$opt_mode'" + ;; + esac + + echo + $ECHO "Try \`$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # The first argument is the command name. + cmd="$nonopt" + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "\`$file' is not a file" + + dir= + case $file in + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "\`$file' was not linked with \`-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir="$func_dirname_result" + + if test -f "$dir/$objdir/$dlname"; then + func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir="$func_dirname_result" + ;; + + *) + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file="$progdir/$program" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_append_quoted args "$file" + done + + if test "X$opt_dry_run" = Xfalse; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "\`$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument \`$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || func_append admincmds " + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_silent && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi + exit $EXIT_SUCCESS +} + +test "$opt_mode" = finish && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $opt_debug + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + func_append files " $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir="$func_dirname_result" + destname="$func_basename_result" + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "\`$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "\`$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + func_append staticlibs " $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir="$func_dirname_result" + func_append dir "$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname="$1" + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme="$stripme" + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name="$func_basename_result" + instname="$dir/$name"i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && func_append staticlibs " $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to \`$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script \`$wrapper'" + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" = yes; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file="$func_basename_result" + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file="$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name="$func_basename_result" + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run \`$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = install && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms="${my_outputname}S.c" + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${my_outputname}.nm" + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $opt_dry_run || { + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from \`$dlprefile'" + func_basename "$dlprefile" + name="$func_basename_result" + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename="" + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname" ; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename="$func_basename_result" + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename" ; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[]; +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{\ + { \"$my_originator\", (void *) 0 }," + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) func_append symtab_cflags " $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + + # Transform the symbol file into the correct name. + symfileobj="$output_objdir/${my_outputname}S.$objext" + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for \`$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $opt_debug + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $opt_debug + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $opt_debug + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1" ; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result="" + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + if test "$lock_old_archive_extraction" = yes; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" = yes; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $opt_debug + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib="$func_basename_result" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`basename "$darwin_archive"` + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined (other platforms) ... */ +#endif + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp (str, pat) == 0) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + int len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + int orig_value_len = strlen (orig_value); + int add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[len-1] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module="${wl}-single_module" + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + func_append dlfiles " $arg" + else + func_append dlprefiles " $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + test -f "$arg" \ + || func_fatal_error "symbol file \`$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# func_append moreargs " $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file \`$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + weak) + func_append weak_libs " $arg" + prev= + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "\`-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between \`-L' and \`$1'" + else + func_fatal_error "need path for \`-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + func_append deplibs " $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + continue + ;; + + -multi_module) + single_module="${wl}-multi_module" + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-flto*|-fwhopr*|-fuse-linker-plugin) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + *.$objext) + # A standard object. + func_append objs " $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + func_append deplibs " $arg" + func_append old_deplibs " $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + func_resolve_sysroot "$arg" + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev= + else + func_append deplibs " $func_resolve_sysroot_result" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the \`$prevarg' option requires an argument" + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname="$func_basename_result" + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_preserve_dup_deps ; then + case "$libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append libs " $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + esac + func_append pre_post_deps " $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test "$linkmode,$pass" = "lib,link"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs="$tmp_deplibs" + fi + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) + libs="$deplibs %DEPLIBS%" + test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" + ;; + esac + fi + if test "$linkmode,$pass" = "lib,dlpreopen"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + func_resolve_sysroot "$lib" + case $lib in + *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) func_append deplibs " $deplib" ;; + esac + done + done + libs="$dlprefiles" + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test "$linkmode" = lib; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + *.ltframework) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) + func_warning "\`-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." + else + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + ;; + esac + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + func_append newdlprefiles " $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append newdlfiles " $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + + if test "$found" = yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "\`$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + # It is a libtool convenience library, so add in its objects. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && + { test "$prefer_static_libs" = yes || + test "$prefer_static_libs,$installed" = "built,no"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib="$l" + done + fi + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + func_append dlprefiles " $lib $dependency_libs" + else + func_append newdlfiles " $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir="$ladir" + fi + ;; + esac + func_basename "$lib" + laname="$func_basename_result" + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$lt_sysroot$libdir" + absdir="$lt_sysroot$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + fi + case "$host" in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + func_append newlib_search_path " $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath:" in + *"$absdir:"*) ;; + *) func_append temp_rpath "$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no + ;; + *) + if test "$installed" = no; then + func_append notinst_deplibs " $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule="" + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule="$dlpremoduletest" + break + fi + done + if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then + echo + if test "$linkmode" = prog; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname="$1" + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc*) + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + func_basename "$soroot" + soname="$func_basename_result" + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from \`$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for \`$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$opt_mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we can not + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null ; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + elif test -n "$old_library"; then + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$absdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && + test "$hardcode_minus_L" != yes && + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$opt_mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + $ECHO "*** Warning: This system can not link to static lib archive $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) func_append xrpath " $temp_xrpath";; + esac;; + *) func_append temp_deplibs " $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + func_append newlib_search_path " $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; + esac + fi + func_append tmp_libs " $func_resolve_sysroot_result" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path="$deplib" ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result + func_dirname "$deplib" "" "." + dir=$func_dirname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of \`$dir'" + absdir="$dir" + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" + path= + fi + fi + ;; + *) + path="-L$absdir/$objdir" + ;; + esac + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "\`$deplib' seems to be moved" + + path="-L$absdir" + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test "$pass" = link; then + if test "$linkmode" = "prog"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) func_append lib_search_path " $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) func_append tmp_libs " $deplib" ;; + esac + ;; + *) func_append tmp_libs " $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + func_append tmp_libs " $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + fi + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "\`-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "\`-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + func_append objs "$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" + + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + func_append libobjs " $objs" + fi + fi + + test "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir="$1" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "\`-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + shift + IFS="$save_ifs" + + test -n "$7" && \ + func_fatal_help "too many parameters to \`-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$1" + number_minor="$2" + number_revision="$3" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + # correct linux to gnu/linux during the next big refactor + darwin|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|qnx|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + *) + func_fatal_configuration "$modename: unknown library version type \`$version_type'" + ;; + esac + ;; + no) + current="$1" + revision="$2" + age="$3" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) # correct to gnu/linux during the next big refactor + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + func_append verstring ":${current}.0" + ;; + + qnx) + major=".$current" + versuffix=".$current" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + + *) + func_fatal_configuration "unknown library version type \`$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + + fi + + func_generate_dlsyms "$libname" "$libname" "yes" + func_append libobjs " $symfileobj" + test "X$libobjs" = "X " && libobjs= + + if test "$opt_mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + func_append removelist " $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) func_append dlfiles " $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) func_append dlprefiles " $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + func_append deplibs " System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + func_append deplibs " -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test "X$deplibs_check_method" = "Xnone"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + ;; + esac + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + deplibs="$new_libs" + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + # Remove ${wl} instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$opt_mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append dep_rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname="$1" + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + func_append linknames " $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols="$output_objdir/$libname.uexp" + func_append delfiles " $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols="$export_symbols" + export_symbols= + always_export_symbols=yes + fi + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd1 in $cmds; do + IFS="$save_ifs" + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test "$try_normal_branch" = yes \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=${output_objdir}/${output_la}.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + func_append tmp_deplibs " $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test "$compiler_needs_object" = yes && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$opt_mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test "$compiler_needs_object" = yes; then + firstobj="$1 " + shift + fi + for obj + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-${k}.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test "X$objlist" = X || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-${k}.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi + func_append delfiles " $output" + + else + output= + fi + + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + fi + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + if ${skipped_export-false}; then + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + fi + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "\`-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object \`$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # If we're not building shared, we need to use non_pic_objs + test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "\`-release' is ignored for programs" + + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test "$tagname" = CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + func_append compile_command " ${wl}-bind_at_load" + func_append finalize_command " ${wl}-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) func_append dllsearchpath ":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) func_append finalize_perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=yes + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; + *cygwin* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + esac + if test "$wrappers_required" = no; then + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + fi + + exit $exit_status + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + func_append rpath "$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save $symfileobj" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + if test "$preload" = yes && test -f "$symfileobj"; then + func_append oldobjs " $symfileobj" + fi + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $addlibs + func_append oldobjs " $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append oldobjs " $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase="$func_basename_result" + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" + ;; + *) func_append oldobjs " $obj" ;; + esac + done + fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name="$func_basename_result" + func_resolve_sysroot "$deplib" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + ;; + *) func_append newdlfiles " $lib" ;; + esac + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + ;; + esac + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlfiles " $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlprefiles " $abs" + done + dlprefiles="$newdlprefiles" + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && + func_mode_link ${1+"$@"} + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $opt_debug + RM="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) func_append RM " $arg"; rmforce=yes ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + for file in $files; do + func_dirname "$file" "" "." + dir="$func_dirname_result" + if test "X$dir" = X.; then + odir="$objdir" + else + odir="$dir/$objdir" + fi + func_basename "$file" + name="$func_basename_result" + test "$opt_mode" = uninstall && odir="$dir" + + # Remember odir for removal later, being careful to avoid duplicates + if test "$opt_mode" = clean; then + case " $rmdirs " in + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + func_append rmfiles " $odir/$n" + done + test -n "$old_library" && func_append rmfiles " $odir/$old_library" + + case "$opt_mode" in + clean) + case " $library_names " in + *" $dlname "*) ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + esac + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && + test "$pic_object" != none; then + func_append rmfiles " $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && + test "$non_pic_object" != none; then + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$opt_mode" = clean ; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + func_append rmfiles " $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + func_append rmfiles " $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + func_append rmfiles " $odir/$name $odir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + func_append rmfiles " $odir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + func_append rmfiles " $odir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && + func_mode_uninstall ${1+"$@"} + +test -z "$opt_mode" && { + help="$generic_help" + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode \`$opt_mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: +# vi:sw=2 + diff --git a/m4/libtool.m4 b/m4/libtool.m4 new file mode 100644 index 0000000..828104c --- /dev/null +++ b/m4/libtool.m4 @@ -0,0 +1,8001 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 57 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_REPLACE_SHELLFNS + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +m4_ifndef([AC_PROG_GO], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and in which our libraries should be installed.])]) + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[_LT_PROG_AR + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[[4-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[23]].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[[3-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + _LT_TAGVAR(link_all_deplibs, $1)=no + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS="$save_LDFLAGS"]) + if test "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting ${shlibpath_var} if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report which library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + gnu*) + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF +]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case ${prev}${p} in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test "$pre_test_object_deps_done" = no; then + case ${prev} in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${F77-"f77"} + CFLAGS=$FFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${FC-"f95"} + CFLAGS=$FCFLAGS + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +CFLAGS= +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: +]) + + +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) + + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) + + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) + + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi + +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) + + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) + +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine which file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac +]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4 new file mode 100644 index 0000000..5d9acd8 --- /dev/null +++ b/m4/ltoptions.m4 @@ -0,0 +1,384 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 7 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## Macros to handle LT_INIT options. ## +## --------------------------------- ## + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [1], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + +## ----------------- ## +## LTDL_INIT Options ## +## ----------------- ## + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4 new file mode 100644 index 0000000..9000a05 --- /dev/null +++ b/m4/ltsugar.m4 @@ -0,0 +1,123 @@ +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) diff --git a/m4/ltversion.m4 b/m4/ltversion.m4 new file mode 100644 index 0000000..07a8602 --- /dev/null +++ b/m4/ltversion.m4 @@ -0,0 +1,23 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# @configure_input@ + +# serial 3337 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.4.2' +macro_revision='1.3337' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4 new file mode 100644 index 0000000..c573da9 --- /dev/null +++ b/m4/lt~obsolete.m4 @@ -0,0 +1,98 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 5 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff --git a/make/gcc-linux.mk b/make/gcc-linux.mk new file mode 100644 index 0000000..d34ecf0 --- /dev/null +++ b/make/gcc-linux.mk @@ -0,0 +1,87 @@ +# +# This file primarily exists for making it possible to test the build +# system and external library support from Linux. However, its use is +# strongly discouraged; use the (default) libtool rules for building +# on Linux. +# + +# --- Required interface definitions --- + +OBJ=o +LOBJ=o + +# Usage: $(call libname,base) +define libname +lib$(1).so +endef + +# Usage: $(call binname,base) +define binname +$(1) +endef + +# --- Required rule definitions --- + +# 1 2 +# Usage: $(call compile,src,includes) +define compile + $(CXX) $(CPPFLAGS) $(CXXFLAGS) \ + $(call depflags,$(basename $(call src_to_obj,$(1)))) \ + $(foreach I,$(2),-I$(I)) \ + -c $(1) -o $(call src_to_obj,$(1)) +endef + +# 1 2 +# Usage: $(call c_compile,src,includes) +define c_compile + $(CC) $(CPPFLAGS) $(CFLAGS) \ + $(call depflags,$(basename $(call c_src_to_obj,$(1)))) \ + $(foreach I,$(2),-I$(I)) \ + -c $(1) -o $(call c_src_to_obj,$(1)) +endef + +define libcompile + $(CXX) $(CPPFLAGS) $(CXXFLAGS) -fpic \ + $(call depflags,$(basename $(call src_to_lobj,$(1)))) \ + $(foreach I,$(2),-I$(I)) \ + -c $(1) -o $(call src_to_lobj,$(1)) +endef +define c_libcompile + $(CC) $(CPPFLAGS) $(CXXFLAGS) -fpic \ + $(call depflags,$(basename $(call c_src_to_lobj,$(1)))) \ + $(foreach I,$(2),-I$(I)) \ + -c $(1) -o $(call c_src_to_lobj,$(1)) +endef + + +# 1 2 +# Usage: $(call makeslib,objs,library) +define makeslib + $(RM) $2 + $(AR) cru $(2) $(1) + $(RANLIB) $(2) +endef + +# 1 2 3 4 5 6 7 +# Usage: $(call makelib,objs,library,ldflags,libs,current,revision,age) +define makelib + $(RM) $(2) $(2).* + major=$$(( $(5) - $(7) )); \ + versuffix=$$major.$(7).$(6); \ + $(CXX) $(CXXFLAGS) -shared -o $(2).$$versuffix $(1) \ + -Wl,--soname -Wl,`basename $(2)`.$$major \ + $(3) $(4) && \ + ln -s `basename $(2)`.$$versuffix $(2) && \ + ln -s `basename $(2)`.$$versuffix $(2).$$major +endef + +# 1 2 3 4 +# Usage: $(call makebin,objs,binary,ldflags,libs) +define makebin + $(CXX) $(CXXFLAGS) $(1) -o $(2) $(LDFLAGS) $(3) $(4) +endef + +# Install target + +install: all + @echo Automated installation is not supported for buildrules=$(BUILDRULES) diff --git a/make/installwin.mk b/make/installwin.mk new file mode 100644 index 0000000..e3401d8 --- /dev/null +++ b/make/installwin.mk @@ -0,0 +1,21 @@ +DEST=$(INSTALL_DIR)/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) +installwin: all + $(RM) -r $(INSTALL_DIR) + mkdir $(INSTALL_DIR) + mkdir $(DEST) + mkdir $(DEST)/bin + mkdir $(DEST)/lib + mkdir $(DEST)/include + mkdir $(DEST)/include/qpdf + mkdir $(DEST)/doc + cp libqpdf/$(OUTPUT_DIR)/$(STATIC_LIB_NAME) $(DEST)/lib + cp libqpdf/$(OUTPUT_DIR)/qpdf*.dll $(DEST)/bin + perl copy_dlls libqpdf/$(OUTPUT_DIR)/qpdf*.dll $(DEST)/bin $(OBJDUMP) + cp qpdf/$(OUTPUT_DIR)/qpdf.exe $(DEST)/bin + cp zlib-flate/$(OUTPUT_DIR)/zlib-flate.exe $(DEST)/bin + cp qpdf/fix-qdf $(DEST)/bin + cp include/qpdf/*.h $(DEST)/include/qpdf + cp include/qpdf/*.hh $(DEST)/include/qpdf + cp doc/stylesheet.css $(DEST)/doc + cp doc/qpdf-manual.html $(DEST)/doc + cp doc/qpdf-manual.pdf $(DEST)/doc diff --git a/make/libtool.mk b/make/libtool.mk new file mode 100644 index 0000000..8112c2c --- /dev/null +++ b/make/libtool.mk @@ -0,0 +1,133 @@ +# --- Required interface definitions --- + +# LIBTOOL needs bash +SHELL=/bin/bash + +OBJ=o +LOBJ=lo + +# Usage: $(call libname,base) +define libname +lib$(1).la +endef + +# Usage: $(call binname,base) +define binname +$(1) +endef + +# --- Private definitions --- + +ifeq ($(HAVE_LD_VERSION_SCRIPT), 1) +LD_VERSION_FLAGS=-Wl,--version-script=libqpdf.map +else +LD_VERSION_FLAGS= +endif + +# Usage: $(call libdepflags,$(basename obj)) +# Usage: $(call fixdeps,$(basename obj)) +ifeq ($(GENDEPS),1) +libdepflags=-MD -MF $(1).tdep -MP +fixdeps=sed -e 's/\.o:/.lo:/' < $(1).tdep > $(1).dep + +else +libdepflags= +fixdeps= +endif + +# --- Required rule definitions --- + +# 1 2 +# Usage: $(call compile,src,includes) +define compile + $(CXX) $(CXXFLAGS) \ + $(call depflags,$(basename $(call src_to_obj,$(1)))) \ + $(foreach I,$(2),-I$(I)) \ + $(CPPFLAGS) \ + -c $(1) -o $(call src_to_obj,$(1)) +endef + +# 1 2 +# Usage: $(call c_compile,src,includes) +define c_compile + $(CC) $(CFLAGS) \ + $(call depflags,$(basename $(call c_src_to_obj,$(1)))) \ + $(foreach I,$(2),-I$(I)) \ + $(CPPFLAGS) \ + -c $(1) -o $(call c_src_to_obj,$(1)) +endef + +# 1 2 +# Usage: $(call libcompile,src,includes) +define libcompile + $(LIBTOOL) --quiet --mode=compile \ + $(CXX) $(CXXFLAGS) \ + $(call libdepflags,$(basename $(call src_to_obj,$(1)))) \ + $(foreach I,$(2),-I$(I)) \ + $(CPPFLAGS) \ + -c $(1) -o $(call src_to_obj,$(1)); \ + $(call fixdeps,$(basename $(call src_to_obj,$(1)))) +endef + +# 1 2 +# Usage: $(call libcompile,src,includes) +define c_libcompile + $(LIBTOOL) --quiet --mode=compile \ + $(CC) $(CXXFLAGS) \ + $(call libdepflags,$(basename $(call c_src_to_obj,$(1)))) \ + $(foreach I,$(2),-I$(I)) \ + $(CPPFLAGS) \ + -c $(1) -o $(call c_src_to_obj,$(1)); \ + $(call fixdeps,$(basename $(call src_to_obj,$(1)))) +endef + +# 1 2 +# Usage: $(call makeslib,objs,library) +define makeslib + $(RM) $2 + $(AR) cru $(2) $(1) + $(RANLIB) $(2) +endef + +# 1 2 3 4 5 6 7 +# Usage: $(call makelib,objs,library,ldflags,libs,current,revision,age) +define makelib + $(LIBTOOL) --mode=link \ + $(CXX) $(CXXFLAGS) $(LD_VERSION_FLAGS) \ + -o $(2) $(1) $(4) $(3) \ + -rpath $(libdir) -version-info $(5):$(6):$(7) +endef + +# 1 2 3 4 +# Usage: $(call makebin,objs,binary,ldflags,libs) +define makebin + $(LIBTOOL) --mode=link $(CXX) $(CXXFLAGS) $(1) -o $(2) $(4) $(3) +endef + +# Install target + +install: all + ./mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig + ./mkinstalldirs $(DESTDIR)$(bindir) + ./mkinstalldirs $(DESTDIR)$(includedir)/qpdf + ./mkinstalldirs $(DESTDIR)$(docdir) + ./mkinstalldirs $(DESTDIR)$(mandir)/man1 + $(LIBTOOL) --mode=install install -c \ + libqpdf/$(OUTPUT_DIR)/libqpdf.la \ + $(DESTDIR)$(libdir)/libqpdf.la + $(LIBTOOL) --finish $(DESTDIR)$(libdir) + $(RM) $(DESTDIR)$(libdir)/libqpdf.la + $(LIBTOOL) --mode=install install -c \ + qpdf/$(OUTPUT_DIR)/qpdf \ + $(DESTDIR)$(bindir)/qpdf + $(LIBTOOL) --mode=install install -c \ + zlib-flate/$(OUTPUT_DIR)/zlib-flate \ + $(DESTDIR)$(bindir)/zlib-flate + cp qpdf/fix-qdf $(DESTDIR)$(bindir) + cp include/qpdf/*.h $(DESTDIR)$(includedir)/qpdf + cp include/qpdf/*.hh $(DESTDIR)$(includedir)/qpdf + cp doc/stylesheet.css $(DESTDIR)$(docdir) +# cp doc/qpdf-manual.html $(DESTDIR)$(docdir) +# cp doc/qpdf-manual.pdf $(DESTDIR)$(docdir) + cp doc/*.1 $(DESTDIR)$(mandir)/man1 + cp libqpdf.pc $(DESTDIR)$(libdir)/pkgconfig diff --git a/make/mingw.mk b/make/mingw.mk new file mode 100644 index 0000000..00119d1 --- /dev/null +++ b/make/mingw.mk @@ -0,0 +1,83 @@ +# --- Required interface definitions --- + +OBJ=o +LOBJ=o + +# Usage: $(call libname,base) +define libname +lib$(1).a +endef + +# Usage: $(call binname,base) +define binname +$(1).exe +endef + +# --- Required rule definitions --- + +# 1 2 +# Usage: $(call compile,src,includes) +define compile + $(CXX) $(CPPFLAGS) $(CXXFLAGS) \ + $(call depflags,$(basename $(call src_to_obj,$(1)))) \ + $(foreach I,$(2),-I$(I)) \ + -c $(1) -o $(call src_to_obj,$(1)) +endef + +# 1 2 +# Usage: $(call c_compile,src,includes) +define c_compile + $(CC) $(CPPFLAGS) $(CFLAGS) \ + $(call depflags,$(basename $(call src_to_obj,$(1)))) \ + $(foreach I,$(2),-I$(I)) \ + -c $(1) -o $(call c_src_to_obj,$(1)) +endef + +# 1 2 +# Usage: $(call libcompile,src,includes) +define libcompile + $(CXX) $(CPPFLAGS) $(CXXFLAGS) -DDLL_EXPORT \ + $(call depflags,$(basename $(call src_to_obj,$(1)))) \ + $(foreach I,$(2),-I$(I)) \ + -c $(1) -o $(call src_to_obj,$(1)) +endef + +# 1 2 +# Usage: $(call c_libcompile,src,includes) +define c_libcompile + $(CC) $(CPPFLAGS) $(CFLAGS) -DDLL_EXPORT \ + $(call depflags,$(basename $(call src_to_obj,$(1)))) \ + $(foreach I,$(2),-I$(I)) \ + -c $(1) -o $(call c_src_to_obj,$(1)) +endef + +# 1 2 +# Usage: $(call makeslib,objs,library) +define makeslib + $(RM) $2 + $(AR) cru $(2) $(1) + $(RANLIB) $(2) +endef + +# 1 2 3 4 5 6 7 +# Usage: $(call makelib,objs,library,ldflags,libs,current,revision,age) +define makelib + $(DLLTOOL) -l $(2) -D $$(basename `echo $(2) | sed -e 's,/lib\(.*\).a,/\1,'`$(shell expr $(5) - $(7)).dll) $(1); \ + $(CXX) -shared -o `echo $(2) | sed -e 's,/lib\(.*\).a,/\1,'`$(shell expr $(5) - $(7)).dll \ + $(1) $(3) $(4) +endef + +# 1 2 3 4 +# Usage: $(call makebin,objs,binary,ldflags,libs) +define makebin + $(CXX) $(CXXFLAGS) $(1) -o $(2) $(3) $(4) +endef + +# Install target + +INSTALL_DIR = install-mingw$(WINDOWS_WORDSIZE) +STATIC_LIB_NAME = libqpdf.a +include make/installwin.mk +install: installwin + $(STRIP) $(DEST)/bin/*.exe + $(STRIP) $(DEST)/bin/*.dll diff --git a/make/msvc.mk b/make/msvc.mk new file mode 100644 index 0000000..5f3f69a --- /dev/null +++ b/make/msvc.mk @@ -0,0 +1,107 @@ +# --- Required interface definitions --- + +OBJ=obj +LOBJ=obj + +# Usage: $(call libname,base) +define libname +$(1).lib +endef + +# Usage: $(call binname,base) +define binname +$(1).exe +endef + +# --- Local Changes --- + +# Filter out -g +CFLAGS := $(filter-out -g,$(CFLAGS)) +CXXFLAGS := $(filter-out -g,$(CXXFLAGS)) + +# /WX makes all warnings errors. +CFLAGS += /WX +CXXFLAGS += /WX + +# /w14267 makes warning 4267 a level 1 warning. This warning reports +# potential issues between size_t, off_t, and non-compatible integer +# types. +CFLAGS += /w14267 +CXXFLAGS += /w14267 + +clean:: + $(RM) *.pdb + +# --- Required rule definitions --- + +# 1 2 +# Usage: $(call compile,src,includes) +define compile + cl /nologo /Zi /Gy /EHsc /MD /TP /GR $(CPPFLAGS) $(CXXFLAGS) \ + $(foreach I,$(2),-I$(I)) \ + /c $(1) /Fo$(call src_to_obj,$(1)) +endef + +# 1 2 +# Usage: $(call c_compile,src,includes) +define c_compile + cl /nologo /O2 /Zi /Gy /EHsc /MD $(CPPFLAGS) $(CFLAGS) \ + $(foreach I,$(2),-I$(I)) \ + /c $(1) /Fo$(call c_src_to_obj,$(1)) +endef + +# 1 2 +# Usage: $(call libcompile,src,includes) +define libcompile + cl /nologo /O2 /Zi /Gy /EHsc /MD /TP /GR $(CPPFLAGS) $(CXXFLAGS) \ + -DDLL_EXPORT $(foreach I,$(2),-I$(I)) \ + /c $(1) /Fo$(call src_to_obj,$(1)) +endef + +# 1 2 +# Usage: $(call c_libcompile,src,includes) +define c_libcompile + cl /nologo /O2 /Zi /Gy /EHsc /MD $(CPPFLAGS) $(CXXFLAGS) \ + -DDLL_EXPORT $(foreach I,$(2),-I$(I)) \ + /c $(1) /Fo$(call c_src_to_obj,$(1)) +endef + +# 1 2 +# Usage: $(call makeslib,objs,library) +define makeslib + lib /nologo /OUT:$(2) $(1) +endef + +# 1 2 3 4 5 6 7 +# Usage: $(call makelib,objs,library,ldflags,libs,current,revision,age) +define makelib + cl /nologo /O2 /Zi /Gy /EHsc /MD /LD /Fe$(basename $(2))$(shell expr $(5) - $(7)).dll $(1) \ + /link /incremental:no \ + $(foreach L,$(subst -L,,$(3)),/LIBPATH:$(L)) \ + $(foreach L,$(subst -l,,$(4)),$(L).lib) + if [ -f $(basename $(2))$(shell expr $(5) - $(7)).dll.manifest ]; then \ + mt.exe -nologo -manifest $(basename $(2))$(shell expr $(5) - $(7)).dll.manifest \ + -outputresource:$(basename $(2))$(shell expr $(5) - $(7)).dll\;2; \ + fi + mv $(basename $(2))$(shell expr $(5) - $(7)).lib $(2) +endef + +# 1 2 3 4 +# Usage: $(call makebin,objs,binary,ldflags,libs) +define makebin + cl /nologo /O2 /Zi /Gy /EHsc /MD $(1) \ + /link /incremental:no /OUT:$(2) \ + $(foreach L,$(subst -L,,$(3)),/LIBPATH:$(L)) \ + $(foreach L,$(subst -l,,$(4)),$(L).lib) + if [ -f $(2).manifest ]; then \ + mt.exe -nologo -manifest $(2).manifest \ + -outputresource:$(2)\;2; \ + fi +endef + +# Install target + +INSTALL_DIR = install-msvc$(WINDOWS_WORDSIZE) +STATIC_LIB_NAME = qpdf.lib +include make/installwin.mk +install: installwin diff --git a/make/proxy.mk b/make/proxy.mk new file mode 100644 index 0000000..1683186 --- /dev/null +++ b/make/proxy.mk @@ -0,0 +1,10 @@ +THIS=$(notdir $(abspath .)) + +all: + $(MAKE) -C .. build_$(THIS) + +check: + $(MAKE) -C .. check_$(THIS) + +clean: + $(MAKE) -C .. clean_$(THIS) diff --git a/make/rules.mk b/make/rules.mk new file mode 100644 index 0000000..efeb9a7 --- /dev/null +++ b/make/rules.mk @@ -0,0 +1,49 @@ +include make/$(BUILDRULES).mk + +define firstelem +$(word 1,$(subst /, ,$(1))) +endef +SPC := $(subst /, ,/) +define lastelem +$(subst $(SPC),/,$(word $(words $(subst /, ,$(1))),$(subst /, ,$(1)))) +endef +define objbase +$(patsubst %.$(2),%.$(3),$(firstelem)/$(OUTPUT_DIR)/$(lastelem)) +endef + +# Usage: $(call src_to_obj,srcs) +define src_to_obj +$(foreach F,$(1),$(call objbase,$(F),cc,$(OBJ))) +endef + +# Usage: $(call c_src_to_obj,srcs) +define c_src_to_obj +$(foreach F,$(1),$(call objbase,$(F),c,$(OBJ))) +endef + +# Usage: $(call src_to_lobj,srcs) +define src_to_lobj +$(foreach F,$(1),$(call objbase,$(F),cc,$(LOBJ))) +endef + +# Usage: $(call c_src_to_lobj,srcs) +define c_src_to_lobj +$(foreach F,$(1),$(call objbase,$(F),c,$(LOBJ))) +endef + +# Usage: $(call obj_to_dep,objs) +define obj_to_dep +$(patsubst %.$(OBJ),%.dep,$(1)) +endef + +# Usage: $(call lobj_to_dep,objs) +define lobj_to_dep +$(patsubst %.$(LOBJ),%.dep,$(1)) +endef + +# Usage: $(call depflags,$(basename obj)) +ifeq ($(GENDEPS),1) +depflags=-MD -MF $(1).dep -MP +else +depflags= +endif diff --git a/make_dist b/make_dist new file mode 100755 index 0000000..fb1436e --- /dev/null +++ b/make_dist @@ -0,0 +1,165 @@ +#!/usr/bin/env perl +# +# This program creates a source distribution of qpdf. For details, +# see README.maintainer. +# + +require 5.008; +use warnings; +use strict; +use File::Basename; +use Cwd; +use IO::File; + +my $whoami = basename($0); + +usage() unless @ARGV >= 1; +my $srcdir = shift(@ARGV); +my $run_tests = 1; +if (@ARGV) +{ + if ($ARGV[0] eq '--no-tests') + { + $run_tests = 0; + } + else + { + usage(); + } +} +$srcdir =~ s,/$,,; +usage() unless $srcdir =~ m/^qpdf-(\d+\.\d+(?:\.(a|b|rc)?\d+)?)$/; +my $version = $1; +usage() unless -d $srcdir; + +my $pwd = getcwd(); +cd($srcdir); + +# Check versions +my $fh = safe_open("configure.ac"); +my $config_version = 'unknown'; +while (<$fh>) +{ + if (m/^AC_INIT\(\[qpdf\],\[([^\)]+)\]\)/) + { + $config_version = $1; + last; + } +} +$fh->close(); + +$fh = safe_open("libqpdf/QPDF.cc"); +my $code_version = 'unknown'; +while (<$fh>) +{ + if (m/QPDF::qpdf_version = \"([^\"]+)\"/) + { + $code_version = $1; + last; + } +} +$fh->close(); + +$fh = safe_open("manual/qpdf-manual.xml"); +my $doc_version = 'unknown'; +while (<$fh>) +{ + if (m/swversion "([^\"]+)\"/) + { + $doc_version = $1; + last; + } +} +$fh->close(); + +$fh = safe_open("qpdf.spec"); +my $spec_version = 'unknown'; +while (<$fh>) +{ + if (m/Version: (.*)$/) + { + $spec_version = $1; + last; + } +} + +my $version_error = 0; +if ($version ne $config_version) +{ + print "$whoami: configure.ac version = $config_version\n"; + $version_error = 1; +} +if ($version ne $code_version) +{ + print "$whoami: QPDF.cc version = $code_version\n"; + $version_error = 1; +} +if ($version ne $doc_version) +{ + print "$whoami: qpdf-manual.xml version = $doc_version\n"; + $version_error = 1; +} +if ($version ne $spec_version) +{ + print "$whoami: qpdf.spec version = $spec_version\n"; + $version_error = 1; +} +if ($version_error) +{ + die "$whoami: version numbers are not consistent\n"; +} + +run("./autogen.sh"); +run("./configure --enable-doc-maintenance --enable-werror"); +run("make build_manual"); +run("make distclean"); +cd($pwd); +run("tar czvf $srcdir.tar.gz-candidate $srcdir"); +if ($run_tests) +{ + cd($srcdir); + run("./configure"); + run("make check"); + cd($pwd); +} +rename "$srcdir.tar.gz-candidate", "$srcdir.tar.gz" or die; + +print " +Source distribution created as $srcdir.tar.gz +You can now remove $srcdir. +If this is a release, don't forget to tag the version control system and +make a backup of the release tar file. + +"; + +sub safe_open +{ + my $file = shift; + my $fh = new IO::File("<$file") or die "$whoami: can't open $file: $!"; + $fh; +} + +sub run +{ + my $cmd = shift; + system($cmd) == 0 or die "$whoami: $cmd failed\n"; +} + +sub cd +{ + my $dir = shift; + chdir($dir) or die; +} + +sub usage +{ + die " +Usage: $whoami qpdf-version [ --no-tests ] + +qpdf-version must be a directory containing a pristine export of that +version of qpdf from the version control system. Use of --no-tests +can be used for internally testing releases, but do not use it for a +real release. + +"; +} diff --git a/make_windows_releases b/make_windows_releases new file mode 100755 index 0000000..dff7931 --- /dev/null +++ b/make_windows_releases @@ -0,0 +1,27 @@ +#!/bin/sh +if [ ! -d external-libs ]; then + echo "Please extract qpdf-external-libs-bin.zip and try again" + exit 2 +fi + +set -e +set -x +cwd=`pwd` +PATH=$cwd/libqpdf/build:$PATH + +rm -rf install-mingw* install-msvc* + +./config-mingw64 +make check install +make distclean +./config-mingw32 +make check install +make distclean + +set +x + +echo '' +echo 'Now run "./make_windows_releases-msvc 64" in a 64-bit MSVC environment' +echo 'and "./make_windows_releases-msvc 32" in a 32-bit MSVC environment.' +echo 'Then run "./make_windows_releases-finish".' +echo '' diff --git a/make_windows_releases-finish b/make_windows_releases-finish new file mode 100755 index 0000000..3ab5867 --- /dev/null +++ b/make_windows_releases-finish @@ -0,0 +1,24 @@ +#!/bin/sh +if [ ! -d external-libs ]; then + echo "Please extract qpdf-external-libs-bin.zip and try again" + exit 2 +fi + +set -e +set -x +cwd=`pwd` +PATH=$cwd/libqpdf/build:$PATH + +cd install-mingw32 +v=`ls -d qpdf-*` +cd .. + +for i in mingw32 mingw64 msvc32 msvc64; do + cp -p README-windows-install.txt install-$i/$v/README.txt + (cd install-$i; zip -r ../$v-bin-$i.zip $v) +done + +set +x + +echo "" +echo "$v-bin-mingw{32,64}.zip and $v-bin-msvc{32,64}.zip have been created." diff --git a/make_windows_releases-msvc b/make_windows_releases-msvc new file mode 100755 index 0000000..40a3979 --- /dev/null +++ b/make_windows_releases-msvc @@ -0,0 +1,21 @@ +#!/bin/sh +if [ ! -d external-libs ]; then + echo "Please extract qpdf-external-libs-bin.zip and try again" + exit 2 +fi + +w=$1 + +if [ "$w" = "" ]; then + echo "Usage: $0 {32|64}" + exit 2 +fi + +set -e +set -x +cwd=`pwd` +PATH=$cwd/libqpdf/build:$PATH + +./config-msvc $w +make check install +make distclean diff --git a/manual/Makefile b/manual/Makefile new file mode 100644 index 0000000..9089905 --- /dev/null +++ b/manual/Makefile @@ -0,0 +1 @@ +include ../make/proxy.mk diff --git a/manual/README b/manual/README new file mode 100644 index 0000000..88118ac --- /dev/null +++ b/manual/README @@ -0,0 +1,3 @@ +This directory contains sources to the documentation. If you are +looking for pre-built documentation, please look in the "doc" +directory. diff --git a/manual/build.mk b/manual/build.mk new file mode 100644 index 0000000..55c4965 --- /dev/null +++ b/manual/build.mk @@ -0,0 +1,43 @@ +INDOC = manual/qpdf-manual +OUTDOC = manual/$(OUTPUT_DIR)/qpdf-manual + +TARGETS_manual := doc/qpdf.1 doc/fix-qdf.1 doc/zlib-flate.1 +ifeq ($(BUILD_HTML),1) +TARGETS_manual += doc/qpdf-manual.html +endif +ifeq ($(BUILD_PDF),1) +TARGETS_manual += doc/qpdf-manual.pdf +endif + +VALIDATE=manual/$(OUTPUT_DIR)/validate + +ifeq ($(VALIDATE_DOC),1) + +$(VALIDATE): $(INDOC).xml + $(XMLLINT) --noout --dtdvalid $(DOCBOOKX_DTD) $< + touch $(VALIDATE) + +else + +$(VALIDATE): + touch $(VALIDATE) + +endif + +$(OUTDOC).pdf: $(OUTDOC).fo + $(FOP) $< -pdf $@ + +$(OUTDOC).html: $(INDOC).xml manual/html.xsl $(VALIDATE) + $(XSLTPROC) --output $@ manual/html.xsl $< + +.PRECIOUS: $(OUTDOC).fo +$(OUTDOC).fo: $(INDOC).xml manual/print.xsl $(VALIDATE) + $(XSLTPROC) --output $@ manual/print.xsl $< + +doc/%.1: manual/%.1.in + sed -e 's:@PACKAGE_VERSION@:$(PACKAGE_VERSION):g' \ + -e 's:@docdir@:$(docdir):g' \ + < $< > $@ + +doc/%: manual/$(OUTPUT_DIR)/% + cp $< $@ diff --git a/manual/common.xsl b/manual/common.xsl new file mode 100644 index 0000000..e564bfd --- /dev/null +++ b/manual/common.xsl @@ -0,0 +1,9 @@ + + + + 0pt + + + + diff --git a/manual/fix-qdf.1.in b/manual/fix-qdf.1.in new file mode 100644 index 0000000..e1f7f8c --- /dev/null +++ b/manual/fix-qdf.1.in @@ -0,0 +1,18 @@ +\" This file is not processed by autoconf, but rather by build.mk in +\" the manual directory. +.TH FIX-QDF "1" "April 2008" "fix-qdf version @PACKAGE_VERSION@" "User Commands" +.SH NAME +fix-qdf \- repair PDF files in QDF form after editing +.SH SYNOPSIS +.B qpdf +< \fIinfilename\fR > \fIoutfilename\fR +.SH DESCRIPTION +The fix-qdf program is part of the qpdf package. +.PP +The fix-qdf program reads a PDF file in QDF form and writes out +the same file with stream lengths, cross-reference table entries, and +object stream offset tables regenerated. +.PP +For details about fix-qdf and about PDF files in QDF mode, please see +the qpdf manual, which can be found in @docdir@/qpdf-manual.html or +@docdir@/qpdf-manual.pdf. diff --git a/manual/html.xsl.in b/manual/html.xsl.in new file mode 100644 index 0000000..e96f058 --- /dev/null +++ b/manual/html.xsl.in @@ -0,0 +1,8 @@ + + + + + stylesheet.css + diff --git a/manual/print.xsl.in b/manual/print.xsl.in new file mode 100644 index 0000000..d712cb3 --- /dev/null +++ b/manual/print.xsl.in @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + #F0F0F0 + 0.5pt + solid + #575757 + 3pt + + + #00c + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/manual/qpdf-manual.xml b/manual/qpdf-manual.xml new file mode 100644 index 0000000..0bdc32c --- /dev/null +++ b/manual/qpdf-manual.xml @@ -0,0 +1,3277 @@ + + + + + + + + +]> + + + QPDF Manual + For QPDF Version &swversion;, &lastreleased; + + JayBerkenbilt + + + 2005–2012 + Jay Berkenbilt + + + + General Information + + QPDF is a program that does structural, content-preserving + transformations on PDF files. QPDF's website is located at http://qpdf.sourceforge.net/. + QPDF's source code is hosted on github at https://github.com/qpdf/qpdf. + + + QPDF has been released under the terms of Version + 2.0 of the Artistic License, a copy of which appears in the + file Artistic-2.0 in the source distribution. + + + QPDF was originally created in 2001 and modified periodically + between 2001 and 2005 during my employment at Apex CoVantage. Upon my + departure from Apex, the company graciously allowed me to take + ownership of the software and continue maintaining as an open + source project, a decision for which I am very grateful. I have + made considerable enhancements to it since that time. I feel + fortunate to have worked for people who would make such a decision. + This work would not have been possible without their support. + + + + What is QPDF? + + QPDF is a program that does structural, content-preserving + transformations on PDF files. It could have been called something + like pdf-to-pdf. It also provides many useful + capabilities to developers of PDF-producing software or for people + who just want to look at the innards of a PDF file to learn more + about how they work. + + + With QPDF, it is possible to copy objects from one PDF file into + another and to manipulate the list of pages in a PDF file. This + makes it possible to merge and split PDF files. The QPDF library + also makes it possible for you to create PDF files from scratch. + In this mode, you are responsible for supplying all the contents of + the file, while the QPDF library takes care off all the syntactical + representation of the objects, creation of cross references tables + and, if you use them, object streams, encryption, linearization, + and other syntactic details. You are still responsible for + generating PDF content on your own. + + + QPDF has been designed with very few external dependencies, and it + is intentionally very lightweight. QPDF is + not a PDF content creation library, a PDF + viewer, or a program capable of converting PDF into other formats. + In particular, QPDF knows nothing about the semantics of PDF + content streams. If you are looking for something that can do + that, you should look elsewhere. However, once you have a valid + PDF file, QPDF can be used to transform that file in ways perhaps + your original PDF creation can't handle. For example, many + programs generate simple PDF files but can't password-protect them, + web-optimize them, or perform other transformations of that type. + + + + Building and Installing QPDF + + This chapter describes how to build and install qpdf. Please see + also the README and + INSTALL files in the source distribution. + + + System Requirements + + The qpdf package has relatively few external dependencies. In + order to build qpdf, the following packages are required: + + + + zlib: http://www.zlib.net/ + + + + + pcre: http://www.pcre.org/ + + + + + gnu make 3.81 or newer: http://www.gnu.org/software/make + + + + + perl version 5.8 or newer: + http://www.perl.org/; + required for fix-qdf and the test suite. + + + + + GNU diffutils (any version): http://www.gnu.org/software/diffutils/ + is required to run the test suite. Note that this is the + version of diff present on virtually all GNU/Linux systems. + This is required because the test suite uses diff + -u. + + + + + A C++ compiler that works well with STL and has the long + long type. Most modern C++ compilers should fit the + bill fine. QPDF is tested with gcc and Microsoft Visual C++. + + + + + + Part of qpdf's test suite does comparisons of the contents PDF + files by converting them images and comparing the images. The + image comparison tests are disabled by default. Those tests are + not required for determining correctness of a qpdf build if you + have not modified the code since the test suite also contains + expected output files that are compared literally. The image + comparison tests provide an extra check to make sure that any + content transformations don't break the rendering of pages. + Transformations that affect the content streams themselves are off + by default and are only provided to help developers look into the + contents of PDF files. If you are making deep changes to the + library that cause changes in the contents of the files that qpdf + generates, then you should enable the image comparison tests. + Enable them by running configure with the + flag. If you enable + this, the following additional requirements are required by the + test suite. Note that in no case are these items required to use + qpdf. + + + + libtiff: http://www.remotesensing.org/libtiff/ + + + + + GhostScript version 8.60 or newer: http://www.ghostscript.com + + + + If you do not enable this, then you do not need to have tiff and + ghostscript. + + + If Adobe Reader is installed as acroread, some + additional test cases will be enabled. These test cases simply + verify that Adobe Reader can open the files that qpdf creates. + They require version 8.0 or newer to pass. However, in order to + avoid having qpdf depend on non-free (as in liberty) software, the + test suite will still pass without Adobe reader, and the test + suite still exercises the full functionality of the software. + + + Pre-built documentation is distributed with qpdf, so you should + generally not need to rebuild the documentation. In order to + build the documentation from its docbook sources, you need the + docbook XML style sheets (http://downloads.sourceforge.net/docbook/). + To build the PDF version of the documentation, you need Apache fop + (http://xml.apache.org/fop/) + version 0.94 or higher. + + + + Build Instructions + + Building qpdf on UNIX is generally just a matter of running + + ./configure +make + + You can also run make check to run the test + suite and make install to install. Please run + ./configure --help for options on what can be + configured. You can also set the value of + DESTDIR during installation to install to a + temporary location, as is common with many open source packages. + Please see also the README and + INSTALL files in the source distribution. + + + Building on Windows is a little bit more complicated. For + details, please see README-windows.txt in the + source distribution. You can also download a binary distribution + for Windows. There is a port of qpdf to Visual C++ version 6 in + the contrib area generously contributed by + Jian Ma. This is also discussed in more detail in + README-windows.txt. + + + There are some other things you can do with the build. Although + qpdf uses autoconf, it does not use + automake but instead uses a + hand-crafted non-recursive Makefile that requires gnu make. If + you're really interested, please read the comments in the + top-level Makefile. + + + + + Running QPDF + + This chapter describes how to run the qpdf program from the command + line. + + + Basic Invocation + + When running qpdf, the basic invocation is as follows: + + qpdf + + This converts PDF file to PDF file + . The output file is functionally + identical to the input file but may have been structurally + reorganized. Also, orphaned objects will be removed from the + file. Many transformations are available as controlled by the + options below. In place of , the + parameter may be specified. This causes + qpdf to use a dummy input file that contains zero pages. The only + normal use case for using would be if you + were going to add pages from another source, as discussed in . + + + does not have to be seekable, even + when generating linearized files. Specifying + “” as + means to write to standard output. However, you can't specify the + same file as both the input and the output because qpdf reads data + from the input file as it writes to the output file. + + + Most options require an output file, but some testing or + inspection commands do not. These are specifically noted. + + + + Basic Options + + The following options are the most common ones and perform + commonly needed transformations. + + + + + + Specifies a password for accessing encrypted files. + + + + + + + + Causes generation of a linearized (web-optimized) output file. + + + + + + + + Encrypt the file using the same encryption parameters, + including user and owner password, as the specified file. Use + to specify a password + if one is needed to open this file. Note that copying the + encryption parameters from a file also copies the first half + of /ID from the file since this is part of + the encryption parameters. + + + + + + + + If the file specified with + requires a password, specify the password using this option. + Note that only one of the user or owner password is required. + Both passwords will be preserved since QPDF does not + distinguish between the two passwords. It is possible to + preserve encryption parameters, including the owner password, + from a file even if you don't know the file's owner password. + + + + + + + + Causes generation an encrypted output file. Please see for details on how to + specify encryption parameters. + + + + + + + + Removes any encryption on the file. A password must be + supplied if the file is password protected. + + + + + + + + Select specific pages from one or more input files. See for details on how to do page + selection (splitting and merging). + + + + + + + Password-protected files may be opened by specifying a password. + By default, qpdf will preserve any encryption data associated with + a file. If is specified, qpdf will + attempt to remove any encryption information. If + is specified, qpdf will replace the + document's encryption parameters with whatever is specified. + + + Note that qpdf does not obey encryption restrictions already + imposed on the file. Doing so would be meaningless since qpdf can + be used to remove encryption from the file entirely. This + functionality is not intended to be used for bypassing copyright + restrictions or other restrictions placed on files by their + producers. + + + In all cases where qpdf allows specification of a password, care + must be taken if the password contains characters that fall + outside of the 7-bit US-ASCII character range to ensure that the + exact correct byte sequence is provided. It is possible that a + future version of qpdf may handle this more gracefully. For + example, if a password was encrypted using a password that was + encoded in ISO-8859-1 and your terminal is configured to use + UTF-8, the password you supply may not work properly. There are + various approaches to handling this. For example, if you are + using Linux and have the iconv executable (part of the ICU + package) installed, you could pass to qpdf where + password is a password specified in + your terminal's locale. A detailed discussion of this is out of + scope for this manual, but just be aware of this issue if you have + trouble with a password that contains 8-bit characters. + + + + Encryption Options + + To change the encryption parameters of a file, use the --encrypt + flag. The syntax is + + + + Note that “” terminates parsing of + encryption flags and must be present even if no restrictions are + present. + + + Either or both of the user password and the owner password may be + empty strings. + + + The value for + may be 40 + or 128. The restriction flags are dependent upon key length. + When no additional restrictions are given, the default is to be + fully permissive. + + + If is 40, + the following restriction options are available: + + + + + + Determines whether or not to allow printing. + + + + + + + + Determines whether or not to allow document modification. + + + + + + + + Determines whether or not to allow text/image extraction. + + + + + + + + Determines whether or not to allow comments and form fill-in + and signing. + + + + + If is 128, + the following restriction options are available: + + + + + + Determines whether or not to allow accessibility to visually + impaired. + + + + + + + + Determines whether or not to allow text/graphic extraction. + + + + + + + + Controls printing access. + may be + one of the following: + + + + : allow full printing + + + + + : allow low-resolution printing only + + + + + : disallow printing + + + + + + + + + + + Controls modify access. + may be + one of the following, each of which implies all the options + that follow it: + + + + : allow full document modification + + + + + : allow comment authoring and form operations + + + + + : allow form field fill-in and signing + + + + + : allow document assembly only + + + + + : allow no modifications + + + + + + + + + + + If specified, any metadata stream in the document will be left + unencrypted even if the rest of the document is encrypted. + This also forces the PDF version to be at least 1.5. + + + + + + + + If is specified, AES encryption + will be used instead of RC4 encryption. This forces the PDF + version to be at least 1.6. + + + + + + + + Use of this option forces the /V and + /R parameters in the document's encryption + dictionary to be set to the value 4. As + qpdf will automatically do this when required, there is no + reason to ever use this option. It exists primarily for use + in testing qpdf itself. This option also forces the PDF + version to be at least 1.5. + + + + + The default for each permission option is to be fully permissive. + + + + Page Selection Options + + Starting with qpdf 3.0, it is possible to split and merge PDF + files by selecting pages from one or more input files. Whatever + file is given as the primary input file is used as the starting + point, but its pages are replaced with pages as specified. + + + + Multiple input files may be specified. Each one is given as the + name of the input file, an optional password (if required to open + the file), and the range of pages. Note that + “” terminates parsing of page + selection flags. + + + For each file that pages should be taken from, specify the file, a + password needed to open the file (if any), and a page range. The + password needs to be given only once per file. If any of the + input files are the same as the primary input file or the file + used to copy encryption parameters (if specified), you do not need + to repeat the password here. The same file can be repeated + multiple times. If a file that is repeated has a password, the + password only has to be given the first time. All non-page data + (info, outlines, page numbers, etc.) are taken from the primary + input file. To discard these, use as the + primary input. + + + It is not presently possible to specify the same page from the + same file directly more than once, but you can make this work by + specifying two different paths to the same file (such as by + putting ./ somewhere in the path). This can + also be used if you want to repeat a page from one of the input + files in the output file. This may be made more convenient in a + future version of qpdf if there is enough demand for this feature. + + + The page range is a set of numbers separated by commas, ranges of + numbers separated dashes, or combinations of those. The character + “z” represents the last page. Pages can appear in any + order. Ranges can appear with a high number followed by a low + number, which causes the pages to appear in reverse. Repeating a + number will cause an error, but you can use the workaround + discussed above should you really want to include the same page + twice. + + + Example page ranges: + + + + 1,3,5-9,15-12: pages 1, 2, 3, 5, 6, 7, 8, + 9, 15, 14, 13, and 12. + + + + + z-1: all pages in the document in reverse + + + + + + Note that qpdf doesn't presently do anything special about other + constructs in a PDF file that may know about pages, so semantics + of splitting and merging vary across features. For example, the + document's outlines (bookmarks) point to actual page objects, so + if you select some pages and not others, bookmarks that point to + pages that are in the output file will work, and remaining + bookmarks will not work. On the other hand, page labels (page + numbers specified in the file) are just sequential, so page labels + will be messed up in the output file. A future version of + qpdf may do a better job at handling these + issues. (Note that the qpdf library already contains all of the + APIs required in order to implement this in your own application + if you need it.) In the mean time, you can always use + as the primary input file to avoid + copying all of that from the first file. For example, to take + pages 1 through 5 from a infile.pdf while + preserving all metadata associated with that file, you could use + + qpdf + + If you wanted pages 1 through 5 from + infile.pdf but you wanted the rest of the + metadata to be dropped, you could instead run + + qpdf + + If you wanted to take pages 1–5 from + file1.pdf and pages 11–15 from + file2.pdf in reverse, you would run + + qpdf + + If, for some reason, you wanted to take the first page of an + encrypted file called encrypted.pdf with + password pass and repeat it twice in an output + file, and if you wanted to drop metadata (like page numbers and + outlines) but preserve encryption, you would use + + qpdf + + Note that we had to specify the password all three times because + giving a password as + doesn't count for page selection, and as far as qpdf is concerned, + encrypted.pdf and + ./encrypted.pdf are separated files. These + are all corner cases that most users should hopefully never have + to be bothered with. + + + + Advanced Transformation Options + + These transformation options control fine points of how qpdf + creates the output file. Mostly these are of use only to people + who are very familiar with the PDF file format or who are PDF + developers. The following options are available: + + + + + + Controls transformation of stream data. The value of + may be one + of the following: + + + + : recompress stream data when + possible (default) + + + + + : leave all stream data as is + + + + + : uncompress stream data when + possible + + + + + + + + + + + Enables or disables normalization of content streams. + + + + + + + + Prevents qpdf from attempting to recover damaged files. + + + + + + + + Controls handing of object streams. The value of + may be one of + the following: + + + + : preserve original object streams + (default) + + + + + : don't write any object streams + + + + + : use object streams wherever + possible + + + + + + + + + + + Tells qpdf to ignore any cross-reference streams. + + + + + + + + Turns on QDF mode. For additional information on QDF, please + see . + + + + + + + + Forces the PDF version of the output file to be at least + version. In other words, if the + input file has a lower version than the specified version, the + specified version will be used. If the input file has a + higher version, the input file's original version will be + used. It is seldom necessary to use this option since qpdf + will automatically increase the version as needed when adding + features that require newer PDF readers. + + + + + + + + This option forces the PDF version to be the exact version + specified even when the file may have content that + is not supported in that version. In some cases, + forcing the output file's PDF version to be lower than that of + the input file will cause qpdf to disable certain features of + the document. Specifically, AES encryption is disabled if the + version is less than 1.6, cleartext metadata and object + streams are disabled if less than 1.5, 128-bit encryption keys + are disabled if less than 1.4, and all encryption is disabled + if less than 1.3. Even with these precautions, qpdf won't be + able to do things like eliminate use of newer image + compression schemes, transparency groups, or other features + that may have been added in more recent versions of PDF. + + + As a general rule, with the exception of big structural things + like the use of object streams or AES encryption, PDF viewers + are supposed to ignore features in files that they don't + support from newer versions. This means that forcing the + version to a lower version may make it possible to open your + PDF file with an older version, though bear in mind that some + of the original document's functionality may be lost. + + + + + + + By default, when a stream is encoded using non-lossy filters that + qpdf understands and is not already compressed using a good + compression scheme, qpdf will uncompress and recompress streams. + Assuming proper filter implements, this is safe and generally + results in smaller files. This behavior may also be explicitly + requested with . + + + When is specified, qpdf + will never attempt to change the filtering of any stream data. + + + When is specified, qpdf + will attempt to remove any non-lossy filters that it supports. + This includes /FlateDecode, + /LZWDecode, /ASCII85Decode, + and /ASCIIHexDecode. This can be very useful + for inspecting the contents of various streams. + + + When is specified, qpdf + will attempt to normalize whitespace and newlines in page content + streams. This is generally safe but could, in some cases, cause + damage to the content streams. This option is intended for people + who wish to study PDF content streams or to debug PDF content. + You should not use this for “production” PDF files. + + + Ordinarily, qpdf will attempt to recover from certain types of + errors in PDF files. These include errors in the cross-reference + table, certain types of object numbering errors, and certain types + of stream length errors. Sometimes, qpdf may think it has + recovered but may not have actually recovered, so care should be + taken when using this option as some data loss is possible. The + option will prevent qpdf from + attempting recovery. In this case, it will fail on the first + error that it encounters. + + + Object streams, also known as compressed objects, were introduced + into the PDF specification at version 1.5, corresponding to + Acrobat 6. Some older PDF viewers may not support files with + object streams. qpdf can be used to transform files with object + streams to files without object streams or vice versa. As + mentioned above, there are three object stream modes: + , , and + . + + + In mode, the relationship to objects and + the streams that contain them is preserved from the original file. + In mode, all objects are written as + regular, uncompressed objects. The resulting file should be + readable by older PDF viewers. (Of course, the content of the + files may include features not supported by older viewers, but at + least the structure will be supported.) In + mode, qpdf will create its own object + streams. This will usually result in more compact PDF files, + though they may not be readable by older viewers. In this mode, + qpdf will also make sure the PDF version number in the header is + at least 1.5. + + + Ordinarily, qpdf reads cross-reference streams when they are + present in a PDF file. If + is specified, qpdf will ignore any cross-reference streams for + hybrid PDF files. The purpose of hybrid files is to make some + content available to viewers that are not aware of cross-reference + streams. It is almost never desirable to ignore them. The only + time when you might want to use this feature is if you are testing + creation of hybrid PDF files and wish to see how a PDF consumer + that doesn't understand object and cross-reference streams would + interpret such a file. + + + The flag turns on QDF mode, which changes + some of the defaults described above. Specifically, in QDF mode, + by default, stream data is uncompressed, content streams are + normalized, and encryption is removed. These defaults can still + be overridden by specifying the appropriate options as described + above. Additionally, in QDF mode, stream lengths are stored as + indirect objects, objects are laid out in a less efficient but + more readable fashion, and the documents are interspersed with + comments that make it easier for the user to find things and also + make it possible for fix-qdf to work properly. + QDF mode is intended for people, mostly developers, who wish to + inspect or modify PDF files in a text editor. For details, please + see . + + + + Testing, Inspection, and Debugging Options + + These options can be useful for digging into PDF files or for use + in automated test suites for software that uses the qpdf library. + When any of the options in this section are specified, no output + file should be given. The following options are available: + + + + + + Causes generation of a fixed value for /ID. This is intended + for testing only. Never use it for production files. + + + + + + + + Causes use of a static initialization vector for AES-CBC. + This is intended for testing only so that output files can be + reproducible. Never use it for production files. This option + in particular is not secure since it significantly weakens the + encryption. + + + + + + + + Suppresses inclusion of original object ID comments in QDF + files. This can be useful when generating QDF files for test + purposes, particularly when comparing them to determine + whether two PDF files have identical content. + + + + + + + + Shows document encryption parameters. Also shows the + document's user password if the owner password is given. + + + + + + + + Checks file integrity and linearization status. + + + + + + + + Checks and displays all data in the linearization hint tables. + + + + + + + + Shows the contents of the cross-reference table in a + human-readable form. This is especially useful for files with + cross-reference streams which are stored in a binary format. + + + + + + + + Show the contents of the given object. This is especially + useful for inspecting objects that are inside of object + streams (also known as “compressed objects”). + + + + + + + + When used along with the + option, if the object is a stream, shows the raw stream data + instead of object's contents. + + + + + + + + When used along with the + option, if the object is a stream, shows the filtered stream + data instead of object's contents. If the stream is filtered + using filters that qpdf does not support, an error will be + issued. + + + + + + + + Shows the object and generation number for each page + dictionary object and for each content stream associated with + the page. Having this information makes it more convenient to + inspect objects from a particular page. + + + + + + + + When used along with , also shows + the object and generation numbers for the image objects on + each page. (At present, information about images in shared + resource dictionaries are not output by this command. This is + discussed in a comment in the source code.) + + + + + + + + Checks file structure and well as encryption, linearization, + and encoding of stream data. A file for which + reports no errors may still have + errors in stream data content but should otherwise be + structurally sound. If any errors, + qpdf will exit with a status of 2. There are some recoverable + conditions that detects. These are + issued as warnings instead of errors. If qpdf finds no errors + but finds warnings, it will exit with a status of 3 (as of + version 2.0.4). + + + + + + + The and + options are ignored unless + is given. Either of these options + will cause the stream data to be written to standard output. In + order to avoid commingling of stream data with other output, it is + recommend that these objects not be combined with other + test/inspection options. + + + If is given and + is also given, qpdf will + attempt to normalize the stream data as if it is a page content + stream. This attempt will be made even if it is not a page + content stream, in which case it will produce unusable results. + + + + + QDF Mode + + In QDF mode, qpdf creates PDF files in what we call QDF + form. A PDF file in QDF form, sometimes called a QDF + file, is a completely valid PDF file that has + %QDF-1.0 as its third line (after the pdf header + and binary characters) and has certain other characteristics. The + purpose of QDF form is to make it possible to edit PDF files, with + some restrictions, in an ordinary text editor. This can be very + useful for experimenting with different PDF constructs or for + making one-off edits to PDF files (though there are other reasons + why this may not always work). + + + It is ordinarily very difficult to edit PDF files in a text editor + for two reasons: most meaningful data in PDF files is compressed, + and PDF files are full of offset and length information that makes + it hard to add or remove data. A QDF file is organized in a manner + such that, if edits are kept within certain constraints, the + fix-qdf program, distributed with qpdf, is able + to restore edited files to a correct state. The + fix-qdf program takes no command-line + arguments. It reads a possibly edited QDF file from standard input + and writes a repaired file to standard output. + + + The following attributes characterize a QDF file: + + + + All objects appear in numerical order in the PDF file, including + when objects appear in object streams. + + + + + Objects are printed in an easy-to-read format, and all line + endings are normalized to UNIX line endings. + + + + + Unless specifically overridden, streams appear uncompressed + (when qpdf supports the filters and they are compressed with a + non-lossy compression scheme), and most content streams are + normalized (line endings are converted to just a UNIX-style + linefeeds). + + + + + All streams lengths are represented as indirect objects, and the + stream length object is always the next object after the stream. + If the stream data does not end with a newline, an extra newline + is inserted, and a special comment appears after the stream + indicating that this has been done. + + + + + If the PDF file contains object streams, if object stream + n contains k objects, + those objects are numbered from n+1 through + n+k, and the object number/offset pairs + appear on a separate line for each object. Additionally, each + object in the object stream is preceded by a comment indicating + its object number and index. This makes it very easy to find + objects in object streams. + + + + + All beginnings of objects, stream tokens, + endstream tokens, and + endobj tokens appear on lines by themselves. + A blank line follows every endobj token. + + + + + If there is a cross-reference stream, it is unfiltered. + + + + + Page dictionaries and page content streams are marked with + special comments that make them easy to find. + + + + + Comments precede each object indicating the object number of the + corresponding object in the original file. + + + + + + When editing a QDF file, any edits can be made as long as the above + constraints are maintained. This means that you can freely edit a + page's content without worrying about messing up the QDF file. It + is also possible to add new objects so long as those objects are + added after the last object in the file or subsequent objects are + renumbered. If a QDF file has object streams in it, you can always + add the new objects before the xref stream and then change the + number of the xref stream, since nothing generally ever references + it by number. + + + It is not generally practical to remove objects from QDF files + without messing up object numbering, but if you remove all + references to an object, you can run qpdf on the file (after + running fix-qdf), and qpdf will omit the + now-orphaned object. + + + When fix-qdf is run, it goes through the file + and recomputes the following parts of the file: + + + + the /N, /W, and + /First keys of all object stream dictionaries + + + + + the pairs of numbers representing object numbers and offsets of + objects in object streams + + + + + all stream lengths + + + + + the cross-reference table or cross-reference stream + + + + + the offset to the cross-reference table or cross-reference + stream following the startxref token + + + + + + + Using the QPDF Library + + The source tree for the qpdf package has an + examples directory that contains a few + example programs. The qpdf/qpdf.cc source + file also serves as a useful example since it exercises almost all + of the qpdf library's public interface. The best source of + documentation on the library itself is reading comments in + include/qpdf/QPDF.hh, + include/qpdf/QDFWriter.hh, and + include/qpdf/QPDFObjectHandle.hh. + + + All header files are installed in the include/qpdf directory. It + is recommend that you use #include + <qpdf/QPDF.hh> rather than adding + include/qpdf to your include path. + + + When linking against the qpdf static library, you may also need to + specify -lpcre -lz on your link command. If + your system understands how to read libtool + .la files, this may not be necessary. + + + The qpdf library is safe to use in a multithreaded program, but no + individual QPDF object instance (including + QPDF, QPDFObjectHandle, or + QPDFWriter) can be used in more than one thread at a + time. Multiple threads may simultaneously work with different + instances of these and all other QPDF objects. + + + + Design and Library Notes + + Introduction + + This section was written prior to the implementation of the qpdf + package and was subsequently modified to reflect the + implementation. In some cases, for purposes of explanation, it + may differ slightly from the actual implementation. As always, + the source code and test suite are authoritative. Even if there + are some errors, this document should serve as a road map to + understanding how this code works. + + + In general, one should adhere strictly to a specification when + writing but be liberal in reading. This way, the product of our + software will be accepted by the widest range of other programs, + and we will accept the widest range of input files. This library + attempts to conform to that philosophy whenever possible but also + aims to provide strict checking for people who want to validate + PDF files. If you don't want to see warnings and are trying to + write something that is tolerant, you can call + setSuppressWarnings(true). If you want to fail + on the first error, you can call + setAttemptRecovery(false). The default + behavior is to generating warnings for recoverable problems. Note + that recovery will not always produce the desired results even if + it is able to get through the file. Unlike most other PDF files + that produce generic warnings such as “This file is + damaged,”, qpdf generally issues a detailed error message + that would be most useful to a PDF developer. This is by design + as there seems to be a shortage of PDF validation tools out + there. (This was, in fact, one of the major motivations behind + the initial creation of qpdf.) + + + + Design Goals + + The QPDF package includes support for reading and rewriting PDF + files. It aims to hide from the user details involving object + locations, modified (appended) PDF files, the + directness/indirectness of objects, and stream filters including + encryption. It does not aim to hide knowledge of the object + hierarchy or content stream contents. Put another way, a user of + the qpdf library is expected to have knowledge about how PDF files + work, but is not expected to have to keep track of bookkeeping + details such as file positions. + + + A user of the library never has to care whether an object is + direct or indirect. All access to objects deals with this + transparently. All memory management details are also handled by + the library. + + + The PointerHolder object is used internally + by the library to deal with memory management. This is basically + a smart pointer object very similar in spirit to the Boost + library's shared_ptr object, but predating + it by several years. This library also makes use of a technique + for giving fine-grained access to methods in one class to other + classes by using public subclasses with friends and only private + members that in turn call private methods of the containing class. + See QPDFObjectHandle::Factory as an + example. + + + The top-level qpdf class is QPDF. A + QPDF object represents a PDF file. The + library provides methods for both accessing and mutating PDF + files. + + + QPDFObject is the basic PDF Object class. + It is an abstract base class from which are derived classes for + each type of PDF object. Clients do not interact with Objects + directly but instead interact with + QPDFObjectHandle. + + + QPDFObjectHandle contains + PointerHolder<QPDFObject> and + includes accessor methods that are type-safe proxies to the + methods of the derived object classes as well as methods for + querying object types. They can be passed around by value, + copied, stored in containers, etc. with very low overhead. + Instances of QPDFObjectHandle always + contain a reference back to the QPDF object + from which they were created. A + QPDFObjectHandle may be direct or indirect. + If indirect, the QPDFObject the + PointerHolder initially points to is a null + pointer. In this case, the first attempt to access the underlying + QPDFObject will result in the + QPDFObject being resolved via a call to the + referenced QPDF instance. This makes it + essentially impossible to make coding errors in which certain + things will work for some PDF files and not for others based on + which objects are direct and which objects are indirect. + + + Instances of QPDFObjectHandle can be + directly created and modified using static factory methods in the + QPDFObjectHandle class. There are factory + methods for each type of object as well as a convenience method + QPDFObjectHandle::parse that creates an + object from a string representation of the object. Existing + instances of QPDFObjectHandle can also be + modified in several ways. See comments in + QPDFObjectHandle.hh for details. + + + When the QPDF class creates a new object, + it dynamically allocates the appropriate type of + QPDFObject and immediately hands the + pointer to an instance of QPDFObjectHandle. + The parser reads a token from the current file position. If the + token is a not either a dictionary or array opener, an object is + immediately constructed from the single token and the parser + returns. Otherwise, the parser is invoked recursively in a + special mode in which it accumulates objects until it finds a + balancing closer. During this process, the + “R” keyword is recognized and an + indirect QPDFObjectHandle may be + constructed. + + + The QPDF::resolve() method, which is used to + resolve an indirect object, may be invoked from the + QPDFObjectHandle class. It first checks a + cache to see whether this object has already been read. If not, + it reads the object from the PDF file and caches it. It the + returns the resulting QPDFObjectHandle. + The calling object handle then replaces its + PointerHolder<QDFObject> with the one + from the newly returned QPDFObjectHandle. + In this way, only a single copy of any direct object need exist + and clients can access objects transparently without knowing + caring whether they are direct or indirect objects. Additionally, + no object is ever read from the file more than once. That means + that only the portions of the PDF file that are actually needed + are ever read from the input file, thus allowing the qpdf package + to take advantage of this important design goal of PDF files. + + + If the requested object is inside of an object stream, the object + stream itself is first read into memory. Then the tokenizer reads + objects from the memory stream based on the offset information + stored in the stream. Those individual objects are cached, after + which the temporary buffer holding the object stream contents are + discarded. In this way, the first time an object in an object + stream is requested, all objects in the stream are cached. + + + An instance of QPDF is constructed by using + the class's default constructor. If desired, the + QPDF object may be configured with various + methods that change its default behavior. Then the + QPDF::processFile() method is passed the name + of a PDF file, which permanently associates the file with that + QPDF object. A password may also be given for access to + password-protected files. QPDF does not enforce encryption + parameters and will treat user and owner passwords equivalently. + Either password may be used to access an encrypted file. + + + As pointed out earlier, the intention is not for qpdf to be used + to bypass security on files. but as any open source PDF consumer + may be easily modified to bypass basic PDF document security, + and qpdf offers may transformations that can do this as well, + there seems to be little point in the added complexity of + conditionally enforcing document security. + + + QPDF will allow recovery of a user password + given an owner password. The input PDF file must be seekable. + (Output files written by QPDFWriter need + not be seekable, even when creating linearized files.) During + construction, QPDF validates the PDF file's + header, and then reads the cross reference tables and trailer + dictionaries. The QPDF class keeps only + the first trailer dictionary though it does read all of them so it + can check the /Prev key. + QPDF class users may request the root + object and the trailer dictionary specifically. The cross + reference table is kept private. Objects may then be requested by + number of by walking the object tree. + + + When a PDF file has a cross-reference stream instead of a + cross-reference table and trailer, requesting the document's + trailer dictionary returns the stream dictionary from the + cross-reference stream instead. + + + There are some convenience routines for very common operations + such as walking the page tree and returning a vector of all page + objects. For full details, please see the header file + QPDF.hh. + + + The following example should clarify how + QPDF processes a simple file. + + + + Client constructs QPDF + pdf and calls + pdf.processFile("a.pdf");. + + + + + The QPDF class checks the beginning of + a.pdf for + %!PDF-1.[0-9]+. It then reads the cross + reference table mentioned at the end of the file, ensuring that + it is looking before the last %%EOF. After + getting to trailer keyword, it invokes the + parser. + + + + + The parser sees “<<”, so + it calls itself recursively in dictionary creation mode. + + + + + In dictionary creation mode, the parser keeps accumulating + objects until it encounters + “>>”. Each object that is + read is pushed onto a stack. If + “R” is read, the last two + objects on the stack are inspected. If they are integers, they + are popped off the stack and their values are used to construct + an indirect object handle which is then pushed onto the stack. + When “>>” is finally read, + the stack is converted into a + QPDF_Dictionary which is placed in a + QPDFObjectHandle and returned. + + + + + The resulting dictionary is saved as the trailer dictionary. + + + + + The /Prev key is searched. If present, + QPDF seeks to that point and repeats + except that the new trailer dictionary is not saved. If + /Prev is not present, the initial parsing + process is complete. + + + If there is an encryption dictionary, the document's encryption + parameters are initialized. + + + + + The client requests root object. The + QPDF class gets the value of root key + from trailer dictionary and returns it. It is an unresolved + indirect QPDFObjectHandle. + + + + + The client requests the /Pages key from root + QPDFObjectHandle. The + QPDFObjectHandle notices that it is + indirect so it asks QPDF to resolve it. + QPDF looks in the object cache for an + object with the root dictionary's object ID and generation + number. Upon not seeing it, it checks the cross reference + table, gets the offset, and reads the object present at that + offset. It stores the result in the object cache and returns + the cached result. The calling + QPDFObjectHandle replaces its object + pointer with the one from the resolved + QPDFObjectHandle, verifies that it a + valid dictionary object, and returns the (unresolved indirect) + QPDFObject handle to the top of the + Pages hierarchy. + + + As the client continues to request objects, the same process is + followed for each new requested object. + + + + + + + Encryption + + Encryption is supported transparently by qpdf. When opening a PDF + file, if an encryption dictionary exists, the + QPDF object processes this dictionary using + the password (if any) provided. The primary decryption key is + computed and cached. No further access is made to the encryption + dictionary after that time. When an object is read from a file, + the object ID and generation of the object in which it is + contained is always known. Using this information along with the + stored encryption key, all stream and string objects are + transparently decrypted. Raw encrypted objects are never stored + in memory. This way, nothing in the library ever has to know or + care whether it is reading an encrypted file. + + + An interface is also provided for writing encrypted streams and + strings given an encryption key. This is used by + QPDFWriter when it rewrites encrypted + files. + + + + Adding and Removing Pages + + While qpdf's API has supported adding and modifying objects for + some time, version 3.0 introduces specific methods for adding and + removing pages. These are largely convenience routines that + handle two tricky issues: pushing inheritable resources from the + /Pages tree down to individual pages and + manipulation of the /Pages tree itself. For + details, see addPage and surrounding methods + in QPDF.hh. + + + + Reserving Object Numbers + + Version 3.0 of qpdf introduced the concept of reserved objects. + These are seldom needed for ordinary operations, but there are + cases in which you may want to add a series of indirect objects + with references to each other to a QPDF + object. This causes a problem because you can't determine the + object ID that a new indirect object will have until you add it to + the QPDF object with + QPDF::makeIndirectObject. The only way to + add two mutually referential objects to a + QPDF object prior to version 3.0 would be + to add the new objects first and then make them refer to each + other after adding them. Now it is possible to create a + reserved object using + QPDFObjectHandle::newReserved. This is an + indirect object that stays “unresolved” even if it is + queried for its type. So now, if you want to create a set of + mutually referential objects, you can create reservations for each + one of them and use those reservations to construct the + references. When finished, you can call + QPDF::replaceReserved to replace the reserved + objects with the real ones. This functionality will never be + needed by most applications, but it is used internally by QPDF + when copying objects from other PDF files, as discussed in . For an example of how to use + reserved objects, search for newReserved in + test_driver.cc in qpdf's sources. + + + + Copying Objects From Other PDF Files + + Version 3.0 of qpdf introduced the ability to copy objects into a + QPDF object from a different + QPDF object, which we refer to as + foreign objects. This allows arbitrary + merging of PDF files. The qpdf command-line + tool provides limited support for basic page selection, including + merging in pages from other files, but the library's API makes it + possible to implement arbitrarily complex merging operations. The + main method for copying foreign objects is + QPDF::copyForeignObject. This takes an + indirect object from another QPDF and + copies it recursively into this object while preserving all object + structure, including circular references. This means you can add + a direct object that you create from scratch to a + QPDF object with + QPDF::makeIndirectObject, and you can add an + indirect object from another file with + QPDF::copyForeignObject. The fact that + QPDF::makeIndirectObject does not + automatically detect a foreign object and copy it is an explicit + design decision. Copying a foreign object seems like a + sufficiently significant thing to do that it should be done + explicitly. + + + The other way to copy foreign objects is by passing a page from + one QPDF to another by calling + QPDF::addPage. In contrast to + QPDF::makeIndirectObject, this method + automatically distinguishes between indirect objects in the + current file, foreign objects, and direct objects. + + + + Writing PDF Files + + The qpdf library supports file writing of + QPDF objects to PDF files through the + QPDFWriter class. The + QPDFWriter class has two writing modes: one + for non-linearized files, and one for linearized files. See for a description of linearization + is implemented. This section describes how we write + non-linearized files including the creation of QDF files (see + . + + + This outline was written prior to implementation and is not + exactly accurate, but it provides a correct “notional” + idea of how writing works. Look at the code in + QPDFWriter for exact details. + + + + Initialize state: + + + + next object number = 1 + + + + + object queue = empty + + + + + renumber table: old object id/generation to new id/0 = empty + + + + + xref table: new id -> offset = empty + + + + + + + + Create a QPDF object from a file. + + + + + Write header for new PDF file. + + + + + Request the trailer dictionary. + + + + + For each value that is an indirect object, grab the next object + number (via an operation that returns and increments the + number). Map object to new number in renumber table. Push + object onto queue. + + + + + While there are more objects on the queue: + + + + Pop queue. + + + + + Look up object's new number n in the + renumbering table. + + + + + Store current offset into xref table. + + + + + Write n 0 obj. + + + + + If object is null, whether direct or indirect, write out + null, thus eliminating unresolvable indirect object + references. + + + + + If the object is a stream stream, write stream contents, + piped through any filters as required, to a memory buffer. + Use this buffer to determine the stream length. + + + + + If object is not a stream, array, or dictionary, write out + its contents. + + + + + If object is an array or dictionary (including stream), + traverse its elements (for array) or values (for + dictionaries), handling recursive dictionaries and arrays, + looking for indirect objects. When an indirect object is + found, if it is not resolvable, ignore. (This case is + handled when writing it out.) Otherwise, look it up in the + renumbering table. If not found, grab the next available + object number, assign to the referenced object in the + renumbering table, and push the referenced object onto the + queue. As a special case, when writing out a stream + dictionary, replace length, filters, and decode parameters + as required. + + + Write out dictionary or array, replacing any unresolvable + indirect object references with null (pdf spec says + reference to non-existent object is legal and resolves to + null) and any resolvable ones with references to the + renumbered objects. + + + + + If the object is a stream, write + stream\n, the stream contents (from the + memory buffer), and \nendstream\n. + + + + + When done, write endobj. + + + + + + + + + Once we have finished the queue, all referenced objects will have + been written out and all deleted objects or unreferenced objects + will have been skipped. The new cross-reference table will + contain an offset for every new object number from 1 up to the + number of objects written. This can be used to write out a new + xref table. Finally we can write out the trailer dictionary with + appropriately computed /ID (see spec, 8.3, File Identifiers), the + cross reference table offset, and %%EOF. + + + + Filtered Streams + + Support for streams is implemented through the + Pipeline interface which was designed for + this package. + + + When reading streams, create a series of + Pipeline objects. The + Pipeline abstract base requires + implementation write() and + finish() and provides an implementation of + getNext(). Each pipeline object, upon + receiving data, does whatever it is going to do and then writes + the data (possibly modified) to its successor. Alternatively, a + pipeline may be an end-of-the-line pipeline that does something + like store its output to a file or a memory buffer ignoring a + successor. For additional details, look at + Pipeline.hh. + + + QPDF can read raw or filtered streams. + When reading a filtered stream, the QPDF + class creates a Pipeline object for one of + each appropriate filter object and chains them together. The last + filter should write to whatever type of output is required. The + QPDF class has an interface to write raw or + filtered stream contents to a given pipeline. + + + + + Linearization + + This chapter describes how QPDF and + QPDFWriter implement creation and processing + of linearized PDFS. + + + Basic Strategy for Linearization + + To avoid the incestuous problem of having the qpdf library + validate its own linearized files, we have a special linearized + file checking mode which can be invoked via qpdf + --check-linearization (or qpdf + --check). This mode reads the linearization parameter + dictionary and the hint streams and validates that object + ordering, parameters, and hint stream contents are correct. The + validation code was first tested against linearized files created + by external tools (Acrobat and pdlin) and then used to validate + files created by QPDFWriter itself. + + + + Preparing For Linearization + + Before creating a linearized PDF file from any other PDF file, the + PDF file must be altered such that all page attributes are + propagated down to the page level (and not inherited from parents + in the /Pages tree). We also have to know + which objects refer to which other objects, being concerned with + page boundaries and a few other cases. We refer to this part of + preparing the PDF file as optimization, + discussed in . Note the, in + this context, the term optimization is a + qpdf term, and the term linearization is a + term from the PDF specification. Do not be confused by the fact + that many applications refer to linearization as optimization or + web optimization. + + + When creating linearized PDF files from optimized PDF files, there + are really only a few issues that need to be dealt with: + + + + Creation of hints tables + + + + + Placing objects in the correct order + + + + + Filling in offsets and byte sizes + + + + + + + Optimization + + In order to perform various operations such as linearization and + splitting files into pages, it is necessary to know which objects + are referenced by which pages, page thumbnails, and root and + trailer dictionary keys. It is also necessary to ensure that all + page-level attributes appear directly at the page level and are + not inherited from parents in the pages tree. + + + We refer to the process of enforcing these constraints as + optimization. As mentioned above, note + that some applications refer to linearization as optimization. + Although this optimization was initially motivated by the need to + create linearized files, we are using these terms separately. + + + PDF file optimization is implemented in the + QPDF_optimization.cc source file. That file + is richly commented and serves as the primary reference for the + optimization process. + + + After optimization has been completed, the private member + variables obj_user_to_objects and + object_to_obj_users in + QPDF have been populated. Any object that + has more than one value in the + object_to_obj_users table is shared. Any + object that has exactly one value in the + object_to_obj_users table is private. To find + all the private objects in a page or a trailer or root dictionary + key, one merely has make this determination for each element in + the obj_user_to_objects table for the given + page or key. + + + Note that pages and thumbnails have different object user types, + so the above test on a page will not include objects referenced by + the page's thumbnail dictionary and nothing else. + + + + Writing Linearized Files + + We will create files with only primary hint streams. We will + never write overflow hint streams. (As of PDF version 1.4, + Acrobat doesn't either, and they are never necessary.) The hint + streams contain offset information to objects that point to where + they would be if the hint stream were not present. This means + that we have to calculate all object positions before we can + generate and write the hint table. This means that we have to + generate the file in two passes. To make this reliable, + QPDFWriter in linearization mode invokes + exactly the same code twice to write the file to a pipeline. + + + In the first pass, the target pipeline is a count pipeline chained + to a discard pipeline. The count pipeline simply passes its data + through to the next pipeline in the chain but can return the + number of bytes passed through it at any intermediate point. The + discard pipeline is an end of line pipeline that just throws its + data away. The hint stream is not written and dummy values with + adequate padding are stored in the first cross reference table, + linearization parameter dictionary, and /Prev key of the first + trailer dictionary. All the offset, length, object renumbering + information, and anything else we need for the second pass is + stored. + + + At the end of the first pass, this information is passed to the + QPDF class which constructs a compressed + hint stream in a memory buffer and returns it. + QPDFWriter uses this information to write a + complete hint stream object into a memory buffer. At this point, + the length of the hint stream is known. + + + In the second pass, the end of the pipeline chain is a regular + file instead of a discard pipeline, and we have known values for + all the offsets and lengths that we didn't have in the first pass. + We have to adjust offsets that appear after the start of the hint + stream by the length of the hint stream, which is known. Anything + that is of variable length is padded, with the padding code + surrounding any writing code that differs in the two passes. This + ensures that changes to the way things are represented never + results in offsets that were gathered during the first pass + becoming incorrect for the second pass. + + + Using this strategy, we can write linearized files to a + non-seekable output stream with only a single pass to disk or + wherever the output is going. + + + + Calculating Linearization Data + + Once a file is optimized, we have information about which objects + access which other objects. We can then process these tables to + decide which part (as described in “Linearized PDF Document + Structure” in the PDF specification) each object is + contained within. This tells us the exact order in which objects + are written. The QPDFWriter class asks for + this information and enqueues objects for writing in the proper + order. It also turns on a check that causes an exception to be + thrown if an object is encountered that has not already been + queued. (This could happen only if there were a bug in the + traversal code used to calculate the linearization data.) + + + + Known Issues with Linearization + + There are a handful of known issues with this linearization code. + These issues do not appear to impact the behavior of linearized + files which still work as intended: it is possible for a web + browser to begin to display them before they are fully + downloaded. In fact, it seems that various other programs that + create linearized files have many of these same issues. These + items make reference to terminology used in the linearization + appendix of the PDF specification. + + + + Thread Dictionary information keys appear in part 4 with the + rest of Threads instead of in part 9. Objects in part 9 are + not grouped together functionally. + + + + + We are not calculating numerators for shared object positions + within content streams or interleaving them within content + streams. + + + + + We generate only page offset, shared object, and outline hint + tables. It would be relatively easy to add some additional + tables. We gather most of the information needed to create + thumbnail hint tables. There are comments in the code about + this. + + + + + + + Debugging Note + + The qpdf --show-linearization command can show + the complete contents of linearization hint streams. To look at + the raw data, you can extract the filtered contents of the + linearization hint tables using qpdf --show-object=n + --filtered-stream-data. Then, to convert this into a + bit stream (since linearization tables are bit streams written + without regard to byte boundaries), you can pipe the resulting + data through the following perl code: + + use bytes; +binmode STDIN; +undef $/; +my $a = <STDIN>; +my @ch = split(//, $a); +map { printf("%08b", ord($_)) } @ch; +print "\n"; + + + + + + Object and Cross-Reference Streams + + This chapter provides information about the implementation of + object stream and cross-reference stream support in qpdf. + + + Object Streams + + Object streams can contain any regular object except the + following: + + + + stream objects + + + + + objects with generation > 0 + + + + + the encryption dictionary + + + + + objects containing the /Length of another stream + + + + In addition, Adobe reader (at least as of version 8.0.0) appears + to not be able to handle having the document catalog appear in an + object stream if the file is encrypted, though this is not + specifically disallowed by the specification. + + + There are additional restrictions for linearized files. See for details. + + + The PDF specification refers to objects in object streams as + “compressed objects” regardless of whether the object + stream is compressed. + + + The generation number of every object in an object stream must be + zero. It is possible to delete and replace an object in an object + stream with a regular object. + + + The object stream dictionary has the following keys: + + + + /N: number of objects + + + + + /First: byte offset of first object + + + + + /Extends: indirect reference to stream that + this extends + + + + + + Stream collections are formed with /Extends. + They must form a directed acyclic graph. These can be used for + semantic information and are not meaningful to the PDF document's + syntactic structure. Although qpdf preserves stream collections, + it never generates them and doesn't make use of this information + in any way. + + + The specification recommends limiting the number of objects in + object stream for efficiency in reading and decoding. Acrobat 6 + uses no more than 100 objects per object stream for linearized + files and no more 200 objects per stream for non-linearized files. + QPDFWriter, in object stream generation + mode, never puts more than 100 objects in an object stream. + + + Object stream contents consists of N pairs of + integers, each of which is the object number and the byte offset + of the object relative to the first object in the stream, followed + by the objects themselves, concatenated. + + + + Cross-Reference Streams + + For non-hybrid files, the value following + startxref is the byte offset to the xref stream + rather than the word xref. + + + For hybrid files (files containing both xref tables and + cross-reference streams), the xref table's trailer dictionary + contains the key /XRefStm whose value is the + byte offset to a cross-reference stream that supplements the xref + table. A PDF 1.5-compliant application should read the xref table + first. Then it should replace any object that it has already seen + with any defined in the xref stream. Then it should follow any + /Prev pointer in the original xref table's + trailer dictionary. The specification is not clear about what + should be done, if anything, with a /Prev + pointer in the xref stream referenced by an xref table. The + QPDF class ignores it, which is probably + reasonable since, if this case were to appear for any sensible PDF + file, the previous xref table would probably have a corresponding + /XRefStm pointer of its own. For example, if a + hybrid file were appended, the appended section would have its own + xref table and /XRefStm. The appended xref + table would point to the previous xref table which would point the + /XRefStm, meaning that the new + /XRefStm doesn't have to point to it. + + + Since xref streams must be read very early, they may not be + encrypted, and the may not contain indirect objects for keys + required to read them, which are these: + + + + /Type: value /XRef + + + + + /Size: value n+1: where + n is highest object number (same as + /Size in the trailer dictionary) + + + + + /Index (optional): value + [n count ...] + used to determine which objects' information is stored in this + stream. The default is [0 /Size]. + + + + + /Prev: value + offset: byte offset of previous xref + stream (same as /Prev in the trailer + dictionary) + + + + + /W [...]: sizes of each field in the xref + table + + + + + + The other fields in the xref stream, which may be indirect if + desired, are the union of those from the xref table's trailer + dictionary. + + + Cross-Reference Stream Data + + The stream data is binary and encoded in big-endian byte order. + Entries are concatenated, and each entry has a length equal to + the total of the entries in /W above. Each + entry consists of one or more fields, the first of which is the + type of the field. The number of bytes for each field is given + by /W above. A 0 in /W + indicates that the field is omitted and has the default value. + The default value for the field type is + “1”. All other default values are + “0”. + + + PDF 1.5 has three field types: + + + + 0: for free objects. Format: 0 obj + next-generation, same as the free table in a + traditional cross-reference table + + + + + 1: regular non-compressed object. Format: 1 offset + generation + + + + + 2: for objects in object streams. Format: 2 + object-stream-number index, the number of object + stream containing the object and the index within the object + stream of the object. + + + + + + It seems standard to have the first entry in the table be + 0 0 0 instead of 0 0 ffff + if there are no deleted objects. + + + + + Implications for Linearized Files + + For linearized files, the linearization dictionary, document + catalog, and page objects may not be contained in object streams. + + + Objects stored within object streams are given the highest range + of object numbers within the main and first-page cross-reference + sections. + + + It is okay to use cross-reference streams in place of regular xref + tables. There are on special considerations. + + + Hint data refers to object streams themselves, not the objects in + the streams. Shared object references should also be made to the + object streams. There are no reference in any hint tables to the + object numbers of compressed objects (objects within object + streams). + + + When numbering objects, all shared objects within both the first + and second halves of the linearized files must be numbered + consecutively after all normal uncompressed objects in that half. + + + + Implementation Notes + + There are three modes for writing object streams: + , , and + . In disable mode, we do not generate + any object streams, and we also generate an xref table rather than + xref streams. This can be used to generate PDF files that are + viewable with older readers. In preserve mode, we write object + streams such that written object streams contain the same objects + and /Extends relationships as in the original + file. This is equal to disable if the file has no object streams. + In generate, we create object streams ourselves by grouping + objects that are allowed in object streams together in sets of no + more than 100 objects. We also ensure that the PDF version is at + least 1.5 in generate mode, but we preserve the version header in + the other modes. The default is . + + + We do not support creation of hybrid files. When we write files, + even in preserve mode, we will lose any xref tables and merge any + appended sections. + + + + + Release Notes + + For a detailed list of changes, please see the file + ChangeLog in the source distribution. + + + + 3.0.2: September 6, 2012 + + + + + Bug fix: QPDFWriter::setOutputMemory did + not work when not used with + QPDFWriter::setStaticID, which made it + pretty much useless. This has been fixed. + + + + + New API call + QPDFWriter::setExtraHeaderText inserts + additional text near the header of the PDF file. The intended + use case is to insert comments that may be consumed by a + downstream application, though other use cases may exist. + + + + + + + + + 3.0.1: August 11, 2012 + + + + + Version 3.0.0 included addition of files for + pkg-config, but this was not mentioned in + the release notes. The release notes for 3.0.0 were updated + to mention this. + + + + + Bug fix: if an object stream ended with a scalar object not + followed by space, qpdf would incorrectly report that it + encountered a premature EOF. This bug has been in qpdf since + version 2.0. + + + + + + + + + 3.0.0: August 2, 2012 + + + + + Acknowledgment: I would like to express gratitude for the + contributions of Tobias Hoffmann toward the release of qpdf + version 3.0. He is responsible for most of the implementation + and design of the new API for manipulating pages, and + contributed code and ideas for many of the improvements made + in version 3.0. Without his work, this release would + certainly not have happened as soon as it did, if at all. + + + + + Non-compatible API change: The version of + QPDFObjectHandle::replaceStreamData that + uses a StreamDataProvider no longer + requires (or accepts) a length parameter. + See for an explanation. + While care is taken to avoid non-compatible API changes in + general, an exception was made this time because the new + interface offers an opportunity to significantly simplify + calling code. + + + + + Support has been added for large files. The test suite + verifies support for files larger than 4 gigabytes, and manual + testing has verified support for files larger than 10 + gigabytes. Large file support is available for both 32-bit + and 64-bit platforms as long as the compiler and underlying + platforms support it. + + + + + Support for page selection (splitting and merging PDF files) + has been added to the qpdf command-line + tool. See . + + + + + Options have been added to the qpdf + command-line tool for copying encryption parameters from + another file. See . + + + + + New methods have been added to the QPDF + object for adding and removing pages. See . + + + + + New methods have been added to the QPDF + object for copying objects from other PDF files. See + + + + + A new method QPDFObjectHandle::parse has + been added for constructing + QPDFObjectHandle objects from a string + description. + + + + + Methods have been added to QPDFWriter + to allow writing to an already open stdio FILE* + addition to writing to standard output or a named file. + Methods have been added to QPDF to be + able to process a file from an already open stdio + FILE*. This makes it possible to read and write + PDF from secure temporary files that have been unlinked prior + to being fully read or written. + + + + + The QPDF::emptyPDF can be used to allow + creation of PDF files from scratch. The example + examples/pdf-create.cc illustrates how it + can be used. + + + + + Several methods to take + PointerHolder<Buffer> can now + also accept std::string arguments. + + + + + Many new convenience methods have been added to the library, + most in QPDFObjectHandle. See + ChangeLog for a full list. + + + + + When building on a platform that supports ELF shared libraries + (such as Linux), symbol versions are enabled by default. They + can be disabled by passing + to + ./configure. + + + + + The file libqpdf.pc is now installed to + support pkg-config. + + + + + Image comparison tests are off by default now since they are + not needed to verify a correct build or port of qpdf. They + are needed only when changing the actual PDF output generated + by qpdf. You should enable them if you are making deep + changes to qpdf itself. See README for + details. + + + + + Large file tests are off by default but can be turned on with + ./configure or by setting an environment + variable before running the test suite. See + README for details. + + + + + When qpdf's test suite fails, failures are not printed to the + terminal anymore by default. Instead, find them in + build/qtest.log. For packagers who are + building with an autobuilder, you can add the + option to + ./configure to restore the old behavior. + + + + + + + + + 2.3.1: December 28, 2011 + + + + + Fix thread-safety problem resulting from non-thread-safe use + of the PCRE library. + + + + + Made a few minor documentation fixes. + + + + + Add workaround for a bug that appears in some versions of + ghostscript to the test suite + + + + + Fix minor build issue for Visual C++ 2010. + + + + + + + 2.3.0: August 11, 2011 + + + + + Bug fix: when preserving existing encryption on encrypted + files with cleartext metadata, older qpdf versions would + generate password-protected files with no valid password. + This operation now works. This bug only affected files + created by copying existing encryption parameters; explicit + encryption with specification of cleartext metadata worked + before and continues to work. + + + + + Enhance QPDFWriter with a new + constructor that allows you to delay the specification of the + output file. When using this constructor, you may now call + QPDFWriter::setOutputFilename to specify + the output file, or you may use + QPDFWriter::setOutputMemory to cause + QPDFWriter to write the resulting PDF + file to a memory buffer. You may then use + QPDFWriter::getBuffer to retrieve the + memory buffer. + + + + + Add new API call QPDF::replaceObject for + replacing objects by object ID + + + + + Add new API call QPDF::swapObjects for + swapping two objects by object ID + + + + + Add QPDFObjectHandle::getDictAsMap and + QPDFObjectHandle::getArrayAsVector to + allow retrieval of dictionary objects as maps and array + objects as vectors. + + + + + Add functions qpdf_get_info_key and + qpdf_set_info_key to the C API for + manipulating string fields of the document's + /Info dictionary. + + + + + Add functions qpdf_init_write_memory, + qpdf_get_buffer_length, and + qpdf_get_buffer to the C API for writing + PDF files to a memory buffer instead of a file. + + + + + + + + + 2.2.4: June 25, 2011 + + + + + Fix installation and compilation issues; no functionality + changes. + + + + + + + 2.2.3: April 30, 2011 + + + + + Handle some damaged streams with incorrect characters + following the stream keyword. + + + + + Improve handling of inline images when normalizing content + streams. + + + + + Enhance error recovery to properly handle files that use + object 0 as a regular object, which is specifically disallowed + by the spec. + + + + + + + 2.2.2: October 4, 2010 + + + + + Add new function qpdf_read_memory + to the C API to call + QPDF::processMemoryFile. This was an + omission in qpdf 2.2.1. + + + + + + + 2.2.1: October 1, 2010 + + + + + Add new method QPDF::setOutputStreams + to replace std::cout and + std::cerr with other streams for generation + of diagnostic messages and error messages. This can be useful + for GUIs or other applications that want to capture any output + generated by the library to present to the user in some other + way. Note that QPDF does not write to + std::cout (or the specified output stream) + except where explicitly mentioned in + QPDF.hh, and that the only use of the + error stream is for warnings. Note also that output of + warnings is suppressed when + setSuppressWarnings(true) is called. + + + + + Add new method QPDF::processMemoryFile + for operating on PDF files that are loaded into memory rather + than in a file on disk. + + + + + Give a warning but otherwise ignore empty PDF objects by + treating them as null. Empty object are not permitted by the + PDF specification but have been known to appear in some actual + PDF files. + + + + + Handle inline image filter abbreviations when the appear as + stream filter abbreviations. The PDF specification does not + allow use of stream filter abbreviations in this way, but + Adobe Reader and some other PDF readers accept them since they + sometimes appear incorrectly in actual PDF files. + + + + + Implement miscellaneous enhancements to + PointerHolder and + Buffer to support other changes. + + + + + + + 2.2.0: August 14, 2010 + + + + + Add new methods to QPDFObjectHandle + (newStream and + replaceStreamData for creating new + streams and replacing stream data. This makes it possible to + perform a wide range of operations that were not previously + possible. + + + + + Add new helper method in + QPDFObjectHandle + (addPageContents) for appending or + prepending new content streams to a page. This method makes + it possible to manipulate content streams without having to be + concerned whether a page's contents are a single stream or an + array of streams. + + + + + Add new method in QPDFObjectHandle: + replaceOrRemoveKey, which replaces a + dictionary key + with a given value unless the value is null, in which case it + removes the key instead. + + + + + Add new method in QPDFObjectHandle: + getRawStreamData, which returns the raw + (unfiltered) stream data into a buffer. This complements the + getStreamData method, which returns the + filtered (uncompressed) stream data and can only be used when + the stream's data is filterable. + + + + + Provide two new examples: + pdf-double-page-size and + pdf-invert-images that illustrate the newly + added interfaces. + + + + + Fix a memory leak that would cause loss of a few bytes for + every object involved in a cycle of object references. Thanks + to Jian Ma for calling my attention to the leak. + + + + + + + 2.1.5: April 25, 2010 + + + + + Remove restriction of file identifier strings to 16 bytes. + This unnecessary restriction was preventing qpdf from being + able to encrypt or decrypt files with identifier strings that + were not exactly 16 bytes long. The specification imposes no + such restriction. + + + + + + + 2.1.4: April 18, 2010 + + + + + Apply the same padding calculation fix from version 2.1.2 to + the main cross reference stream as well. + + + + + Since qpdf --check only performs limited + checks, clarify the output to make it clear that there still + may be errors that qpdf can't check. This should make it less + surprising to people when another PDF reader is unable to read + a file that qpdf thinks is okay. + + + + + + + 2.1.3: March 27, 2010 + + + + + Fix bug that could cause a failure when rewriting PDF files + that contain object streams with unreferenced objects that in + turn reference indirect scalars. + + + + + Don't complain about (invalid) AES streams that aren't a + multiple of 16 bytes. Instead, pad them before decrypting. + + + + + + + 2.1.2: January 24, 2010 + + + + + Fix bug in padding around first half cross reference stream in + linearized files. The bug could cause an assertion failure + when linearizing certain unlucky files. + + + + + + + 2.1.1: December 14, 2009 + + + + + No changes in functionality; insert missing include in an + internal library header file to support gcc 4.4, and update + test suite to ignore broken Adobe Reader installations. + + + + + + + 2.1: October 30, 2009 + + + + + This is the first version of qpdf to include Windows support. + On Windows, it is possible to build a DLL. Additionally, a + partial C-language API has been introduced, which makes it + possible to call qpdf functions from non-C++ environments. I + am very grateful to Zarko Gagic (http://delphi.about.com/) + for tirelessly testing numerous pre-release versions of this + DLL and providing many excellent suggestions on improving the + interface. + + + For programming to the C interface, please see the header file + qpdf/qpdf-c.h and the example + examples/pdf-linearize.c. + + + + + Zarko Gajic has written a Delphi wrapper for qpdf, which can + be downloaded from qpdf's download side. Zarko's Delphi + wrapper is released with the same licensing terms as qpdf + itself and comes with this disclaimer: “Delphi wrapper + unit qpdf.pas created by Zarko Gajic + (http://delphi.about.com/). + Use at your own risk and for whatever purpose you want. No + support is provided. Sample code is provided.” + + + + + Support has been added for AES encryption and crypt filters. + Although qpdf does not presently support files that use + PKI-based encryption, with the addition of AES and crypt + filters, qpdf is now be able to open most encrypted files + created with newer versions of Acrobat or other PDF creation + software. Note that I have not been able to get very many + files encrypted in this way, so it's possible there could + still be some cases that qpdf can't handle. Please report + them if you find them. + + + + + Many error messages have been improved to include more + information in hopes of making qpdf a more useful tool for PDF + experts to use in manually recovering damaged PDF files. + + + + + Attempt to avoid compressing metadata streams if possible. + This is consistent with other PDF creation applications. + + + + + Provide new command-line options for AES encrypt, cleartext + metadata, and setting the minimum and forced PDF versions of + output files. + + + + + Add additional methods to the QPDF + object for querying the document's permissions. Although qpdf + does not enforce these permissions, it does make them + available so that applications that use qpdf can enforce + permissions. + + + + + The option to qpdf + has been extended to include some additional information. + + + + + There have been a handful of non-compatible API changes. For + details, see . + + + + + + + 2.0.6: May 3, 2009 + + + + + Do not attempt to uncompress streams that have decode + parameters we don't recognize. Earlier versions of qpdf would + have rejected files with such streams. + + + + + + + 2.0.5: March 10, 2009 + + + + + Improve error handling in the LZW decoder, and fix a small + error introduced in the previous version with regard to + handling full tables. The LZW decoder has been more strongly + verified in this release. + + + + + + + 2.0.4: February 21, 2009 + + + + + Include proper support for LZW streams encoded without the + “early code change” flag. Special thanks to Atom + Smasher who reported the problem and provided an input file + compressed in this way, which I did not previously have. + + + + + Implement some improvements to file recovery logic. + + + + + + + 2.0.3: February 15, 2009 + + + + + Compile cleanly with gcc 4.4. + + + + + Handle strings encoded as UTF-16BE properly. + + + + + + + 2.0.2: June 30, 2008 + + + + + Update test suite to work properly with a + non-bash /bin/sh and + with Perl 5.10. No changes were made to the actual qpdf + source code itself for this release. + + + + + + + 2.0.1: May 6, 2008 + + + + + No changes in functionality or interface. This release + includes fixes to the source code so that qpdf compiles + properly and passes its test suite on a broader range of + platforms. See ChangeLog in the source + distribution for details. + + + + + + + 2.0: April 29, 2008 + + + + + First public release. + + + + + + + + + Upgrading from 2.0 to 2.1 + + Although, as a general rule, we like to avoid introducing + source-level incompatibilities in qpdf's interface, there were a + few non-compatible changes made in this version. A considerable + amount of source code that uses qpdf will probably compile without + any changes, but in some cases, you may have to update your code. + The changes are enumerated here. There are also some new + interfaces; for those, please refer to the header files. + + + + + QPDF's exception handling mechanism now uses + std::logic_error for internal errors and + std::runtime_error for runtime errors in + favor of the now removed QEXC classes used + in previous versions. The QEXC exception + classes predated the addition of the + <stdexcept> header file to the C++ + standard library. Most of the exceptions thrown by the qpdf + library itself are still of type QPDFExc + which is now derived from + std::runtime_error. Programs that caught + an instance of std::exception and + displayed it by calling the what() method + will not need to be changed. + + + + + The QPDFExc class now internally + represents various fields of the error condition and provides + interfaces for querying them. Among the fields is a numeric + error code that can help applications act differently on (a small + number of) different error conditions. See + QPDFExc.hh for details. + + + + + Warnings can be retrieved from qpdf as instances of + QPDFExc instead of strings. + + + + + The nested QPDF::EncryptionData class's + constructor takes an additional argument. This class is + primarily intended to be used by + QPDFWriter. There's not really anything + useful an end-user application could do with it. It probably + shouldn't really be part of the public interface to begin with. + Likewise, some of the methods for computing internal encryption + dictionary parameters have changed to support + /R=4 encryption. + + + + + The method QPDF::getUserPassword has been + removed since it didn't do what people would think it did. There + are now two new methods: + QPDF::getPaddedUserPassword and + QPDF::getTrimmedUserPassword. The first one + does what the old QPDF::getUserPassword + method used to do, which is to return the password with possible + binary padding as specified by the PDF specification. The second + one returns a human-readable password string. + + + + + The enumerated types that used to be nested in + QPDFWriter have moved to top-level + enumerated types and are now defined in the file + qpdf/Constants.h. This enables them to be + shared by both the C and C++ interfaces. + + + + + + Upgrading to 3.0 + + For the most part, the API for qpdf version 3.0 is backward + compatible with versions 2.1 and later. There are two exceptions: + + + + The method + QPDFObjectHandle::replaceStreamData that + uses a StreamDataProvider to provide the + stream data no longer takes a length + parameter. While it would have been easy enough to keep the + parameter for backward compatibility, in this case, the + parameter was removed since this provides the user an + opportunity to simplify the calling code. This method was + introduced in version 2.2. At the time, the + length parameter was required in order to + ensure that calls to the stream data provider returned the same + length for a specific stream every time they were invoked. In + particular, the linearization code depends on this. Instead, + qpdf 3.0 and newer check for that constraint explicitly. The + first time the stream data provider is called for a specific + stream, the actual length is saved, and subsequent calls are + required to return the same number of bytes. This means the + calling code no longer has to compute the length in advance, + which can be a significant simplification. If your code fails + to compile because of the extra argument and you don't want to + make other changes to your code, just omit the argument. + + + + + Many methods take long long instead of other + integer types. Most if not all existing code should compile + fine with this change since such parameters had always + previously been smaller types. This change was required to + support files larger than two gigabytes in size. + + + + + + diff --git a/manual/qpdf.1.in b/manual/qpdf.1.in new file mode 100644 index 0000000..3ecec56 --- /dev/null +++ b/manual/qpdf.1.in @@ -0,0 +1,19 @@ +\" This file is not processed by autoconf, but rather by build.mk in +\" the manual directory. +.TH QPDF "1" "April 2008" "qpdf version @PACKAGE_VERSION@" "User Commands" +.SH NAME +qpdf \- PDF transformation software +.SH SYNOPSIS +.B qpdf +[ \fIoptions \fR] \fIinfilename [ outfilename ]\fR +.SH DESCRIPTION +The qpdf program is used to convert one PDF file to another equivalent +PDF file. It is capable of performing a variety of transformations +such as linearization (also known as web optimization or fast web +viewing), encryption, and decryption of PDF files. It also has many +options for inspecting or checking PDF files, some of which are +useful primarily to PDF developers. +.PP +For a summary of qpdf's options, please run +\fBqpdf --help\fR. A complete manual can be found in +@docdir@/qpdf-manual.html or @docdir@/qpdf-manual.pdf. diff --git a/manual/zlib-flate.1.in b/manual/zlib-flate.1.in new file mode 100644 index 0000000..e74eb3f --- /dev/null +++ b/manual/zlib-flate.1.in @@ -0,0 +1,26 @@ +\" This file is not processed by autoconf, but rather by build.mk in +\" the manual directory. +.TH ZLIB-FLATE "1" "April 2008" "zlib-flate from qpdf version @PACKAGE_VERSION@" "User Commands" +.SH NAME +zlib-flate \- raw zlib compression program +.SH SYNOPSIS +.B zlib-flate +\fI-compress | -uncompress\fR +.SH DESCRIPTION +The zlib-flate program is part of the qpdf package. +.PP +The zlib-flate program reads from standard input and writes to +standard output either compressing or uncompressing its input using raw +zlib compression. It can be used to uncompress or compress raw PDF +streams or other data that is compressed with raw zlib compression. +This program is provided primarily as a debugging tool, though it +could be used for other purposes, such as being called from a script +that creates simple PDF files. +.PP +This program should not be used as a general purpose compression +tool. Use something like gzip(1) instead. +.PP +For details about qpdf, please see the qpdf manual, which can be found +in @docdir@/qpdf-manual.html or @docdir@/qpdf-manual.pdf. +.SH "SEE ALSO" +qpdf(1), gzip(1) diff --git a/mkinstalldirs b/mkinstalldirs new file mode 100755 index 0000000..4191a45 --- /dev/null +++ b/mkinstalldirs @@ -0,0 +1,162 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy + +scriptversion=2009-04-28.21; # UTC + +# Original author: Noah Friedman +# Created: 1993-05-16 +# Public domain. +# +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' +IFS=" "" $nl" +errstatus=0 +dirmode= + +usage="\ +Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... + +Create each directory DIR (with mode MODE, if specified), including all +leading file name components. + +Report bugs to ." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" + exit $? + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --version) + echo "$0 $scriptversion" + exit $? + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done + +for file +do + if test -d "$file"; then + shift + else + break + fi +done + +case $# in + 0) exit 0 ;; +esac + +# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and +# mkdir -p a/c at the same time, both will detect that a is missing, +# one will create a, then the other will try to create a and die with +# a "File exists" error. This is a problem when calling mkinstalldirs +# from a parallel make. We use --version in the probe to restrict +# ourselves to GNU mkdir, which is thread-safe. +case $dirmode in + '') + if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + test -d ./-p && rmdir ./-p + test -d ./--version && rmdir ./--version + fi + ;; + *) + if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && + test ! -d ./--version; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + else + # Clean up after NextStep and OpenStep mkdir. + for d in ./-m ./-p ./--version "./$dirmode"; + do + test -d $d && rmdir $d + done + fi + ;; +esac + +for file +do + case $file in + /*) pathcomp=/ ;; + *) pathcomp= ;; + esac + oIFS=$IFS + IFS=/ + set fnord $file + shift + IFS=$oIFS + + for d + do + test "x$d" = x && continue + + pathcomp=$pathcomp$d + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr= + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp=$pathcomp/ + done +done + +exit $errstatus + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/packaging/qpdf.spec b/packaging/qpdf.spec new file mode 100644 index 0000000..a9c20c3 --- /dev/null +++ b/packaging/qpdf.spec @@ -0,0 +1,105 @@ +%define _unpackaged_files_terminate_build 0 + +Summary: Command-line tools and library for transforming PDF files +Name: qpdf +Version: 3.0.2 +Release: 2 +License: Artistic +Group: System Environment/Libraries +URL: http://qpdf.sourceforge.net/ +Source: %{name}-%{version}.tar.gz +Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root +BuildRequires: zlib-devel +BuildRequires: libpcre-devel +#BuildRequires: pcre + +%description +QPDF is a program that does structural, content-preserving +transformations on PDF files. It could have been called something +like pdf-to-pdf. It also provides many useful capabilities to +developers of PDF-producing software or for people who just want to +look at the innards of a PDF file to learn more about how they work. + +QPDF offers many capabilities such as linearization (web +optimization), encrypt, and decription of PDF files. Note that QPDF +does not have the capability to create PDF files from scratch; it is +only used to create PDF files with special characteristics starting +from other PDF files or to inspect or extract information from +existing PDF files. + +%package devel +Summary: Development files for qpdf PDF manipulation library +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} zlib-devel libpcre-devel + +%description devel +The qpdf-devel package contains header files and libraries necessary +for developing programs using the qpdf library. + +%package static +Summary: Static QPDF library +Group: Development/Libraries +Requires: %{name}-devel = %{version}-%{release} + +%description static +The qpdf-static package contains the static qpdf library. + +%prep +%setup -q + +%build +./autogen.sh +%configure --without-docdir +# --docdir='${datarootdir}'/doc/%{name}-%{version} + +make %{?_smp_mflags} +make check + +%install +rm -rf $RPM_BUILD_ROOT +%makeinstall +# %doc below clobbers our docdir, so we have to copy it to a safe +# place so we can install it using %doc. We should still set docdir +# properly when configuring so that it gets substituted properly by +# autoconf. +#cp -a $RPM_BUILD_ROOT%{_datadir}/doc/%{name}-%{version} install-docs +#mkdir -p install-examples/examples +#cp -p examples/*.cc examples/*.c install-examples/examples +# Red Hat doesn't ship .la files. +#rm -f $RPM_BUILD_ROOT%{_libdir}/libqpdf.la + +mkdir -p %{buildroot}/usr/share/license +cp %{_builddir}/%{buildsubdir}/Artistic-2.0 %{buildroot}/usr/share/license/%{name} + +%post +/sbin/ldconfig + +%postun +/sbin/ldconfig + +%files +%manifest qpdf.manifest +%defattr(-,root,root) +#README TODO Artistic-2.0 install-docs/* +/usr/share/license/%{name} +%exclude %{_bindir}/* +%{_libdir}/libqpdf*.so.* +%exclude %{_mandir}/man1/* + +%files devel +%defattr(-,root,root) +#install-examples/examples +%{_includedir}/* +%{_libdir}/libqpdf*.so +%{_libdir}/pkgconfig + +%files static +%defattr(-,root,root) +%{_libdir}/libqpdf*.a + +%clean +rm -rf $RPM_BUILD_ROOT + +%changelog +* Mon Apr 28 2008 Jay Berkenbilt - 2.0-1 +- Initial packaging diff --git a/qpdf.manifest b/qpdf.manifest new file mode 100644 index 0000000..81ace0c --- /dev/null +++ b/qpdf.manifest @@ -0,0 +1,6 @@ + + + + + + diff --git a/qpdf.spec b/qpdf.spec new file mode 100644 index 0000000..3f32939 --- /dev/null +++ b/qpdf.spec @@ -0,0 +1,94 @@ +Summary: Command-line tools and library for transforming PDF files +Name: qpdf +Version: 3.0.2 +Release: 1%{?dist} +License: Artistic +Group: System Environment/Libraries +URL: http://qpdf.sourceforge.net/ + +Source: %{name}-%{version}.tar.gz + +Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root +BuildRequires: zlib-devel +BuildRequires: pcre-devel + +%description +QPDF is a program that does structural, content-preserving +transformations on PDF files. It could have been called something +like pdf-to-pdf. It also provides many useful capabilities to +developers of PDF-producing software or for people who just want to +look at the innards of a PDF file to learn more about how they work. + +QPDF offers many capabilities such as linearization (web +optimization), encrypt, and decription of PDF files. Note that QPDF +does not have the capability to create PDF files from scratch; it is +only used to create PDF files with special characteristics starting +from other PDF files or to inspect or extract information from +existing PDF files. + +%package devel +Summary: Development files for qpdf PDF manipulation library +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} zlib-devel pcre-devel + +%description devel +The qpdf-devel package contains header files and libraries necessary +for developing programs using the qpdf library. + +%package static +Summary: Static QPDF library +Group: Development/Libraries +Requires: %{name}-devel = %{version}-%{release} + +%description static +The qpdf-static package contains the static qpdf library. + +%prep +%setup -q + +%build +%configure --disable-test-compare-images --docdir='${datarootdir}'/doc/%{name}-%{version} +make %{?_smp_mflags} +make check + +%install +rm -rf $RPM_BUILD_ROOT +%makeinstall +# %doc below clobbers our docdir, so we have to copy it to a safe +# place so we can install it using %doc. We should still set docdir +# properly when configuring so that it gets substituted properly by +# autoconf. +cp -a $RPM_BUILD_ROOT%{_datadir}/doc/%{name}-%{version} install-docs +mkdir -p install-examples/examples +cp -p examples/*.cc examples/*.c install-examples/examples +# Red Hat doesn't ship .la files. +rm -f $RPM_BUILD_ROOT%{_libdir}/libqpdf.la + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%doc README TODO Artistic-2.0 install-docs/* +%{_bindir}/* +%{_libdir}/libqpdf*.so.* +%{_mandir}/man1/* + +%files devel +%defattr(-,root,root) +%doc install-examples/examples +%{_includedir}/* +%{_libdir}/libqpdf*.so +%{_libdir}/pkgconfig + +%files static +%defattr(-,root,root) +%{_libdir}/libqpdf*.a + +%clean +rm -rf $RPM_BUILD_ROOT + +%changelog +* Mon Apr 28 2008 Jay Berkenbilt - 2.0-1 +- Initial packaging diff --git a/qpdf/Makefile b/qpdf/Makefile new file mode 100644 index 0000000..9089905 --- /dev/null +++ b/qpdf/Makefile @@ -0,0 +1 @@ +include ../make/proxy.mk diff --git a/qpdf/build.mk b/qpdf/build.mk new file mode 100644 index 0000000..e3d5097 --- /dev/null +++ b/qpdf/build.mk @@ -0,0 +1,33 @@ +BINS_qpdf = qpdf test_driver pdf_from_scratch test_large_file +CBINS_qpdf = qpdf-ctest + +TARGETS_qpdf = $(foreach B,$(BINS_qpdf) $(CBINS_qpdf),qpdf/$(OUTPUT_DIR)/$(call binname,$(B))) + +$(TARGETS_qpdf): $(TARGETS_libqpdf) + +INCLUDES_qpdf = include + +TC_SRCS_qpdf = $(wildcard libqpdf/*.cc) $(wildcard qpdf/*.cc) + +# ----- + +$(foreach B,$(BINS_qpdf),$(eval \ + OBJS_$(B) = $(call src_to_obj,qpdf/$(B).cc))) +$(foreach B,$(CBINS_qpdf),$(eval \ + OBJS_$(B) = $(call c_src_to_obj,qpdf/$(B).c))) + +ifeq ($(GENDEPS),1) +-include $(foreach B,$(BINS_qpdf) $(CBINS_qpdf),$(call obj_to_dep,$(OBJS_$(B)))) +endif + +$(foreach B,$(BINS_qpdf),$(eval \ + $(OBJS_$(B)): qpdf/$(OUTPUT_DIR)/%.$(OBJ): qpdf/$(B).cc ; \ + $(call compile,qpdf/$(B).cc,$(INCLUDES_qpdf)))) + +$(foreach B,$(CBINS_qpdf),$(eval \ + $(OBJS_$(B)): qpdf/$(OUTPUT_DIR)/%.$(OBJ): qpdf/$(B).c ; \ + $(call c_compile,qpdf/$(B).c,$(INCLUDES_qpdf)))) + +$(foreach B,$(BINS_qpdf) $(CBINS_qpdf),$(eval \ + qpdf/$(OUTPUT_DIR)/$(call binname,$(B)): $(OBJS_$(B)) ; \ + $(call makebin,$(OBJS_$(B)),$$@,$(LDFLAGS) $(LDFLAGS_libqpdf),$(LIBS_libqpdf) $(LIBS)))) diff --git a/qpdf/fix-qdf b/qpdf/fix-qdf new file mode 100755 index 0000000..b0e56e1 --- /dev/null +++ b/qpdf/fix-qdf @@ -0,0 +1,373 @@ +#!/usr/bin/env perl + +require 5.008_001; +use warnings; +use strict; +use File::Basename; + +my $whoami = basename($0); +my $dirname = dirname($0); + +if ((@ARGV == 1) && ($ARGV[0] eq '--version')) +{ + exec "$dirname/qpdf", '--version'; + exit 2; +} + +my $offset = 0; +my $last_offset = 0; + +my $file = shift(@ARGV); +if (defined $file) +{ + open(F, "<$file") or die "$whoami: can't open $file: $!\n"; +} +else +{ + $file = 'stdin'; + open(F, "<&STDIN") or die "$whoami: can't dup stdin: $!\n"; +} +binmode F; +binmode STDOUT; + +my $line = get_line(); +if (! ((defined $line) && ($line =~ m/^%PDF-1\.\d+\b/))) +{ + die "$whoami: $file: not a pdf file\n"; +} +print $line; +$line = get_line(); +die "$whoami: $file: premature EOF\n" unless defined $line; +print $line; +$line = get_line(); +if (! ((defined $line) && ($line =~ m/^%QDF-1.\d+\b/))) +{ + die "$whoami: $file: not a qdf file\n"; +} +print $line; + +my $last_obj = 0; +my @xref = (); + +my $stream_start = 0; +my $stream_length = 0; +my $xref_offset = 0; +my $xref_f1_nbytes = 0; +my $xref_size = 0; + +my $cur_state = 0; +my $st_top = ++$cur_state; +my $st_in_obj = ++$cur_state; +my $st_in_stream = ++$cur_state; +my $st_after_stream = ++$cur_state; +my $st_in_ostream_dict = ++$cur_state; +my $st_in_ostream_offsets = ++$cur_state; +my $st_in_ostream_outer = ++$cur_state; +my $st_in_ostream_obj = ++$cur_state; +my $st_in_xref_stream_dict = ++$cur_state; +my $st_in_length = ++$cur_state; +my $st_at_xref = ++$cur_state; +my $st_before_trailer = ++$cur_state; +my $st_in_trailer = ++$cur_state; +my $st_done = ++$cur_state; + +my @ostream = (); +my @ostream_offsets = (); +my @ostream_discarded = (); +my $ostream_idx = 0; +my $ostream_id = 0; +my $ostream_extends = ""; + +my $state = $st_top; +while (defined($line = get_line())) +{ + if ($state == $st_top) + { + if ($line =~ m/^(\d+) 0 obj$/) + { + check_obj_id($1); + $state = $st_in_obj; + } + elsif ($line =~ m/^xref$/) + { + $xref_offset = $last_offset; + $state = $st_at_xref; + } + print $line; + } + elsif ($state == $st_in_obj) + { + print $line; + if ($line =~ m/^stream$/) + { + $state = $st_in_stream; + $stream_start = $offset; + } + elsif ($line =~ m/^endobj$/) + { + $state = $st_top; + } + elsif ($line =~ m,/Type /ObjStm,) + { + $state = $st_in_ostream_dict; + $ostream_id = $last_obj; + } + elsif ($line =~ m,/Type /XRef,) + { + $xref_offset = $xref[-1][1]; + $xref_f1_nbytes = 0; + my $t = $xref_offset; + while ($t) + { + $t >>= 8; + ++$xref_f1_nbytes; + } + my $esize = $xref_f1_nbytes + 2; + $xref_size = 1 + @xref; + my $length = $xref_size * $esize; + print " /Length $length\n"; + print " /W [ 1 $xref_f1_nbytes 1 ]\n"; + $state = $st_in_xref_stream_dict; + } + } + elsif ($state == $st_in_ostream_dict) + { + if ($line =~ m/^stream/) + { + $state = $st_in_ostream_offsets; + } + else + { + push(@ostream_discarded, $line); + if ($line =~ m,/Extends (\d+ 0 R),) + { + $ostream_extends = $1; + } + } + # discard line + } + elsif ($state == $st_in_ostream_offsets) + { + if ($line =~ m/^\%\% Object stream: object (\d+)/) + { + check_obj_id($1); + $stream_start = $last_offset; + $state = $st_in_ostream_outer; + push(@ostream, $line); + } + else + { + push(@ostream_discarded, $line); + } + # discard line + } + elsif ($state == $st_in_ostream_outer) + { + adjust_ostream_xref(); + push(@ostream_offsets, $last_offset - $stream_start); + $state = $st_in_ostream_obj; + push(@ostream, $line); + } + elsif ($state == $st_in_ostream_obj) + { + push(@ostream, $line); + if ($line =~ m/^\%\% Object stream: object (\d+)/) + { + check_obj_id($1); + $state = $st_in_ostream_outer; + } + elsif ($line =~ m/^endstream/) + { + $stream_length = $last_offset - $stream_start; + write_ostream(); + $state = $st_in_obj; + } + } + elsif ($state == $st_in_xref_stream_dict) + { + if ($line =~ m,/(Length|W) ,) + { + # already printed + } + elsif ($line =~ m,/Size ,) + { + my $size = 1 + @xref; + print " /Size $xref_size\n"; + } + else + { + print $line; + } + if ($line =~ m/^stream\n/) + { + my $pack = "(C C$xref_f1_nbytes C)"; + print pack($pack, 0, 0, 0); + foreach my $x (@xref) + { + my ($type, $f1, $f2) = @$x; + $f2 = 0 unless defined $f2; + my @f1 = (); + for (my $i = 0; $i < $xref_f1_nbytes; ++$i) + { + unshift(@f1, $f1 & 0xff); + $f1 >>= 8; + } + print pack($pack, $type, @f1, $f2); + } + print "\nendstream\nendobj\n\n"; + print "startxref\n$xref_offset\n\%\%EOF\n"; + $state = $st_done; + } + } + elsif ($state == $st_in_stream) + { + if ($line =~ m/^endstream$/) + { + $stream_length = $last_offset - $stream_start; + $state = $st_after_stream; + } + print $line; + } + elsif ($state == $st_after_stream) + { + if ($line =~ m/^\%QDF: ignore_newline$/) + { + --$stream_length; + } + elsif ($line =~ m/^(\d+) 0 obj$/) + { + check_obj_id($1); + $state = $st_in_length; + } + print $line; + } + elsif ($state == $st_in_length) + { + if ($line !~ m/^\d+$/) + { + die "$file:$.: expected integer\n"; + } + my $new = "$stream_length\n"; + $offset -= length($line); + $offset += length($new); + print $new; + $state = $st_top; + } + elsif ($state == $st_at_xref) + { + my $n = scalar(@xref); + print "0 ", $n+1, "\n0000000000 65535 f \n"; + for (@xref) + { + my ($type, $f1, $f2) = @$_; + printf("%010d 00000 n \n", $f1); + } + $state = $st_before_trailer; + } + elsif ($state == $st_before_trailer) + { + if ($line =~ m/^trailer <>$/) + { + print "startxref\n$xref_offset\n\%\%EOF\n"; + $state = $st_done; + } + } + elsif ($state == $st_done) + { + # ignore + } +} + +die "$whoami: $file: premature EOF\n" unless $state == $st_done; + +sub get_line +{ + my $line = scalar(); + if (defined $line) + { + $last_offset = $offset; + $offset += length($line); + } + $line; +} + +sub check_obj_id +{ + my $cur_obj = shift; + if ($cur_obj != $last_obj + 1) + { + die "$file:$.: expected object ", $last_obj + 1, "\n"; + } + $last_obj = $cur_obj; + push(@xref, [1, $last_offset]); +} + +sub adjust_ostream_xref +{ + pop(@xref); + push(@xref, [2, $ostream_id, $ostream_idx++]); +} + +sub write_ostream +{ + my $first = $ostream_offsets[0]; + my $onum = $ostream_id; + my $offsets = ""; + my $n = scalar(@ostream_offsets); + for (@ostream_offsets) + { + $_ -= $first; + ++$onum; + $offsets .= "$onum $_\n"; + } + my $offset_adjust = length($offsets); + $first += length($offsets); + $stream_length += length($offsets); + my $dict_data = ""; + $dict_data .= " /Length $stream_length\n"; + $dict_data .= " /N $n\n"; + $dict_data .= " /First $first\n"; + if ($ostream_extends) + { + $dict_data .= " /Extends $ostream_extends\n"; + } + $dict_data .= ">>\n"; + $offset_adjust += length($dict_data); + print $dict_data; + print "stream\n"; + print $offsets; + foreach (@ostream) + { + print $_; + } + + for (@ostream_discarded) + { + $offset -= length($_); + } + $offset += $offset_adjust; + + $ostream_idx = 0; + $ostream_id = 0; + @ostream = (); + @ostream_offsets = (); + @ostream_discarded = (); + $ostream_extends = ""; +} diff --git a/qpdf/pdf_from_scratch.cc b/qpdf/pdf_from_scratch.cc new file mode 100644 index 0000000..10ef551 --- /dev/null +++ b/qpdf/pdf_from_scratch.cc @@ -0,0 +1,120 @@ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static char const* whoami = 0; + +void usage() +{ + std::cerr << "Usage: " << whoami << " n" << std::endl; + exit(2); +} + +static QPDFObjectHandle createPageContents(QPDF& pdf, std::string const& text) +{ + std::string contents = "BT /F1 15 Tf 72 720 Td (" + text + ") Tj ET\n"; + return QPDFObjectHandle::newStream(&pdf, contents); +} + +QPDFObjectHandle newName(std::string const& name) +{ + return QPDFObjectHandle::newName(name); +} + +void runtest(int n) +{ + QPDF pdf; + pdf.emptyPDF(); + if (n == 0) + { + // Create a minimal PDF from scratch. + + QPDFObjectHandle font = pdf.makeIndirectObject( + QPDFObjectHandle::parse("<<" + " /Type /Font" + " /Subtype /Type1" + " /Name /F1" + " /BaseFont /Helvetica" + " /Encoding /WinAnsiEncoding" + ">>")); + + QPDFObjectHandle procset = pdf.makeIndirectObject( + QPDFObjectHandle::parse("[/PDF /Text]")); + + QPDFObjectHandle contents = createPageContents(pdf, "First Page"); + + QPDFObjectHandle mediabox = QPDFObjectHandle::parse("[0 0 612 792]"); + + QPDFObjectHandle rfont = QPDFObjectHandle::newDictionary(); + rfont.replaceKey("/F1", font); + + QPDFObjectHandle resources = QPDFObjectHandle::newDictionary(); + resources.replaceKey("/ProcSet", procset); + resources.replaceKey("/Font", rfont); + + QPDFObjectHandle page = pdf.makeIndirectObject( + QPDFObjectHandle::newDictionary()); + page.replaceKey("/Type", newName("/Page")); + page.replaceKey("/MediaBox", mediabox); + page.replaceKey("/Contents", contents); + page.replaceKey("/Resources", resources); + + pdf.addPage(page, true); + + QPDFWriter w(pdf, "a.pdf"); + w.setStaticID(true); + w.setStreamDataMode(qpdf_s_preserve); + w.write(); + } + else + { + throw std::runtime_error(std::string("invalid test ") + + QUtil::int_to_string(n)); + } + + std::cout << "test " << n << " done" << std::endl; +} + +int main(int argc, char* argv[]) +{ + QUtil::setLineBuf(stdout); + if ((whoami = strrchr(argv[0], '/')) == NULL) + { + whoami = argv[0]; + } + else + { + ++whoami; + } + // For libtool's sake.... + if (strncmp(whoami, "lt-", 3) == 0) + { + whoami += 3; + } + + if (argc != 2) + { + usage(); + } + + try + { + int n = atoi(argv[1]); + runtest(n); + } + catch (std::exception& e) + { + std::cerr << e.what() << std::endl; + exit(2); + } + + return 0; +} diff --git a/qpdf/qpdf-ctest.c b/qpdf/qpdf-ctest.c new file mode 100644 index 0000000..072e5a7 --- /dev/null +++ b/qpdf/qpdf-ctest.c @@ -0,0 +1,447 @@ +#include +#include +#include +#include +#include +#include + +static char* whoami = 0; +static qpdf_data qpdf = 0; + +static void report_errors() +{ + qpdf_error e = 0; + while (qpdf_more_warnings(qpdf)) + { + e = qpdf_next_warning(qpdf); + printf("warning: %s\n", qpdf_get_error_full_text(qpdf, e)); + printf(" code: %d\n", qpdf_get_error_code(qpdf, e)); + printf(" file: %s\n", qpdf_get_error_filename(qpdf, e)); + /* If your compiler doesn't support %lld, change to %ld and + * lose precision in the error message. + */ + printf(" pos : %lld\n", qpdf_get_error_file_position(qpdf, e)); + printf(" text: %s\n", qpdf_get_error_message_detail(qpdf, e)); + } + if (qpdf_has_error(qpdf)) + { + e = qpdf_get_error(qpdf); + assert(qpdf_has_error(qpdf) == QPDF_FALSE); + printf("error: %s\n", qpdf_get_error_full_text(qpdf, e)); + printf(" code: %d\n", qpdf_get_error_code(qpdf, e)); + printf(" file: %s\n", qpdf_get_error_filename(qpdf, e)); + /* see above comment about %lld */ + printf(" pos : %lld\n", qpdf_get_error_file_position(qpdf, e)); + printf(" text: %s\n", qpdf_get_error_message_detail(qpdf, e)); + } + else + { + e = qpdf_get_error(qpdf); + assert(e == 0); + assert(qpdf_get_error_code(qpdf, e) == qpdf_e_success); + // Call these to ensure that they can be called on a null + // error pointer. + (void)qpdf_get_error_full_text(qpdf, e); + (void)qpdf_get_error_filename(qpdf, e); + (void)qpdf_get_error_file_position(qpdf, e); + (void)qpdf_get_error_message_detail(qpdf, e); + } +} + +static void read_file_into_memory(char const* filename, + char** buf, unsigned long* size) +{ + char* buf_p = 0; + FILE* f = NULL; + size_t bytes_read = 0; + size_t len = 0; + + f = fopen(filename, "rb"); + if (f == NULL) + { + fprintf(stderr, "%s: unable to open %s: %s\n", + whoami, filename, strerror(errno)); + exit(2); + } + fseek(f, 0, SEEK_END); + *size = (unsigned long) ftell(f); + fseek(f, 0, SEEK_SET); + *buf = malloc(*size); + if (*buf == NULL) + { + fprintf(stderr, "%s: unable to allocate %lu bytes\n", + whoami, *size); + exit(2); + } + buf_p = *buf; + bytes_read = 0; + len = 0; + while ((len = fread(buf_p + bytes_read, 1, *size - bytes_read, f)) > 0) + { + bytes_read += len; + } + if (bytes_read != *size) + { + if (ferror(f)) + { + fprintf(stderr, "%s: failure reading file %s into memory:", + whoami, filename); + } + else + { + fprintf(stderr, "%s: premature EOF reading file %s:", + whoami, filename); + } + fprintf(stderr, " read %lu, wanted %lu\n", + (unsigned long) bytes_read, (unsigned long) size); + exit(2); + } + fclose(f); +} + +static void test01(char const* infile, + char const* password, + char const* outfile, + char const* outfile2) +{ + qpdf_read(qpdf, infile, password); + printf("version: %s\n", qpdf_get_pdf_version(qpdf)); + printf("linearized: %d\n", qpdf_is_linearized(qpdf)); + printf("encrypted: %d\n", qpdf_is_encrypted(qpdf)); + if (qpdf_is_encrypted(qpdf)) + { + printf("user password: %s\n", qpdf_get_user_password(qpdf)); + printf("extract for accessibility: %d\n", + qpdf_allow_accessibility(qpdf)); + printf("extract for any purpose: %d\n", + qpdf_allow_extract_all(qpdf)); + printf("print low resolution: %d\n", + qpdf_allow_print_low_res(qpdf)); + printf("print high resolution: %d\n", + qpdf_allow_print_high_res(qpdf)); + printf("modify document assembly: %d\n", + qpdf_allow_modify_assembly(qpdf)); + printf("modify forms: %d\n", + qpdf_allow_modify_form(qpdf)); + printf("modify annotations: %d\n", + qpdf_allow_modify_annotation(qpdf)); + printf("modify other: %d\n", + qpdf_allow_modify_other(qpdf)); + printf("modify anything: %d\n", + qpdf_allow_modify_all(qpdf)); + } + report_errors(); +} + +static void test02(char const* infile, + char const* password, + char const* outfile, + char const* outfile2) +{ + qpdf_set_suppress_warnings(qpdf, QPDF_TRUE); + if (((qpdf_read(qpdf, infile, password) & QPDF_ERRORS) == 0) && + ((qpdf_init_write(qpdf, outfile) & QPDF_ERRORS) == 0)) + { + qpdf_set_static_ID(qpdf, QPDF_TRUE); + qpdf_write(qpdf); + } + report_errors(); +} + +static void test03(char const* infile, + char const* password, + char const* outfile, + char const* outfile2) +{ + qpdf_read(qpdf, infile, password); + qpdf_init_write(qpdf, outfile); + qpdf_set_static_ID(qpdf, QPDF_TRUE); + qpdf_set_content_normalization(qpdf, QPDF_TRUE); + qpdf_write(qpdf); + report_errors(); +} + +static void test04(char const* infile, + char const* password, + char const* outfile, + char const* outfile2) +{ + qpdf_set_ignore_xref_streams(qpdf, QPDF_TRUE); + qpdf_read(qpdf, infile, password); + qpdf_init_write(qpdf, outfile); + qpdf_set_static_ID(qpdf, QPDF_TRUE); + qpdf_write(qpdf); + report_errors(); +} + +static void test05(char const* infile, + char const* password, + char const* outfile, + char const* outfile2) +{ + qpdf_read(qpdf, infile, password); + qpdf_init_write(qpdf, outfile); + qpdf_set_static_ID(qpdf, QPDF_TRUE); + qpdf_set_linearization(qpdf, QPDF_TRUE); + qpdf_write(qpdf); + report_errors(); +} + +static void test06(char const* infile, + char const* password, + char const* outfile, + char const* outfile2) +{ + char* buf = NULL; + unsigned long size = 0; + read_file_into_memory(infile, &buf, &size); + qpdf_read_memory(qpdf, infile, buf, size, password); + qpdf_init_write(qpdf, outfile); + qpdf_set_static_ID(qpdf, QPDF_TRUE); + qpdf_set_object_stream_mode(qpdf, qpdf_o_generate); + qpdf_write(qpdf); + report_errors(); +} + +static void test07(char const* infile, + char const* password, + char const* outfile, + char const* outfile2) +{ + qpdf_read(qpdf, infile, password); + qpdf_init_write(qpdf, outfile); + qpdf_set_static_ID(qpdf, QPDF_TRUE); + qpdf_set_qdf_mode(qpdf, QPDF_TRUE); + qpdf_write(qpdf); + report_errors(); +} + +static void test08(char const* infile, + char const* password, + char const* outfile, + char const* outfile2) +{ + qpdf_read(qpdf, infile, password); + qpdf_init_write(qpdf, outfile); + qpdf_set_static_ID(qpdf, QPDF_TRUE); + qpdf_set_qdf_mode(qpdf, QPDF_TRUE); + qpdf_set_suppress_original_object_IDs(qpdf, QPDF_TRUE); + qpdf_write(qpdf); + report_errors(); +} + +static void test09(char const* infile, + char const* password, + char const* outfile, + char const* outfile2) +{ + qpdf_read(qpdf, infile, password); + qpdf_init_write(qpdf, outfile); + qpdf_set_static_ID(qpdf, QPDF_TRUE); + qpdf_set_stream_data_mode(qpdf, qpdf_s_uncompress); + qpdf_write(qpdf); + report_errors(); +} + +static void test10(char const* infile, + char const* password, + char const* outfile, + char const* outfile2) +{ + qpdf_set_attempt_recovery(qpdf, QPDF_FALSE); + qpdf_read(qpdf, infile, password); + report_errors(); +} + +static void test11(char const* infile, + char const* password, + char const* outfile, + char const* outfile2) +{ + qpdf_read(qpdf, infile, password); + qpdf_init_write(qpdf, outfile); + qpdf_set_static_ID(qpdf, QPDF_TRUE); + qpdf_set_r2_encryption_parameters( + qpdf, "user1", "owner1", QPDF_FALSE, QPDF_TRUE, QPDF_TRUE, QPDF_TRUE); + qpdf_write(qpdf); + report_errors(); +} + +static void test12(char const* infile, + char const* password, + char const* outfile, + char const* outfile2) +{ + qpdf_read(qpdf, infile, password); + qpdf_init_write(qpdf, outfile); + qpdf_set_static_ID(qpdf, QPDF_TRUE); + qpdf_set_r3_encryption_parameters( + qpdf, "user2", "owner2", QPDF_TRUE, QPDF_TRUE, + qpdf_r3p_low, qpdf_r3m_all); + qpdf_write(qpdf); + report_errors(); +} + +static void test13(char const* infile, + char const* password, + char const* outfile, + char const* outfile2) +{ + qpdf_read(qpdf, infile, password); + printf("user password: %s\n", qpdf_get_user_password(qpdf)); + qpdf_init_write(qpdf, outfile); + qpdf_set_static_ID(qpdf, QPDF_TRUE); + qpdf_set_preserve_encryption(qpdf, QPDF_FALSE); + qpdf_write(qpdf); + report_errors(); +} + +static void test14(char const* infile, + char const* password, + char const* outfile, + char const* outfile2) +{ + qpdf_read(qpdf, infile, password); + qpdf_init_write(qpdf, outfile); + qpdf_set_static_ID(qpdf, QPDF_TRUE); + qpdf_set_minimum_pdf_version(qpdf, "1.6"); + qpdf_write(qpdf); + qpdf_init_write(qpdf, outfile2); + qpdf_set_static_ID(qpdf, QPDF_TRUE); + qpdf_force_pdf_version(qpdf, "1.4"); + qpdf_write(qpdf); + report_errors(); +} + +static void test15(char const* infile, + char const* password, + char const* outfile, + char const* outfile2) +{ + qpdf_read(qpdf, infile, password); + qpdf_init_write(qpdf, outfile); + qpdf_set_static_ID(qpdf, QPDF_TRUE); + qpdf_set_static_aes_IV(qpdf, QPDF_TRUE); + qpdf_set_r4_encryption_parameters( + qpdf, "user2", "owner2", QPDF_TRUE, QPDF_TRUE, + qpdf_r3p_low, qpdf_r3m_all, QPDF_TRUE, QPDF_TRUE); + qpdf_write(qpdf); + report_errors(); +} + +static void print_info(char const* key) +{ + char const* value = qpdf_get_info_key(qpdf, key); + printf("Info key %s: %s\n", + key, (value ? value : "(null)")); +} + +static void test16(char const* infile, + char const* password, + char const* outfile, + char const* outfile2) +{ + unsigned long buflen = 0L; + unsigned char const* buf = 0; + FILE* f = 0; + + qpdf_read(qpdf, infile, password); + print_info("/Author"); + print_info("/Producer"); + print_info("/Creator"); + qpdf_set_info_key(qpdf, "/Author", "Mr. Potato Head"); + qpdf_set_info_key(qpdf, "/Producer", "QPDF library"); + qpdf_set_info_key(qpdf, "/Creator", 0); + print_info("/Author"); + print_info("/Producer"); + print_info("/Creator"); + qpdf_init_write_memory(qpdf); + qpdf_set_static_ID(qpdf, QPDF_TRUE); + qpdf_set_static_aes_IV(qpdf, QPDF_TRUE); + qpdf_set_stream_data_mode(qpdf, qpdf_s_uncompress); + qpdf_write(qpdf); + f = fopen(outfile, "wb"); + if (f == NULL) + { + fprintf(stderr, "%s: unable to open %s: %s\n", + whoami, outfile, strerror(errno)); + exit(2); + } + buflen = qpdf_get_buffer_length(qpdf); + buf = qpdf_get_buffer(qpdf); + fwrite(buf, 1, buflen, f); + fclose(f); + report_errors(); +} + +int main(int argc, char* argv[]) +{ + char* p = 0; + int n = 0; + char const* infile = 0; + char const* password = 0; + char const* outfile = 0; + char const* outfile2 = 0; + void (*fn)(char const*, char const*, char const*, char const*) = 0; + + if ((p = strrchr(argv[0], '/')) != NULL) + { + whoami = p + 1; + } + else if ((p = strrchr(argv[0], '\\')) != NULL) + { + whoami = p + 1; + } + else + { + whoami = argv[0]; + } + if ((argc == 2) && (strcmp(argv[1], "--version") == 0)) + { + printf("qpdf-ctest version %s\n", qpdf_get_qpdf_version()); + return 0; + } + + if (argc < 5) + { + fprintf(stderr, "usage: %s n infile password outfile\n", whoami); + exit(2); + } + + n = atoi(argv[1]); + infile = argv[2]; + password = argv[3]; + outfile = argv[4]; + outfile2 = (argc > 5 ? argv[5] : 0); + + fn = ((n == 1) ? test01 : + (n == 2) ? test02 : + (n == 3) ? test03 : + (n == 4) ? test04 : + (n == 5) ? test05 : + (n == 6) ? test06 : + (n == 7) ? test07 : + (n == 8) ? test08 : + (n == 9) ? test09 : + (n == 10) ? test10 : + (n == 11) ? test11 : + (n == 12) ? test12 : + (n == 13) ? test13 : + (n == 14) ? test14 : + (n == 15) ? test15 : + (n == 16) ? test16 : + 0); + + if (fn == 0) + { + fprintf(stderr, "%s: invalid test number %d\n", whoami, n); + exit(2); + } + + qpdf = qpdf_init(); + fn(infile, password, outfile, outfile2); + qpdf_cleanup(&qpdf); + assert(qpdf == 0); + + return 0; +} diff --git a/qpdf/qpdf.cc b/qpdf/qpdf.cc new file mode 100644 index 0000000..2835a96 --- /dev/null +++ b/qpdf/qpdf.cc @@ -0,0 +1,1625 @@ +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include + +static int const EXIT_ERROR = 2; +static int const EXIT_WARNING = 3; + +static char const* whoami = 0; + +struct PageSpec +{ + PageSpec(std::string const& filename, + char const* password, + char const* range) : + filename(filename), + password(password), + range(range) + { + } + + std::string filename; + char const* password; + char const* range; +}; + +struct QPDFPageData +{ + QPDFPageData(QPDF* qpdf, char const* range); + + QPDF* qpdf; + std::vector orig_pages; + std::vector selected_pages; +}; + +// Note: let's not be too noisy about documenting the fact that this +// software purposely fails to enforce the distinction between user +// and owner passwords. A user password is sufficient to gain full +// access to the PDF file, so there is nothing this software can do +// with an owner password that it couldn't do with a user password +// other than changing the /P value in the encryption dictionary. +// (Setting this value requires the owner password.) The +// documentation discusses this as well. + +static char const* help = "\ +\n\ +Usage: qpdf [ options ] { infilename | --empty } [ outfilename ]\n\ +\n\ +An option summary appears below. Please see the documentation for details.\n\ +\n\ +Note that when contradictory options are provided, whichever options are\n\ +provided last take precedence.\n\ +\n\ +\n\ +Basic Options\n\ +-------------\n\ +\n\ +--password=password specify a password for accessing encrypted files\n\ +--linearize generated a linearized (web optimized) file\n\ +--copy-encryption=file copy encryption parameters from specified file\n\ +--encryption-file-password=password\n\ + password used to open the file from which encryption\n\ + parameters are being copied\n\ +--encrypt options -- generate an encrypted file\n\ +--decrypt remove any encryption on the file\n\ +--pages options -- select specific pages from one or more files\n\ +\n\ +If none of --copy-encryption, --encrypt or --decrypt are given, qpdf will\n\ +preserve any encryption data associated with a file.\n\ +\n\ +Note that when copying encryption parameters from another file, all\n\ +parameters will be copied, including both user and owner passwords, even\n\ +if the user password is used to open the other file. This works even if\n\ +the owner password is not known.\n\ +\n\ +\n\ +Encryption Options\n\ +------------------\n\ +\n\ + --encrypt user-password owner-password key-length flags --\n\ +\n\ +Note that -- terminates parsing of encryption flags.\n\ +\n\ +Either or both of the user password and the owner password may be\n\ +empty strings.\n\ +\n\ +key-length may be 40 or 128\n\ +\n\ +Additional flags are dependent upon key length.\n\ +\n\ + If 40:\n\ +\n\ + --print=[yn] allow printing\n\ + --modify=[yn] allow document modification\n\ + --extract=[yn] allow text/graphic extraction\n\ + --annotate=[yn] allow comments and form fill-in and signing\n\ +\n\ + If 128:\n\ +\n\ + --accessibility=[yn] allow accessibility to visually impaired\n\ + --extract=[yn] allow other text/graphic extraction\n\ + --print=print-opt control printing access\n\ + --modify=modify-opt control modify access\n\ + --cleartext-metadata prevents encryption of metadata\n\ + --use-aes=[yn] indicates whether to use AES encryption\n\ + --force-V4 forces use of V=4 encryption handler\n\ +\n\ + print-opt may be:\n\ +\n\ + full allow full printing\n\ + low allow only low-resolution printing\n\ + none disallow printing\n\ +\n\ + modify-opt may be:\n\ +\n\ + all allow full document modification\n\ + annotate allow comment authoring and form operations\n\ + form allow form field fill-in and signing\n\ + assembly allow document assembly only\n\ + none allow no modifications\n\ +\n\ +The default for each permission option is to be fully permissive.\n\ +\n\ +Specifying cleartext-metadata forces the PDF version to at least 1.5.\n\ +Specifying use of AES forces the PDF version to at least 1.6. These\n\ +options are both off by default.\n\ +\n\ +The --force-V4 flag forces the V=4 encryption handler introduced in PDF 1.5\n\ +to be used even if not otherwise needed. This option is primarily useful\n\ +for testing qpdf and has no other practical use.\n\ +\n\ +\n\ +Page Selection Options\n\ +----------------------\n\ +\n\ +These options allow pages to be selected from one or more PDF files.\n\ +Whatever file is given as the primary input file is used as the\n\ +starting point, but its pages are replaced with pages as specified.\n\ +\n\ +--pages file [ --password=password ] page-range ... --\n\ +\n\ +For each file that pages should be taken from, specify the file, a\n\ +password needed to open the file (if any), and a page range. The\n\ +password needs to be given only once per file. If any of the input\n\ +files are the same as the primary input file or the file used to copy\n\ +encryption parameters (if specified), you do not need to repeat the\n\ +password here. The same file can be repeated multiple times. All\n\ +non-page data (info, outlines, page numbers, etc. are taken from the\n\ +primary input file. To discard this, use --empty as the primary\n\ +input.\n\ +\n\ +The page range is a set of numbers separated by commas, ranges of\n\ +numbers separated dashes, or combinations of those. The character\n\ +\"z\" represents the last page. Pages can appear in any order. Ranges\n\ +can appear with a high number followed by a low number, which causes the\n\ +pages to appear in reverse. Repeating a number will cause an error, but\n\ +the manual discusses a workaround should you really want to include the\n\ +same page twice.\n\ +\n\ +See the manual for examples and a discussion of additional subtleties.\n\ +\n\ +\n\ +Advanced Transformation Options\n\ +-------------------------------\n\ +\n\ +These transformation options control fine points of how qpdf creates\n\ +the output file. Mostly these are of use only to people who are very\n\ +familiar with the PDF file format or who are PDF developers.\n\ +\n\ +--stream-data=option controls transformation of stream data (below)\n\ +--normalize-content=[yn] enables or disables normalization of content streams\n\ +--suppress-recovery prevents qpdf from attempting to recover damaged files\n\ +--object-streams=mode controls handing of object streams\n\ +--ignore-xref-streams tells qpdf to ignore any cross-reference streams\n\ +--qdf turns on \"QDF mode\" (below)\n\ +--min-version=version sets the minimum PDF version of the output file\n\ +--force-version=version forces this to be the PDF version of the output file\n\ +\n\ +Values for stream data options:\n\ +\n\ + compress recompress stream data when possible (default)\n\ + preserve leave all stream data as is\n\ + uncompress uncompress stream data when possible\n\ +\n\ +Values for object stream mode:\n\ +\n\ + preserve preserve original object streams (default)\n\ + disable don't write any object streams\n\ + generate use object streams wherever possible\n\ +\n\ +In qdf mode, by default, content normalization is turned on, and the\n\ +stream data mode is set to uncompress.\n\ +\n\ +Setting the minimum PDF version of the output file may raise the version\n\ +but will never lower it. Forcing the PDF version of the output file may\n\ +set the PDF version to a lower value than actually allowed by the file's\n\ +contents. You should only do this if you have no other possible way to\n\ +open the file or if you know that the file definitely doesn't include\n\ +features not supported later versions.\n\ +\n\ +Testing, Inspection, and Debugging Options\n\ +------------------------------------------\n\ +\n\ +These options can be useful for digging into PDF files or for use in\n\ +automated test suites for software that uses the qpdf library.\n\ +\n\ +--static-id generate static /ID: FOR TESTING ONLY!\n\ +--static-aes-iv use a static initialization vector for AES-CBC\n\ + This is option is not secure! FOR TESTING ONLY!\n\ +--no-original-object-ids suppress original object ID comments in qdf mode\n\ +--show-encryption quickly show encryption parameters\n\ +--check-linearization check file integrity and linearization status\n\ +--show-linearization check and show all linearization data\n\ +--show-xref show the contents of the cross-reference table\n\ +--show-object=obj[,gen] show the contents of the given object\n\ + --raw-stream-data show raw stream data instead of object contents\n\ + --filtered-stream-data show filtered stream data instead of object contents\n\ +--show-pages shows the object/generation number for each page\n\ + --with-images also shows the object IDs for images on each page\n\ +--check check file structure + encryption, linearization\n\ +\n\ +The --raw-stream-data and --filtered-stream-data options are ignored\n\ +unless --show-object is given. Either of these options will cause the\n\ +stream data to be written to standard output.\n\ +\n\ +If --filtered-stream-data is given and --normalize-content=y is also\n\ +given, qpdf will attempt to normalize the stream data as if it is a\n\ +page content stream. This attempt will be made even if it is not a\n\ +page content stream, in which case it will produce unusable results.\n\ +\n\ +Ordinarily, qpdf exits with a status of 0 on success or a status of 2\n\ +if any errors occurred. In --check mode, if there were warnings but not\n\ +errors, qpdf exits with a status of 3.\n\ +\n"; + +void usage(std::string const& msg) +{ + std::cerr + << std::endl + << whoami << ": " << msg << std::endl + << std::endl + << "Usage: " << whoami << " [options] infile outfile" << std::endl + << "For detailed help, run " << whoami << " --help" << std::endl + << std::endl; + exit(EXIT_ERROR); +} + +static std::string show_bool(bool v) +{ + return v ? "allowed" : "not allowed"; +} + +static std::string show_encryption_method(QPDF::encryption_method_e method) +{ + std::string result = "unknown"; + switch (method) + { + case QPDF::e_none: + result = "none"; + break; + case QPDF::e_unknown: + result = "unknown"; + break; + case QPDF::e_rc4: + result = "RC4"; + break; + case QPDF::e_aes: + result = "AESv2"; + break; + // no default so gcc will warn for missing case + } + return result; +} + +static void show_encryption(QPDF& pdf) +{ + // Extract /P from /Encrypt + int R = 0; + int P = 0; + int V = 0; + QPDF::encryption_method_e stream_method = QPDF::e_unknown; + QPDF::encryption_method_e string_method = QPDF::e_unknown; + QPDF::encryption_method_e file_method = QPDF::e_unknown; + if (! pdf.isEncrypted(R, P, V, + stream_method, string_method, file_method)) + { + std::cout << "File is not encrypted" << std::endl; + } + else + { + std::cout << "R = " << R << std::endl; + std::cout << "P = " << P << std::endl; + std::string user_password = pdf.getTrimmedUserPassword(); + std::cout << "User password = " << user_password << std::endl + << "extract for accessibility: " + << show_bool(pdf.allowAccessibility()) << std::endl + << "extract for any purpose: " + << show_bool(pdf.allowExtractAll()) << std::endl + << "print low resolution: " + << show_bool(pdf.allowPrintLowRes()) << std::endl + << "print high resolution: " + << show_bool(pdf.allowPrintHighRes()) << std::endl + << "modify document assembly: " + << show_bool(pdf.allowModifyAssembly()) << std::endl + << "modify forms: " + << show_bool(pdf.allowModifyForm()) << std::endl + << "modify annotations: " + << show_bool(pdf.allowModifyAnnotation()) << std::endl + << "modify other: " + << show_bool(pdf.allowModifyOther()) << std::endl + << "modify anything: " + << show_bool(pdf.allowModifyAll()) << std::endl; + if (V >= 4) + { + std::cout << "stream encryption method: " + << show_encryption_method(stream_method) << std::endl + << "string encryption method: " + << show_encryption_method(string_method) << std::endl + << "file encryption method: " + << show_encryption_method(file_method) << std::endl; + } + } +} + +static std::vector parse_numrange(char const* range, int max) +{ + std::vector result; + char const* p = range; + try + { + std::vector work; + static int const comma = -1; + static int const dash = -2; + + enum { st_top, + st_in_number, + st_after_number } state = st_top; + bool last_separator_was_dash = false; + int cur_number = 0; + while (*p) + { + char ch = *p; + if (isdigit(ch)) + { + if (! ((state == st_top) || (state == st_in_number))) + { + throw std::runtime_error("digit not expected"); + } + state = st_in_number; + cur_number *= 10; + cur_number += (ch - '0'); + } + else if (ch == 'z') + { + // z represents max + if (! (state == st_top)) + { + throw std::runtime_error("z not expected"); + } + state = st_after_number; + cur_number = max; + } + else if ((ch == ',') || (ch == '-')) + { + if (! ((state == st_in_number) || (state == st_after_number))) + { + throw std::runtime_error("unexpected separator"); + } + work.push_back(cur_number); + cur_number = 0; + if (ch == ',') + { + state = st_top; + last_separator_was_dash = false; + work.push_back(comma); + } + else if (ch == '-') + { + if (last_separator_was_dash) + { + throw std::runtime_error("unexpected dash"); + } + state = st_top; + last_separator_was_dash = true; + work.push_back(dash); + } + } + else + { + throw std::runtime_error("unexpected character"); + } + ++p; + } + if ((state == st_in_number) || (state == st_after_number)) + { + work.push_back(cur_number); + } + else + { + throw std::runtime_error("number expected"); + } + + p = 0; + for (size_t i = 0; i < work.size(); i += 2) + { + int num = work[i]; + if ((num < 1) || (num > max)) + { + throw std::runtime_error( + "number " + QUtil::int_to_string(num) + " out of range"); + } + if (i == 0) + { + result.push_back(work[i]); + } + else + { + int separator = work[i-1]; + if (separator == comma) + { + result.push_back(num); + } + else if (separator == dash) + { + int lastnum = result.back(); + if (num > lastnum) + { + for (int j = lastnum + 1; j <= num; ++j) + { + result.push_back(j); + } + } + else + { + for (int j = lastnum - 1; j >= num; --j) + { + result.push_back(j); + } + } + } + else + { + throw std::logic_error( + "INTERNAL ERROR parsing numeric range"); + } + } + } + } + catch (std::runtime_error e) + { + if (p) + { + usage("error at * in numeric range " + + std::string(range, p - range) + "*" + p + ": " + e.what()); + } + else + { + usage("error in numeric range " + + std::string(range) + ": " + e.what()); + } + } + return result; +} + +static void +parse_encrypt_options( + int argc, char* argv[], int& cur_arg, + std::string& user_password, std::string& owner_password, int& keylen, + bool& r2_print, bool& r2_modify, bool& r2_extract, bool& r2_annotate, + bool& r3_accessibility, bool& r3_extract, + qpdf_r3_print_e& r3_print, qpdf_r3_modify_e& r3_modify, + bool& force_V4, bool& cleartext_metadata, bool& use_aes) +{ + if (cur_arg + 3 >= argc) + { + usage("insufficient arguments to --encrypt"); + } + user_password = argv[cur_arg++]; + owner_password = argv[cur_arg++]; + std::string len_str = argv[cur_arg++]; + if (len_str == "40") + { + keylen = 40; + } + else if (len_str == "128") + { + keylen = 128; + } + else + { + usage("encryption key length must be 40 or 128"); + } + while (1) + { + char* arg = argv[cur_arg]; + if (arg == 0) + { + usage("insufficient arguments to --encrypt"); + } + else if (strcmp(arg, "--") == 0) + { + return; + } + if (arg[0] == '-') + { + ++arg; + if (arg[0] == '-') + { + ++arg; + } + } + else + { + usage(std::string("invalid encryption parameter ") + arg); + } + ++cur_arg; + char* parameter = strchr(arg, '='); + if (parameter) + { + *parameter++ = 0; + } + if (strcmp(arg, "print") == 0) + { + if (parameter == 0) + { + usage("--print must be given as --print=option"); + } + std::string val = parameter; + if (keylen == 40) + { + if (val == "y") + { + r2_print = true; + } + else if (val == "n") + { + r2_print = false; + } + else + { + usage("invalid 40-bit -print parameter"); + } + } + else + { + if (val == "full") + { + r3_print = qpdf_r3p_full; + } + else if (val == "low") + { + r3_print = qpdf_r3p_low; + } + else if (val == "none") + { + r3_print = qpdf_r3p_none; + } + else + { + usage("invalid 128-bit -print parameter"); + } + } + } + else if (strcmp(arg, "modify") == 0) + { + if (parameter == 0) + { + usage("--modify must be given as --modify=option"); + } + std::string val = parameter; + if (keylen == 40) + { + if (val == "y") + { + r2_modify = true; + } + else if (val == "n") + { + r2_modify = false; + } + else + { + usage("invalid 40-bit -modify parameter"); + } + } + else + { + if (val == "all") + { + r3_modify = qpdf_r3m_all; + } + else if (val == "annotate") + { + r3_modify = qpdf_r3m_annotate; + } + else if (val == "form") + { + r3_modify = qpdf_r3m_form; + } + else if (val == "assembly") + { + r3_modify = qpdf_r3m_assembly; + } + else if (val == "none") + { + r3_modify = qpdf_r3m_none; + } + else + { + usage("invalid 128-bit -modify parameter"); + } + } + } + else if (strcmp(arg, "extract") == 0) + { + if (parameter == 0) + { + usage("--extract must be given as --extract=option"); + } + std::string val = parameter; + bool result = false; + if (val == "y") + { + result = true; + } + else if (val == "n") + { + result = false; + } + else + { + usage("invalid -extract parameter"); + } + if (keylen == 40) + { + r2_extract = result; + } + else + { + r3_extract = result; + } + } + else if (strcmp(arg, "annotate") == 0) + { + if (parameter == 0) + { + usage("--annotate must be given as --annotate=option"); + } + std::string val = parameter; + bool result = false; + if (val == "y") + { + result = true; + } + else if (val == "n") + { + result = false; + } + else + { + usage("invalid -annotate parameter"); + } + if (keylen == 40) + { + r2_annotate = result; + } + else + { + usage("-annotate invalid for 128-bit keys"); + } + } + else if (strcmp(arg, "accessibility") == 0) + { + if (parameter == 0) + { + usage("--accessibility must be given as" + " --accessibility=option"); + } + std::string val = parameter; + bool result = false; + if (val == "y") + { + result = true; + } + else if (val == "n") + { + result = false; + } + else + { + usage("invalid -accessibility parameter"); + } + if (keylen == 128) + { + r3_accessibility = result; + } + else + { + usage("-accessibility invalid for 40-bit keys"); + } + } + else if (strcmp(arg, "cleartext-metadata") == 0) + { + if (parameter) + { + usage("--cleartext-metadata does not take a parameter"); + } + if (keylen == 40) + { + usage("--cleartext-metadata is invalid for 40-bit keys"); + } + else + { + cleartext_metadata = true; + } + } + else if (strcmp(arg, "force-V4") == 0) + { + if (parameter) + { + usage("--force-V4 does not take a parameter"); + } + if (keylen == 40) + { + usage("--force-V4 is invalid for 40-bit keys"); + } + else + { + force_V4 = true; + } + } + else if (strcmp(arg, "use-aes") == 0) + { + if (parameter == 0) + { + usage("--use-aes must be given as --extract=option"); + } + std::string val = parameter; + bool result = false; + if (val == "y") + { + result = true; + } + else if (val == "n") + { + result = false; + } + else + { + usage("invalid -use-aes parameter"); + } + if (keylen == 40) + { + usage("use-aes is invalid for 40-bit keys"); + } + else + { + use_aes = result; + } + } + else + { + usage(std::string("invalid encryption parameter --") + arg); + } + } +} + +static std::vector +parse_pages_options( + int argc, char* argv[], int& cur_arg) +{ + std::vector result; + while (1) + { + if ((cur_arg < argc) && (strcmp(argv[cur_arg], "--") == 0)) + { + break; + } + if (cur_arg + 2 >= argc) + { + usage("insufficient arguments to --pages"); + } + char* file = argv[cur_arg++]; + char* password = 0; + char* range = argv[cur_arg++]; + if (strncmp(range, "--password=", 11) == 0) + { + // Oh, that's the password, not the range + if (cur_arg + 1 >= argc) + { + usage("insufficient arguments to --pages"); + } + password = range + 11; + range = argv[cur_arg++]; + } + + result.push_back(PageSpec(file, password, range)); + } + return result; +} + +static void test_numrange(char const* range) +{ + if (range == 0) + { + std::cout << "null" << std::endl; + } + else + { + std::vector result = parse_numrange(range, 15); + std::cout << "numeric range " << range << " ->"; + for (std::vector::iterator iter = result.begin(); + iter != result.end(); ++iter) + { + std::cout << " " << *iter; + } + std::cout << std::endl; + } +} + +QPDFPageData::QPDFPageData(QPDF* qpdf, char const* range) : + qpdf(qpdf), + orig_pages(qpdf->getAllPages()) +{ + this->selected_pages = parse_numrange(range, (int)this->orig_pages.size()); +} + +int main(int argc, char* argv[]) +{ + whoami = QUtil::getWhoami(argv[0]); + QUtil::setLineBuf(stdout); + + // For libtool's sake.... + if (strncmp(whoami, "lt-", 3) == 0) + { + whoami += 3; + } + + if ((argc == 2) && + ((strcmp(argv[1], "--version") == 0) || + (strcmp(argv[1], "-version") == 0))) + { + // make_dist looks for the line of code here that actually + // prints the version number, so read make_dist if you change + // anything other than the version number. Don't worry about + // the numbers. That's just a guide to 80 columns so that the + // help message looks right on an 80-column display. + + // 1 2 3 4 5 6 7 8 + // 12345678901234567890123456789012345678901234567890123456789012345678901234567890 + std::cout + << whoami << " version " << QPDF::QPDFVersion() << std::endl + << "Copyright (c) 2005-2012 Jay Berkenbilt" + << std::endl + << "This software may be distributed under the terms of version 2 of the" + << std::endl + << "Artistic License which may be found in the source distribution. It is" + << std::endl + << "provided \"as is\" without express or implied warranty." + << std::endl; + exit(0); + } + + if ((argc == 2) && + ((strcmp(argv[1], "--help") == 0) || + (strcmp(argv[1], "-help") == 0))) + { + std::cout << help; + exit(0); + } + + char const* password = 0; + bool linearize = false; + bool decrypt = false; + + bool copy_encryption = false; + char const* encryption_file = 0; + char const* encryption_file_password = 0; + + bool encrypt = false; + std::string user_password; + std::string owner_password; + int keylen = 0; + bool r2_print = true; + bool r2_modify = true; + bool r2_extract = true; + bool r2_annotate = true; + bool r3_accessibility = true; + bool r3_extract = true; + qpdf_r3_print_e r3_print = qpdf_r3p_full; + qpdf_r3_modify_e r3_modify = qpdf_r3m_all; + bool force_V4 = false; + bool cleartext_metadata = false; + bool use_aes = false; + + bool stream_data_set = false; + qpdf_stream_data_e stream_data_mode = qpdf_s_compress; + bool normalize_set = false; + bool normalize = false; + bool suppress_recovery = false; + bool object_stream_set = false; + qpdf_object_stream_e object_stream_mode = qpdf_o_preserve; + bool ignore_xref_streams = false; + bool qdf_mode = false; + std::string min_version; + std::string force_version; + + bool static_id = false; + bool static_aes_iv = false; + bool suppress_original_object_id = false; + bool show_encryption = false; + bool check_linearization = false; + bool show_linearization = false; + bool show_xref = false; + int show_obj = 0; + int show_gen = 0; + bool show_raw_stream_data = false; + bool show_filtered_stream_data = false; + bool show_pages = false; + bool show_page_images = false; + bool check = false; + + std::vector page_specs; + + bool require_outfile = true; + char const* infilename = 0; + char const* outfilename = 0; + + for (int i = 1; i < argc; ++i) + { + char const* arg = argv[i]; + if ((arg[0] == '-') && (strcmp(arg, "-") != 0)) + { + ++arg; + if (arg[0] == '-') + { + // Be lax about -arg vs --arg + ++arg; + } + char* parameter = (char*)strchr(arg, '='); + if (parameter) + { + *parameter++ = 0; + } + + // Arguments that start with space are undocumented and + // are for use by the test suite. + if (strcmp(arg, " test-numrange") == 0) + { + test_numrange(parameter); + exit(0); + } + else if (strcmp(arg, "password") == 0) + { + if (parameter == 0) + { + usage("--password must be given as --password=pass"); + } + password = parameter; + } + else if (strcmp(arg, "empty") == 0) + { + infilename = ""; + } + else if (strcmp(arg, "linearize") == 0) + { + linearize = true; + } + else if (strcmp(arg, "encrypt") == 0) + { + parse_encrypt_options( + argc, argv, ++i, + user_password, owner_password, keylen, + r2_print, r2_modify, r2_extract, r2_annotate, + r3_accessibility, r3_extract, r3_print, r3_modify, + force_V4, cleartext_metadata, use_aes); + encrypt = true; + decrypt = false; + copy_encryption = false; + } + else if (strcmp(arg, "decrypt") == 0) + { + decrypt = true; + encrypt = false; + copy_encryption = false; + } + else if (strcmp(arg, "copy-encryption") == 0) + { + if (parameter == 0) + { + usage("--copy-encryption must be given as" + "--copy_encryption=file"); + } + encryption_file = parameter; + copy_encryption = true; + encrypt = false; + decrypt = false; + } + else if (strcmp(arg, "encryption-file-password") == 0) + { + if (parameter == 0) + { + usage("--encryption-file-password must be given as" + "--encryption-file-password=password"); + } + encryption_file_password = parameter; + } + else if (strcmp(arg, "pages") == 0) + { + page_specs = parse_pages_options(argc, argv, ++i); + if (page_specs.empty()) + { + usage("--pages: no page specifications given"); + } + } + else if (strcmp(arg, "stream-data") == 0) + { + if (parameter == 0) + { + usage("--stream-data must be given as" + "--stream-data=option"); + } + stream_data_set = true; + if (strcmp(parameter, "compress") == 0) + { + stream_data_mode = qpdf_s_compress; + } + else if (strcmp(parameter, "preserve") == 0) + { + stream_data_mode = qpdf_s_preserve; + } + else if (strcmp(parameter, "uncompress") == 0) + { + stream_data_mode = qpdf_s_uncompress; + } + else + { + usage("invalid stream-data option"); + } + } + else if (strcmp(arg, "normalize-content") == 0) + { + if ((parameter == 0) || (*parameter == '\0')) + { + usage("--normalize-content must be given as" + " --normalize-content=[yn]"); + } + normalize_set = true; + normalize = (parameter[0] == 'y'); + } + else if (strcmp(arg, "suppress-recovery") == 0) + { + suppress_recovery = true; + } + else if (strcmp(arg, "object-streams") == 0) + { + if (parameter == 0) + { + usage("--object-streams must be given as" + " --object-streams=option"); + } + object_stream_set = true; + if (strcmp(parameter, "disable") == 0) + { + object_stream_mode = qpdf_o_disable; + } + else if (strcmp(parameter, "preserve") == 0) + { + object_stream_mode = qpdf_o_preserve; + } + else if (strcmp(parameter, "generate") == 0) + { + object_stream_mode = qpdf_o_generate; + } + else + { + usage("invalid object stream mode"); + } + } + else if (strcmp(arg, "ignore-xref-streams") == 0) + { + ignore_xref_streams = true; + } + else if (strcmp(arg, "qdf") == 0) + { + qdf_mode = true; + } + else if (strcmp(arg, "min-version") == 0) + { + if (parameter == 0) + { + usage("--min-version be given as" + "--min-version=version"); + } + min_version = parameter; + } + else if (strcmp(arg, "force-version") == 0) + { + if (parameter == 0) + { + usage("--force-version be given as" + "--force-version=version"); + } + force_version = parameter; + } + else if (strcmp(arg, "static-id") == 0) + { + static_id = true; + } + else if (strcmp(arg, "static-aes-iv") == 0) + { + static_aes_iv = true; + } + else if (strcmp(arg, "no-original-object-ids") == 0) + { + suppress_original_object_id = true; + } + else if (strcmp(arg, "show-encryption") == 0) + { + show_encryption = true; + require_outfile = false; + } + else if (strcmp(arg, "check-linearization") == 0) + { + check_linearization = true; + require_outfile = false; + } + else if (strcmp(arg, "show-linearization") == 0) + { + show_linearization = true; + require_outfile = false; + } + else if (strcmp(arg, "show-xref") == 0) + { + show_xref = true; + require_outfile = false; + } + else if (strcmp(arg, "show-object") == 0) + { + if (parameter == 0) + { + usage("--show-object must be given as" + " --show-object=obj[,gen]"); + } + char* obj = parameter; + char* gen = obj; + if ((gen = strchr(obj, ',')) != 0) + { + *gen++ = 0; + show_gen = atoi(gen); + } + show_obj = atoi(obj); + require_outfile = false; + } + else if (strcmp(arg, "raw-stream-data") == 0) + { + show_raw_stream_data = true; + } + else if (strcmp(arg, "filtered-stream-data") == 0) + { + show_filtered_stream_data = true; + } + else if (strcmp(arg, "show-pages") == 0) + { + show_pages = true; + require_outfile = false; + } + else if (strcmp(arg, "with-images") == 0) + { + show_page_images = true; + } + else if (strcmp(arg, "check") == 0) + { + check = true; + require_outfile = false; + } + else + { + usage(std::string("unknown option --") + arg); + } + } + else if (infilename == 0) + { + infilename = arg; + } + else if (outfilename == 0) + { + outfilename = arg; + } + else + { + usage(std::string("unknown argument ") + arg); + } + } + + if (infilename == 0) + { + usage("an input file name is required"); + } + else if (require_outfile && (outfilename == 0)) + { + usage("an output file name is required; use - for standard output"); + } + else if ((! require_outfile) && (outfilename != 0)) + { + usage("no output file may be given for this option"); + } + + try + { + QPDF pdf; + QPDF encryption_pdf; + if (ignore_xref_streams) + { + pdf.setIgnoreXRefStreams(true); + } + if (suppress_recovery) + { + pdf.setAttemptRecovery(false); + } + if (strcmp(infilename, "") == 0) + { + pdf.emptyPDF(); + } + else + { + pdf.processFile(infilename, password); + } + if (outfilename == 0) + { + if (show_encryption) + { + ::show_encryption(pdf); + } + if (check_linearization) + { + if (pdf.checkLinearization()) + { + std::cout << infilename << ": no linearization errors" + << std::endl; + } + else + { + exit(EXIT_ERROR); + } + } + if (show_linearization) + { + if (pdf.isLinearized()) + { + pdf.showLinearizationData(); + } + else + { + std::cout << infilename << " is not linearized" + << std::endl; + } + } + if (show_xref) + { + pdf.showXRefTable(); + } + if (show_obj > 0) + { + QPDFObjectHandle obj = pdf.getObjectByID(show_obj, show_gen); + if (obj.isStream()) + { + if (show_raw_stream_data || show_filtered_stream_data) + { + bool filter = show_filtered_stream_data; + if (filter && + (! obj.pipeStreamData(0, true, false, false))) + { + QTC::TC("qpdf", "qpdf unable to filter"); + std::cerr << "Unable to filter stream data." + << std::endl; + exit(EXIT_ERROR); + } + else + { + QUtil::binary_stdout(); + Pl_StdioFile out("stdout", stdout); + obj.pipeStreamData(&out, filter, normalize, false); + } + } + else + { + std::cout + << "Object is stream. Dictionary:" << std::endl + << obj.getDict().unparseResolved() << std::endl; + } + } + else + { + std::cout << obj.unparseResolved() << std::endl; + } + } + if (show_pages) + { + if (show_page_images) + { + pdf.pushInheritedAttributesToPage(); + } + std::vector pages = pdf.getAllPages(); + int pageno = 0; + for (std::vector::iterator iter = + pages.begin(); + iter != pages.end(); ++iter) + { + QPDFObjectHandle& page = *iter; + ++pageno; + + std::cout << "page " << pageno << ": " + << page.getObjectID() << " " + << page.getGeneration() << " R" << std::endl; + if (show_page_images) + { + std::map images = + page.getPageImages(); + if (! images.empty()) + { + std::cout << " images:" << std::endl; + for (std::map::iterator + iter = images.begin(); + iter != images.end(); ++iter) + { + std::string const& name = (*iter).first; + QPDFObjectHandle image = (*iter).second; + QPDFObjectHandle dict = image.getDict(); + int width = + dict.getKey("/Width").getIntValue(); + int height = + dict.getKey("/Height").getIntValue(); + std::cout << " " << name << ": " + << image.unparse() + << ", " << width << " x " << height + << std::endl; + } + } + } + + std::cout << " content:" << std::endl; + std::vector content = + page.getPageContents(); + for (std::vector::iterator iter = + content.begin(); + iter != content.end(); ++iter) + { + std::cout << " " << (*iter).unparse() << std::endl; + } + } + } + if (check) + { + bool okay = false; + std::cout << "checking " << infilename << std::endl; + try + { + std::cout << "PDF Version: " << pdf.getPDFVersion() + << std::endl; + ::show_encryption(pdf); + if (pdf.isLinearized()) + { + std::cout << "File is linearized\n"; + okay = pdf.checkLinearization(); + // any errors are reported by checkLinearization(). + } + else + { + std::cout << "File is not linearized\n"; + // calling flattenScalarReferences causes full + // traversal of file, so any structural errors + // would be exposed. + pdf.flattenScalarReferences(); + // Also explicitly decode all streams. + pdf.decodeStreams(); + okay = true; + } + } + catch (std::exception& e) + { + std::cout << e.what() << std::endl; + } + if (okay) + { + if (! pdf.getWarnings().empty()) + { + exit(EXIT_WARNING); + } + else + { + std::cout << "No syntax or stream encoding errors" + << " found; the file may still contain" + << std::endl + << "errors that qpdf cannot detect" + << std::endl; + } + } + } + } + else + { + std::vector > page_heap; + if (! page_specs.empty()) + { + // Parse all page specifications and translate them + // into lists of actual pages. + + // Create a QPDF object for each file that we may take + // pages from. + std::map page_spec_qpdfs; + page_spec_qpdfs[infilename] = &pdf; + std::vector parsed_specs; + for (std::vector::iterator iter = page_specs.begin(); + iter != page_specs.end(); ++iter) + { + PageSpec& page_spec = *iter; + if (page_spec_qpdfs.count(page_spec.filename) == 0) + { + // Open the PDF file and store the QPDF + // object. Throw a PointerHolder to the qpdf + // into a heap so that it survives through + // writing the output but gets cleaned up + // automatically at the end. Do not + // canonicalize the file name. Using two + // different paths to refer to the same file + // is a document workaround for duplicating a + // page. If you are using this an example of + // how to do this with the API, you can just + // create two different QPDF objects to the + // same underlying file with the same path to + // achieve the same affect. + PointerHolder qpdf_ph = new QPDF(); + page_heap.push_back(qpdf_ph); + QPDF* qpdf = qpdf_ph.getPointer(); + char const* password = page_spec.password; + if (encryption_file && (password == 0) && + (page_spec.filename == encryption_file)) + { + QTC::TC("qpdf", "qpdf pages encryption password"); + password = encryption_file_password; + } + qpdf->processFile( + page_spec.filename.c_str(), password); + page_spec_qpdfs[page_spec.filename] = qpdf; + } + + // Read original pages from the PDF, and parse the + // page range associated with this occurrence of + // the file. + parsed_specs.push_back( + QPDFPageData(page_spec_qpdfs[page_spec.filename], + page_spec.range)); + } + + // Clear all pages out of the primary QPDF's pages + // tree but leave the objects in place in the file so + // they can be re-added without changing their object + // numbers. This enables other things in the original + // file, such as outlines, to continue to work. + std::vector orig_pages = pdf.getAllPages(); + for (std::vector::iterator iter = + orig_pages.begin(); + iter != orig_pages.end(); ++iter) + { + pdf.removePage(*iter); + } + + // Add all the pages from all the files in the order + // specified. Keep track of any pages from the + // original file that we are selecting. + std::set selected_from_orig; + for (std::vector::iterator iter = + parsed_specs.begin(); + iter != parsed_specs.end(); ++iter) + { + QPDFPageData& page_data = *iter; + for (std::vector::iterator pageno_iter = + page_data.selected_pages.begin(); + pageno_iter != page_data.selected_pages.end(); + ++pageno_iter) + { + // Pages are specified from 1 but numbered + // from 0 in the vector + int pageno = *pageno_iter - 1; + pdf.addPage(page_data.orig_pages[pageno], false); + if (page_data.qpdf == &pdf) + { + // This is a page from the original file. + // Keep track of the fact that we are + // using it. + selected_from_orig.insert(pageno); + } + } + } + + // Delete page objects for unused page in primary. + // This prevents those objects from being preserved by + // being referred to from other places, such as the + // outlines dictionary. + for (int pageno = 0; pageno < (int)orig_pages.size(); ++pageno) + { + if (selected_from_orig.count(pageno) == 0) + { + pdf.replaceObject(orig_pages[pageno].getObjectID(), + orig_pages[pageno].getGeneration(), + QPDFObjectHandle::newNull()); + } + } + } + + if (strcmp(outfilename, "-") == 0) + { + outfilename = 0; + } + QPDFWriter w(pdf, outfilename); + if (qdf_mode) + { + w.setQDFMode(true); + } + if (normalize_set) + { + w.setContentNormalization(normalize); + } + if (stream_data_set) + { + w.setStreamDataMode(stream_data_mode); + } + if (decrypt) + { + w.setPreserveEncryption(false); + } + if (static_id) + { + w.setStaticID(true); + } + if (static_aes_iv) + { + w.setStaticAesIV(true); + } + if (suppress_original_object_id) + { + w.setSuppressOriginalObjectIDs(true); + } + if (copy_encryption) + { + encryption_pdf.processFile( + encryption_file, encryption_file_password); + w.copyEncryptionParameters(encryption_pdf); + } + if (encrypt) + { + if (keylen == 40) + { + w.setR2EncryptionParameters( + user_password.c_str(), owner_password.c_str(), + r2_print, r2_modify, r2_extract, r2_annotate); + } + else if (keylen == 128) + { + if (force_V4 || cleartext_metadata || use_aes) + { + w.setR4EncryptionParameters( + user_password.c_str(), owner_password.c_str(), + r3_accessibility, r3_extract, r3_print, r3_modify, + !cleartext_metadata, use_aes); + } + else + { + w.setR3EncryptionParameters( + user_password.c_str(), owner_password.c_str(), + r3_accessibility, r3_extract, r3_print, r3_modify); + } + } + else + { + throw std::logic_error("bad encryption keylen"); + } + } + if (linearize) + { + w.setLinearization(true); + } + if (object_stream_set) + { + w.setObjectStreamMode(object_stream_mode); + } + if (! min_version.empty()) + { + w.setMinimumPDFVersion(min_version); + } + if (! force_version.empty()) + { + w.forcePDFVersion(force_version); + } + w.write(); + } + if (! pdf.getWarnings().empty()) + { + std::cerr << whoami << ": operation succeeded with warnings;" + << " resulting file may have some problems" << std::endl; + exit(EXIT_WARNING); + } + } + catch (std::exception& e) + { + std::cerr << e.what() << std::endl; + exit(EXIT_ERROR); + } + + return 0; +} diff --git a/qpdf/qpdf.testcov b/qpdf/qpdf.testcov new file mode 100644 index 0000000..f966337 --- /dev/null +++ b/qpdf/qpdf.testcov @@ -0,0 +1,244 @@ +ignored-scope: libtests +QPDF lindict searching after null 0 +QPDF err expected endobj 0 +QPDF err wrong objid/generation 0 +QPDF check objid 1 +QPDF check generation 1 +QPDF check obj 1 +QPDF hint table length indirect 0 +QPDF hint table length direct 0 +QPDF P absent in lindict 0 +QPDF P present in lindict 0 +QPDF expected n n obj 0 +QPDF lindict found newline 0 +QPDF /L mismatch 0 +QPDF err /T mismatch 0 +QPDF err /O mismatch 0 +QPDF opt direct pages resource 1 +QPDF opt inheritable keys 0 +QPDF opt no inheritable keys 0 +QPDF opt erase empty key ancestor 0 +QPDF opt resource inherited 0 +QPDF opt page resource hides ancestor 0 +QPDF opt key ancestors depth > 1 0 +QPDF opt loop detected 0 +QPDF categorize pagemode present 1 +QPDF categorize pagemode outlines 1 +QPDF warn /E mismatch 0 +QPDF lin outlines in part 1 +QPDF lin nshared_total > nshared_first_page 1 +QPDF lin part 8 empty 1 +QPDF lin check shared past first page 0 +QPDF opt flatten array scalar 0 +QPDF opt flatten dict scalar 0 +main QTest implicit 0 +main QTest indirect 1 +main QTest null 0 +main QTest bool 1 +main QTest int 0 +main QTest real 0 +main QTest name 0 +main QTest string 0 +main QTest array 0 +main QTest array indirect 1 +main QTest dictionary 0 +main QTest dictionary indirect 1 +main QTest stream 0 +QPDFWriter write to stdout 0 +QPDFWriter write to file 0 +QPDF lin write nshared_total > nshared_first_page 1 +QPDFWriter encrypted hint stream 0 +QPDF opt inherited scalar 0 +QPDF xref reused object 0 +QPDF xref gen > 0 1 +QPDF xref size mismatch 0 +QPDF not a pdf file 0 +QPDF can't find startxref 0 +QPDF invalid xref 0 +QPDF invalid xref entry 0 +QPDF missing trailer 0 +QPDF trailer lacks size 0 +QPDF trailer size not integer 0 +QPDF trailer prev not integer 0 +QPDFObjectHandle bad brace 0 +QPDFObjectHandle bad array close 0 +QPDFObjectHandle dictionary odd number of elements 0 +QPDF stream without length 0 +QPDF stream length not integer 0 +QPDF missing endstream 0 +QPDFObjectHandle bad dictionary close 0 +QPDF can't find xref 0 +QPDF_Tokenizer bad ) 0 +QPDF_Tokenizer bad > 0 +QPDF_Tokenizer bad ( 0 +QPDF_Tokenizer null in name 0 +QPDF_Tokenizer bad name 0 +QPDF_Stream invalid filter 0 +QPDF UseOutlines but no Outlines 0 +QPDFObjectHandle clone bool 0 +QPDFObjectHandle clone null 0 +QPDFObjectHandle clone integer 0 +QPDFObjectHandle clone real 0 +QPDFObjectHandle clone name 0 +QPDFObjectHandle clone string 0 +QPDFObjectHandle clone array 0 +QPDFObjectHandle clone dictionary 0 +QPDFObjectHandle makeDirect loop 0 +QPDFObjectHandle ERR clone stream 0 +QPDFTokenizer allow pound anywhere in name 0 +QPDF indirect last obj from xref 1 +QPDF default for xref stream field 0 0 +QPDF prev key in xref stream dictionary 0 +QPDF prev key in trailer dictionary 0 +QPDF found xref stream 0 +QPDF ignoring XRefStm in trailer 0 +QPDF xref deleted object 0 +QPDF_Stream PNG filter 0 +QPDF xref /Index is null 0 +QPDF xref /Index is array 1 +QPDFWriter copy Extends 0 +QPDFWriter encrypt object stream 0 +QPDFWriter uncompressing page dictionary 0 +QPDFWriter uncompressing root 0 +QPDFWriter compressing uncompressed stream 0 +QPDF exclude indirect length 0 +QPDFWriter generate >1 ostream 0 +QPDF exclude encryption dictionary 0 +QPDF loop detected traversing objects 0 +QPDF reconstructed xref table 0 +QPDF recovered in readObjectAtOffset 0 +QPDF recovered stream length 0 +QPDF found wrong endstream in recovery 0 +QPDFObjectHandle indirect to unknown 0 +QPDF_Stream pipeStreamData with null pipeline 0 +QPDFWriter not recompressing /FlateDecode 0 +QPDF_encryption xref stream from encrypted file 0 +qpdf unable to filter 0 +QPDF_String non-trivial UTF-16 0 +QPDF xref overwrite object 0 +QPDF decoding error warning 0 +QPDF_Stream ignore non-dictionary DecodeParms 0 +qpdf-c called qpdf_init 0 +qpdf-c called qpdf_cleanup 0 +qpdf-c called qpdf_more_warnings 0 +qpdf-c qpdf_get_error returned error 0 +qpdf-c qpdf_next_warning returned warning 0 +qpdf-c called qpdf_set_suppress_warnings 0 +qpdf-c called qpdf_set_ignore_xref_streams 0 +qpdf-c called qpdf_set_attempt_recovery 0 +qpdf-c called qpdf_read 3 +qpdf-c called qpdf_get_pdf_version 0 +qpdf-c called qpdf_get_user_password 0 +qpdf-c called qpdf_is_linearized 0 +qpdf-c called qpdf_is_encrypted 0 +qpdf-c called qpdf_init_write 3 +qpdf-c called qpdf_set_object_stream_mode 0 +qpdf-c called qpdf_set_stream_data_mode 0 +qpdf-c called qpdf_set_content_normalization 0 +qpdf-c called qpdf_set_qdf_mode 0 +qpdf-c called qpdf_set_static_ID 0 +qpdf-c called qpdf_set_suppress_original_object_IDs 0 +qpdf-c called qpdf_set_preserve_encryption 0 +qpdf-c called qpdf_set_r2_encryption_parameters 0 +qpdf-c called qpdf_set_r3_encryption_parameters 0 +qpdf-c called qpdf_set_linearization 0 +qpdf-c called qpdf_write 3 +qpdf-c called qpdf_allow_accessibility 0 +qpdf-c called qpdf_allow_extract_all 0 +qpdf-c called qpdf_allow_print_low_res 0 +qpdf-c called qpdf_allow_print_high_res 0 +qpdf-c called qpdf_allow_modify_assembly 0 +qpdf-c called qpdf_allow_modify_form 0 +qpdf-c called qpdf_allow_modify_annotation 0 +qpdf-c called qpdf_allow_modify_other 0 +qpdf-c called qpdf_allow_modify_all 0 +QPDFWriter increasing minimum version 0 +QPDFWriter using forced PDF version 0 +qpdf-c called qpdf_set_minimum_pdf_version 0 +qpdf-c called qpdf_force_pdf_version 0 +qpdf-c called qpdf_init_write multiple times 0 +QPDF_encryption rc4 decode string 0 +QPDF_encryption rc4 decode stream 0 +QPDFWriter not compressing metadata 0 +QPDF_encryption CFM V2 0 +QPDF_encryption CFM AESV2 0 +QPDF_encryption aes decode string 0 +QPDF_encryption cleartext metadata 0 +QPDF_encryption aes decode stream 0 +QPDFWriter forcing object stream disable 0 +QPDFWriter forced version disabled encryption 0 +qpdf-c called qpdf_set_r4_encryption_parameters 0 +qpdf-c called qpdf_set_static_aes_IV 0 +QPDF_encryption stream crypt filter 0 +QPDF ERR object stream with wrong type 0 +QPDF object gone after xref reconstruction 0 +qpdf-c called qpdf_has_error 0 +qpdf-c called qpdf_get_qpdf_version 0 +QPDF_Stream pipe original stream data 0 +QPDF_Stream pipe replaced stream data 0 +QPDF_Stream pipe use stream provider 0 +QPDF_Stream provider length mismatch 0 +QPDFObjectHandle newStream 0 +QPDFObjectHandle newStream with data 0 +QPDF_Stream pipe no stream data 0 +QPDFObjectHandle prepend page contents 0 +QPDFObjectHandle append page contents 0 +QPDF_Stream getRawStreamData 0 +QPDF_Stream getStreamData 0 +QPDF_Stream expand filter abbreviation 0 +qpdf-c called qpdf_read_memory 0 +Pl_QPDFTokenizer found EI 0 +QPDF stream without newline 0 +QPDF stream with CR only 0 +QPDF stream with CRNL 0 +QPDF stream with NL only 0 +QPDF replaceObject called with indirect object 0 +QPDFWriter copy encrypt metadata 1 +qpdf-c get_info_key 1 +qpdf-c set_info_key to value 0 +qpdf-c set_info_key to null 0 +qpdf-c set-info-key use existing info 0 +qpdf-c add info to trailer 0 +qpdf-c called qpdf_init_write_memory 0 +exercise processFile(name) 0 +exercise processFile(FILE*) 0 +exercise processMemoryFile 0 +QPDF duplicate page reference 0 +QPDF remove page 2 +QPDF insert page 2 +QPDF updateAllPagesCache 0 +QPDF insert non-indirect page 0 +QPDF insert indirect page 0 +QPDFObjectHandle ERR shallow copy stream 0 +QPDFObjectHandle shallow copy array 0 +QPDFObjectHandle shallow copy dictionary 0 +QPDFObjectHandle shallow copy scalar 0 +QPDFObjectHandle newStream with string 0 +QPDF unknown key not inherited 0 +QPDF_Stream provider length not provided 0 +QPDF_Stream unknown stream length 0 +QPDF replaceReserved 0 +QPDF copyForeign direct 0 +QPDF copyForeign not foreign 0 +QPDF copy indirect 0 +QPDF loop reserving objects 0 +QPDF replace indirect 0 +QPDF replace array 0 +QPDF replace dictionary 0 +QPDF replace stream 0 +QPDF reserve array 0 +QPDF reserve dictionary 0 +QPDF reserve stream 0 +QPDF not crossing page boundary 0 +QPDF replace foreign indirect with null 0 +QPDF not copying pages object 0 +QPDF insert foreign page 0 +QPDFWriter foreign object 0 +QPDFWriter copy use_aes 1 +QPDFObjectHandle indirect without context 0 +QPDFObjectHandle trailing data in parse 0 +qpdf pages encryption password 0 +QPDF_Tokenizer EOF reading token 0 +QPDF_Tokenizer EOF reading appendable token 0 +QPDFWriter extra header text no newline 0 +QPDFWriter extra header text add newline 0 diff --git a/qpdf/qtest/qpdf.test b/qpdf/qtest/qpdf.test new file mode 100644 index 0000000..d12f064 --- /dev/null +++ b/qpdf/qtest/qpdf.test @@ -0,0 +1,1922 @@ +#!/usr/bin/env perl +require 5.008; +BEGIN { $^W = 1; } +use strict; +use File::Copy; +use File::Basename; +use Cwd; +use Digest::MD5; + +chdir("qpdf") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +cleanup(); + +my $td = new TestDriver('qpdf'); + +my $compare_images = 1; +if ((exists $ENV{'QPDF_SKIP_TEST_COMPARE_IMAGES'}) && + ($ENV{'QPDF_SKIP_TEST_COMPARE_IMAGES'} eq '1')) +{ + $compare_images = 0; +} +my $large_file_test_path = $ENV{'QPDF_LARGE_FILE_TEST_PATH'} || undef; + +my $have_acroread = 0; + +if ($compare_images) +{ + # check for working acroread + if (system("acroread -toPostScript -pairs good1.pdf a.ps" . + " >/dev/null 2>&1") == 0) + { + $have_acroread = 1; + } +} + +# These variables are used to store the total number of tests in the +# test suite. NOTE: qtest's requirement to indicate the number of +# tests serves as a check that the test suite is operating properly. +# Do not calculate these values as a side effect of running the tests. +# That defeats the purpose. However, since this test suite consists +# of several separate series of tests, many of which iterate over +# static lists of things, we calculate the numbers as we go in terms +# of static values. + +# This should be set to the number of times we called compare_pdfs. +# This has to be kept separate because the number of test cases +# compare_pdfs generates depends on the value of $compare_images. +my $n_compare_pdfs = 0; + +# This should be set to the number of times we call acroread. +my $n_acroread = 0; + +# Each section of tests should increment this number by the number of +# tests they generate excluding calls to acroread or compare_pdfs, +# which are tracked separately by $n_compare_pdfs and $n_acroread. +my $n_tests = 0; + +# Call show_ntests after each block of test cases. In show_ntests, +# you can turn on printing of the expected number of test cases. This +# is useful for tracking down problems in the number of test cases. + +show_ntests(); +# ---------- + +$n_compare_pdfs += 5; + +# Check compare_pdfs to make sure that it works properly. Each call +# to compare_pdfs is worth three test cases. +compare_pdfs("p1-a-p2-b.pdf", "p1-a-p2-b.pdf"); +compare_pdfs("p1-a.pdf", "p1-a.pdf"); +compare_pdfs("p1-a.pdf", "p1-b.pdf", 1); +compare_pdfs("p1-a.pdf", "p1-a-p2-b.pdf", 1); +compare_pdfs("p1-a-p2-a.pdf", "p1-a-p2-b.pdf", 1); +flush_tiff_cache(); + +show_ntests(); +# ---------- +$td->notify("--- Stream Replacement Tests ---"); +$n_tests += 8; + +$td->runtest("replace stream data", + {$td->COMMAND => "test_driver 7 qstream.pdf"}, + {$td->STRING => "test 7 done\n", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "replaced-stream-data.pdf"}); +$td->runtest("replace stream data compressed", + {$td->COMMAND => "test_driver 8 qstream.pdf"}, + {$td->FILE => "test8.out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "replaced-stream-data-flate.pdf"}); +$td->runtest("new streams", + {$td->COMMAND => "test_driver 9 minimal.pdf"}, + {$td->FILE => "test9.out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("new stream", + {$td->FILE => "a.pdf"}, + {$td->FILE => "new-streams.pdf"}); +$td->runtest("add page contents", + {$td->COMMAND => "test_driver 10 minimal.pdf"}, + {$td->STRING => "test 10 done\n", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("new stream", + {$td->FILE => "a.pdf"}, + {$td->FILE => "add-contents.pdf"}); + +show_ntests(); +# ---------- +$td->notify("--- Page API Tests ---"); +$n_tests += 9; + +$td->runtest("basic page API", + {$td->COMMAND => "test_driver 15 page_api_1.pdf"}, + {$td->STRING => "test 15 done\n", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "page_api_1-out.pdf"}); +$td->runtest("manual page manipulation", + {$td->COMMAND => "test_driver 16 page_api_1.pdf"}, + {$td->STRING => "test 16 done\n", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "page_api_1-out2.pdf"}); +$td->runtest("duplicate page", + {$td->COMMAND => "test_driver 17 page_api_2.pdf"}, + {$td->FILE => "page_api_2.out", $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); +$td->runtest("delete and re-add a page", + {$td->COMMAND => "test_driver 18 page_api_1.pdf"}, + {$td->STRING => "test 18 done\n", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "page_api_1-out3.pdf"}); +$td->runtest("duplicate page", + {$td->COMMAND => "test_driver 19 page_api_1.pdf"}, + {$td->FILE => "page_api_1.out", $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); +$td->runtest("remove page we don't have", + {$td->COMMAND => "test_driver 22 page_api_1.pdf"}, + {$td->FILE => "page_api_1.out2", $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); +# ---------- +$td->notify("--- Miscellaneous Tests ---"); +$n_tests += 53; + +$td->runtest("qpdf version", + {$td->COMMAND => "qpdf --version"}, + {$td->REGEXP => "qpdf version \\S+\n.*", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("C API: qpdf version", + {$td->COMMAND => "qpdf-ctest --version"}, + {$td->REGEXP => "qpdf-ctest version \\S+\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +foreach (my $i = 1; $i <= 3; ++$i) +{ + $td->runtest("misc tests", + {$td->COMMAND => "test_driver 5 misc-$i.pdf"}, + {$td->FILE => "misc-$i.out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +} + +$td->runtest("get stream data", + {$td->COMMAND => "test_driver 11 stream-data.pdf"}, + {$td->FILE => "test11.out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +# Make sure we ignore decode parameters that we don't understand +$td->runtest("unknown decode parameters", + {$td->COMMAND => "qpdf --check fax-decode-parms.pdf"}, + {$td->FILE => "fax-decode-parms.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +# Handle xref stream with more entries than reported (bug 2872265) +$td->runtest("xref with short size", + {$td->COMMAND => "qpdf --show-xref xref-with-short-size.pdf"}, + {$td->FILE => "xref-with-short-size.out", + $td->EXIT_STATUS => 3}, + $td->NORMALIZE_NEWLINES); +$td->runtest("recover xref with short size", + {$td->COMMAND => "qpdf xref-with-short-size.pdf a.pdf"}, + {$td->FILE => "xref-with-short-size-recover.out", + $td->EXIT_STATUS => 3}, + $td->NORMALIZE_NEWLINES); +$td->runtest("show new xref stream", + {$td->COMMAND => "qpdf --show-xref a.pdf"}, + {$td->FILE => "xref-with-short-size-new.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +# Handle file with object stream containing an unreferenced object +# that in turn contains an indirect scalar (bug 2974522). +$td->runtest("unreferenced indirect scalar", + {$td->COMMAND => + "qpdf --qdf --static-id --object-streams=preserve" . + " unreferenced-indirect-scalar.pdf a.qdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.qdf"}, + {$td->FILE => "unreferenced-indirect-scalar.out"}); + +# Encrypt files whose /ID strings are other than 32 bytes long (bug +# 2991412). +foreach my $file (qw(short-id long-id)) +{ + $td->runtest("encrypt $file.pdf", + {$td->COMMAND => + "qpdf --encrypt '' pass 40 -- $file.pdf a.pdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + + $td->runtest("check $file.pdf", + {$td->COMMAND => "qpdf --check a.pdf"}, + {$td->FILE => "$file-check.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +} + +# Handle file with invalid xref table and object 0 as a regular object +# (bug 3159950). +$td->runtest("check obj0.pdf", + {$td->COMMAND => "qpdf --check obj0.pdf"}, + {$td->FILE => "obj0-check.out", + $td->EXIT_STATUS => 3}, + $td->NORMALIZE_NEWLINES); + +# Min/Force version +$td->runtest("set min version", + {$td->COMMAND => "qpdf --min-version=1.6 good1.pdf a.pdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check version", + {$td->COMMAND => "qpdf --check a.pdf"}, + {$td->FILE => "min-version.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("force version", + {$td->COMMAND => "qpdf --force-version=1.4 a.pdf b.pdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check version", + {$td->COMMAND => "qpdf --check b.pdf"}, + {$td->FILE => "forced-version.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +unlink "a.pdf", "b.pdf" or die; +$td->runtest("C API: min/force versions", + {$td->COMMAND => "qpdf-ctest 14 object-stream.pdf '' a.pdf b.pdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("C check version 1", + {$td->COMMAND => "qpdf --check a.pdf"}, + {$td->FILE => "min-version.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("C check version 2", + {$td->COMMAND => "qpdf --check b.pdf"}, + {$td->FILE => "forced-version.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +# Stream filter abbreviations from table H.1 +$td->runtest("stream filter abbreviations", + {$td->COMMAND => "qpdf --static-id filter-abbreviation.pdf a.pdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "filter-abbreviation.out"}); + +$td->runtest("empty object", + {$td->COMMAND => "qpdf -show-object=7,0 empty-object.pdf"}, + {$td->FILE => "empty-object.out", + $td->EXIT_STATUS => 3}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("error/output redirection to null", + {$td->COMMAND => "test_driver 12 linearized-and-warnings.pdf"}, + {$td->FILE => "linearized-and-warnings-1.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("error/output redirection to strings", + {$td->COMMAND => "test_driver 13 linearized-and-warnings.pdf"}, + {$td->FILE => "linearized-and-warnings-2.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("odd terminators for stream keyword", + {$td->COMMAND => + "qpdf --qdf --static-id" . + " stream-line-enders.pdf a.qdf"}, + {$td->FILE => "stream-line-enders.out", + $td->EXIT_STATUS => 3}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.qdf"}, + {$td->FILE => "stream-line-enders.qdf"}); + +$td->runtest("swap and replace", + {$td->COMMAND => "test_driver 14 test14-in.pdf"}, + {$td->FILE => "test14.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "test14-out.pdf"}); +# Test 14 also exercises writing to memory without static ID. +$td->runtest("check non-static ID version", + {$td->COMMAND => "./diff-ignore-ID-version a.pdf b.pdf"}, + {$td->STRING => "okay\n", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("C API info key functions", + {$td->COMMAND => "qpdf-ctest 16 minimal.pdf '' a.pdf"}, + {$td->FILE => "c-info1.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "c-info-out.pdf"}); +unlink "a.pdf" or die; + +$td->runtest("C API info key functions", + {$td->COMMAND => "qpdf-ctest 16 c-info2-in.pdf '' a.pdf"}, + {$td->FILE => "c-info2.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "c-info-out.pdf"}); +unlink "a.pdf" or die; + +$td->runtest("shallow copy an array", + {$td->COMMAND => "test_driver 20 shallow_array.pdf"}, + {$td->STRING => "test 20 done\n", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "shallow_array-out.pdf"}); +$td->runtest("shallow copy a stream", + {$td->COMMAND => "test_driver 21 shallow_array.pdf"}, + {$td->FILE => "shallow_stream.out", $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); +$td->runtest("warn for unknown key in Pages", + {$td->COMMAND => "test_driver 23 lin-special.pdf"}, + {$td->FILE => "pages-warning.out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("reserved objects", + {$td->COMMAND => "test_driver 24 minimal.pdf"}, + {$td->FILE => "reserved-objects.out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "reserved-objects.pdf"}); +$td->runtest("detect foreign object in write", + {$td->COMMAND => "test_driver 29" . + " copy-foreign-objects-in.pdf minimal.pdf"}, + {$td->FILE => "foreign-in-write.out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("parse objects from string", + {$td->COMMAND => "test_driver 31 minimal.pdf"}, # file not used + {$td->FILE => "parse-object.out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("EOF terminating literal tokens", + {$td->COMMAND => "qpdf --check eof-terminates-literal.pdf"}, + {$td->FILE => "eof-terminates-literal.out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("EOF reading token", + {$td->COMMAND => "qpdf --check eof-reading-token.pdf"}, + {$td->FILE => "eof-reading-token.out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("extra header text", + {$td->COMMAND => "test_driver 32 minimal.pdf"}, + {$td->FILE => "test-32.out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "extra-header-no-newline.pdf"}); +$td->runtest("check output", + {$td->FILE => "b.pdf"}, + {$td->FILE => "extra-header-lin-no-newline.pdf"}); +$td->runtest("check output", + {$td->FILE => "c.pdf"}, + {$td->FILE => "extra-header-newline.pdf"}); +$td->runtest("check output", + {$td->FILE => "d.pdf"}, + {$td->FILE => "extra-header-lin-newline.pdf"}); + +show_ntests(); +# ---------- +$td->notify("--- Numeric range parsing tests ---"); +my @nrange_tests = ( + [",5", + "qpdf: error at * in numeric range *,5: unexpected separator", + 2], + ["4,,5", + "qpdf: error at * in numeric range 4,*,5: unexpected separator", + 2], + ["4,5,", + "qpdf: error at * in numeric range 4,5,*: number expected", + 2], + ["z1,", + "qpdf: error at * in numeric range z*1,: digit not expected", + 2], + ["1z,", + "qpdf: error at * in numeric range 1*z,: z not expected", + 2], + ["1-5?", + "qpdf: error at * in numeric range 1-5*?: unexpected character", + 2], + ["1-30", + "qpdf: error in numeric range 1-30: number 30 out of range", + 2], + ["1-10,0,5", + "qpdf: error in numeric range 1-10,0,5: number 0 out of range", + 2], + ["1-10,1234,5", + "qpdf: error in numeric range 1-10,1234,5: number 1234 out of range", + 2], + ["1,3,5-10,z-13,13,9,z,2", + "numeric range 1,3,5-10,z-13,13,9,z,2" . + " -> 1 3 5 6 7 8 9 10 15 14 13 13 9 15 2", + 0], + ); +$n_tests += scalar(@nrange_tests); +foreach my $d (@nrange_tests) +{ + my ($range, $output, $status) = @$d; + $td->runtest("numeric range $range", + {$td->COMMAND => ['qpdf', '-- test-numrange=' . $range], + $td->FILTER => "grep 'numeric range'"}, + {$td->STRING => $output . "\n", $td->EXIT_STATUS => $status}, + $td->NORMALIZE_NEWLINES); +} + +# ---------- +$td->notify("--- Merging and Splitting ---"); +$n_tests += 6; + +# Select pages from the same file multiple times including selecting +# twice from an encrypted file and specifying the password only the +# first time. The file 20-pages.pdf is specified with two different +# paths to duplicate a page. +my $pages_options = "--pages page-labels-and-outlines.pdf 1,3,5-7,z" . + " 20-pages.pdf --password=user z-15" . + " page-labels-and-outlines.pdf 12" . + " 20-pages.pdf 10" . + " ./20-pages.pdf --password=owner 10" . + " minimal.pdf 1 --"; + +$td->runtest("merge three files", + {$td->COMMAND => "qpdf page-labels-and-outlines.pdf a.pdf" . + " $pages_options --static-id"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); +# Manually verified about this file: make sure that outline entries +# that pointed to pages that were preserved still work in the copy, +# and verify that all pages are as expected. page-labels-and-outlines +# as well as 20-pages have text on page n (from 1) that shows its page +# position from 0, so page 1 says it's page 0. +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "merge-three-files-1.pdf"}); +# Select the same pages but add them to an empty file +$td->runtest("merge three files", + {$td->COMMAND => "qpdf --empty a.pdf" . + " $pages_options --static-id"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); +# Manually verified about this file: it has the same pages but does +# not contain outlines, page labels, or other things from the original +# file. +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "merge-three-files-2.pdf"}); +$td->runtest("avoid respecification of password", + {$td->COMMAND => + "qpdf --empty a.pdf --copy-encryption=20-pages.pdf" . + " --encryption-file-password=user" . + " --pages 20-pages.pdf 1,z -- --static-id"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "pages-copy-encryption.pdf"}); +# ---------- +$td->notify("--- PDF From Scratch ---"); +$n_tests += 2; + +$td->runtest("basic qpdf from scratch", + {$td->COMMAND => "pdf_from_scratch 0"}, + {$td->STRING => "test 0 done\n", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "from-scratch-0.pdf"}); +# ---------- +$td->notify("--- Copy Foreign Objects ---"); +$n_tests += 7; + +foreach my $d ([25, 1], [26, 2], [27, 3]) +{ + my ($testn, $outn) = @$d; + $td->runtest("copy objects $outn", + {$td->COMMAND => "test_driver $testn" . + " copy-foreign-objects-in.pdf minimal.pdf"}, + {$td->STRING => "test $testn done\n", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + $td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "copy-foreign-objects-out$outn.pdf"}); +} +$td->runtest("copy objects error", + {$td->COMMAND => "test_driver 28" . + " copy-foreign-objects-in.pdf minimal.pdf"}, + {$td->FILE => "copy-foreign-objects-errors.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +# ---------- +$td->notify("--- Error Condition Tests ---"); +# $n_tests incremented after initialization of badfiles below. + +my @badfiles = ("not a PDF file", # 1 + "no startxref", # 2 + "bad primary xref offset", # 3 + "invalid xref syntax", # 4 + "invalid xref entry", # 5 + "free table inconsistency", # 6 + "no trailer dictionary", # 7 + "bad secondary xref", # 8 + "no /Size in trailer", # 9 + "/Size not integer", # 10 + "/Prev not integer", # 11 + "/Size inconsistency", # 12 + "bad {", # 13 + "bad }", # 14 + "bad ]", # 15 + "bad >>", # 16 + "odd number of dictionary items", # 17 + "bad )", # 18 + "bad >", # 19 + "invalid hexstring character", # 20 + "invalid name token", # 21 + "no /Length for stream dictionary", # 22 + "/Length not integer", # 23 + "expected endstream", # 24 + "bad obj declaration (objid)", # 25 + "bad obj declaration (generation)", # 26 + "bad obj declaration (obj)", # 27 + "expected endobj", # 28 + "null in name", # 29 + "invalid stream /Filter", # 30 + "unknown stream /Filter", # 31 + "obj/gen mismatch", # 32 + "invalid stream /Filter and xref", # 33 + "obj/gen in wrong place", # 34 + "object stream of wrong type", # 35 + ); + +$n_tests += @badfiles + 5; + +# Test 6 contains errors in the free table consistency, but we no +# longer have any consistency check for this since it is not important +# neither Acrobat nor other PDF viewers really care. Tests 12 and 28 +# have error conditions that used to be fatal but are now considered +# non-fatal. +my %badtest_overrides = (6 => 0, 12 => 0, 28 => 0, 31 => 0); +for (my $i = 1; $i <= scalar(@badfiles); ++$i) +{ + my $status = $badtest_overrides{$i}; + $status = 2 unless defined $status; + $td->runtest($badfiles[$i-1], + {$td->COMMAND => "test_driver 0 bad$i.pdf"}, + {$td->FILE => "bad$i.out", + $td->EXIT_STATUS => $status}, + $td->NORMALIZE_NEWLINES); +} + +$td->runtest("C API: errors", + {$td->COMMAND => "qpdf-ctest 2 bad1.pdf '' a.pdf"}, + {$td->FILE => "c-read-errors.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("C API: warnings and errors", + {$td->COMMAND => "qpdf-ctest 2 bad17.pdf '' a.pdf"}, + {$td->FILE => "c-read-warnings-and-errors.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("C API: errors writing", + {$td->COMMAND => "qpdf-ctest 2 bad30.pdf '' a.pdf"}, + {$td->FILE => "c-write-errors.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("C API: errors and warnings writing", + {$td->COMMAND => "qpdf-ctest 2 bad33.pdf '' a.pdf"}, + {$td->FILE => "c-write-warnings-and-errors.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("C API: no recovery", + {$td->COMMAND => "qpdf-ctest 10 bad33.pdf '' a.pdf"}, + {$td->FILE => "c-no-recovery.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +show_ntests(); +# ---------- +$td->notify("--- Recovery Tests ---"); +$n_tests += @badfiles + 8; + +# Recovery tests. These are mostly after-the-fact -- when recovery +# was implemented, some degree of recovery was possible on many of the +# files. Mostly the recovery does not actually repair the error, +# though in some cases it may. Acrobat Reader would not be able to +# recover any of these files any better. +my %recover_failures = (); +for (1, 7, 13..21, 24, 29..30, 33, 35) +{ + $recover_failures{$_} = 1; +} +for (my $i = 1; $i <= scalar(@badfiles); ++$i) +{ + my $status = 0; + if (exists $recover_failures{$i}) + { + $status = 2; + } + $td->runtest("recover " . $badfiles[$i-1], + {$td->COMMAND => "test_driver 1 bad$i.pdf"}, + {$td->FILE => "bad$i-recover.out", + $td->EXIT_STATUS => $status}, + $td->NORMALIZE_NEWLINES); +} + +# This heifer file was a real file that contained errors that Acrobat +# Reader can recover. We can recover it too. +$td->runtest("recover heifer file", + {$td->COMMAND => "qpdf --static-id --no-original-object-ids" . + " -qdf heifer.pdf a.pdf"}, + {$td->FILE => "heifer.out", + $td->EXIT_STATUS => 3}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "heifer.qdf"}); + +# See if we can recover the cross reference table on a file that has +# been appended to even when it deletes and reuses objects. We can't +# completely do it in the case of deleted objects, but we can get +# mostly there. +$td->runtest("good replaced page contents", + {$td->COMMAND => + "qpdf --static-id -qdf --no-original-object-ids" . + " append-page-content.pdf a.pdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "append-page-content-good.qdf"}); +$td->runtest("damaged replaced page contents", + {$td->COMMAND => + "qpdf --static-id -qdf --no-original-object-ids" . + " append-page-content-damaged.pdf a.pdf"}, + {$td->FILE => "append-page-content-damaged.out", + $td->EXIT_STATUS => 3}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "append-page-content-damaged.qdf"}); +$td->runtest("run check on damaged file", + {$td->COMMAND => "qpdf --check append-page-content-damaged.pdf"}, + {$td->FILE => "append-page-content-damaged-check.out", + $td->EXIT_STATUS => 3}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check with C API", + {$td->COMMAND => + "qpdf-ctest 1 append-page-content-damaged.pdf '' ''"}, + {$td->FILE => "append-page-content-damaged-c-check.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +show_ntests(); +# ---------- +$td->notify("--- Basic Parsing Tests ---"); +# $n_tests incremented below after initialization of @goodfiles. + +my @goodfiles = ("implicit null", # 1 + "direct null", # 2 + "unresolved null", # 3 + "indirect null", # 4 + "indirect bool, real", # 5 + "direct bool", # 6 + "integer", # 7 + "real, ASCIIHexDecode", # 8 + "string", # 9 + "array", # 10 + "dictionary", # 11 + "stream", # 12 + "nesting, strings, names", # 13 + "tokenizing pipeline", # 14 + "name", # 15 + "object-stream", # 16 + "hybrid xref", # 17 + "hybrid xref old mode", # 18 + "xref with prev", # 19 + "lots of compressible objects", # 20 + ); + +$n_tests += (3 * @goodfiles) + 6; + +my %goodtest_overrides = ('14' => 3); +my %goodtest_flags = + ('18' => '-ignore-xref-streams', + '20' => '-object-streams=generate', + ); +for (my $i = 1; $i <= scalar(@goodfiles); ++$i) +{ + my $n = $goodtest_overrides{$i} || 1; + $td->runtest("$goodfiles[$i-1]", + {$td->COMMAND => "test_driver $n good$i.pdf"}, + {$td->FILE => "good$i.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + my $xflags = $goodtest_flags{$i} || ''; + check_pdf("create qdf", + "qpdf --static-id -qdf $xflags good$i.pdf", + "good$i.qdf", 0); +} + +check_pdf("no normalization", + "qpdf -qdf --static-id --normalize-content=n good7.pdf", + "good7-not-normalized.qdf", + 0); + +check_pdf("no qdf", + "qpdf --static-id good17.pdf", + "good17-not-qdf.pdf", + 0); + +check_pdf("no recompression", + "qpdf --static-id --stream-data=preserve good17.pdf", + "good17-not-recompressed.pdf", + 0); + +show_ntests(); +# ---------- +$td->notify("--- C API Tests ---"); + +my @capi = ( + [2, 'no options'], + [3, 'normalized content'], + [4, 'ignore xref streams'], + [5, 'linearized'], + [6, 'object streams'], + [7, 'qdf'], + [8, 'no original object ids'], + [9, 'uncompressed streams'], + ); +$n_tests += (2 * @capi) + 3; +foreach my $d (@capi) +{ + my ($n, $description) = @$d; + my $outfile = $description; + $outfile =~ s/ /-/g; + $outfile = "c-$outfile.pdf"; + $td->runtest($description, + {$td->COMMAND => "qpdf-ctest $n hybrid-xref.pdf '' a.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); + $td->runtest("check $description", + {$td->FILE => "a.pdf"}, + {$td->FILE => $outfile}); +} +$td->runtest("write to bad file name", + {$td->COMMAND => "qpdf-ctest 2 hybrid-xref.pdf '' /:a:/:b:"}, + {$td->REGEXP => "error: open /:a:/:b:: .*", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("write damaged to bad file name", + {$td->COMMAND => "qpdf-ctest 2 append-page-content-damaged.pdf" . + " '' /:a:/:b:"}, + {$td->REGEXP => + "warning:(?s:.*)\n" . + "error: open /:a:/:b:: .*", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("write damaged", + {$td->COMMAND => "qpdf-ctest 2 append-page-content-damaged.pdf" . + " '' a.pdf"}, + {$td->FILE => "c-write-damaged.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +show_ntests(); +# ---------- +$td->notify("--- Object Stream Tests ---"); +$n_tests += (36 * 4) + (12 * 2); +$n_compare_pdfs += 36; + +for (my $n = 16; $n <= 19; ++$n) +{ + my $in = "good$n.pdf"; + foreach my $flags ('-object-streams=disable', + '-object-streams=preserve', + '-object-streams=generate') + { + foreach my $qdf ('-qdf', '', '-encrypt "" x 128 --') + { + # 4 tests + 1 compare_pdfs * 36 cases + # 2 additional tests * 12 cases + $td->runtest("object stream mode", + {$td->COMMAND => + "qpdf --static-id $flags $qdf $in a.pdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); + compare_pdfs("good$n.pdf", "a.pdf"); + if ($qdf eq '-qdf') + { + $td->runtest("fix-qdf identity check", + {$td->COMMAND => "fix-qdf a.pdf >| b.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); + $td->runtest("compare files", + {$td->FILE => "a.pdf"}, + {$td->FILE => "b.pdf"}); + } + $td->runtest("convert to qdf", + {$td->COMMAND => + "qpdf --static-id --no-original-object-ids" . + " -qdf -decrypt" . + " -object-streams=disable $in a.qdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); + $td->runtest("convert output to qdf", + {$td->COMMAND => + "qpdf --static-id --no-original-object-ids" . + " -qdf -object-streams=disable a.pdf b.qdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); + $td->runtest("compare files", + {$td->FILE => "a.qdf"}, + {$td->FILE => "b.qdf"}); + } + } + flush_tiff_cache(); +} + +show_ntests(); +# ---------- +$td->notify("--- Specific File Tests ---"); +$n_tests += 4; +$n_compare_pdfs += 1; + +# Special PDF files that caused problems at some point + +# This file is a PDF 1.1 file with /# as a name and with +# inconsistencies in its free table. It also has LZW streams that +# happen to test boundary conditions in the LZW decoder. +$td->runtest("old and complex", + {$td->COMMAND => "qpdf --check old-and-complex.pdf"}, + {$td->FILE => "old-and-complex-check.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("old and complex (C API)", + {$td->COMMAND => "qpdf-ctest 1 old-and-complex.pdf '' ''"}, + {$td->FILE => "old-and-complex-c-check.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("convert to qdf", + {$td->COMMAND => "qpdf --qdf old-and-complex.pdf a.qdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); + +compare_pdfs("old-and-complex.pdf", "a.qdf"); + +$td->runtest("damaged stream", + {$td->COMMAND => "qpdf --check damaged-stream.pdf"}, + {$td->FILE => "damaged-stream.out", $td->EXIT_STATUS => 3}, + $td->NORMALIZE_NEWLINES); + +show_ntests(); +# ---------- +$td->notify("--- Mutability Tests ---"); +$n_tests += 4; + +$td->runtest("no normalization", + {$td->COMMAND => "test_driver 4 test4-1.pdf"}, + {$td->FILE => "test4-1.qdf", + $td->EXIT_STATUS => 0}); + +$td->runtest("object ordering", + {$td->COMMAND => "test_driver 4 test4-4.pdf"}, + {$td->FILE => "test4-4.qdf", + $td->EXIT_STATUS => 0}); + +$td->runtest("loop detected", + {$td->COMMAND => "test_driver 4 test4-2.pdf"}, + {$td->FILE => "test4-2.out", + $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("stream detected", + {$td->COMMAND => "test_driver 4 test4-3.pdf"}, + {$td->FILE => "test4-3.out", + $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); + +show_ntests(); +# ---------- +$td->notify("--- Extraction Tests ---"); +$n_tests += 11; + +$td->runtest("show xref", + {$td->COMMAND => "qpdf encrypted-with-images.pdf" . + " --show-xref"}, + {$td->FILE => "show-xref.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("show pages", + {$td->COMMAND => "qpdf encrypted-with-images.pdf" . + " --show-pages"}, + {$td->FILE => "show-pages.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("show-pages-images", + {$td->COMMAND => "qpdf encrypted-with-images.pdf" . + " --show-pages --with-images"}, + {$td->FILE => "show-pages-images.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("show-page-1", + {$td->COMMAND => "qpdf encrypted-with-images.pdf" . + " --show-object=5,0"}, + {$td->FILE => "show-page-1.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("show-page-1-content-raw", + {$td->COMMAND => "qpdf encrypted-with-images.pdf" . + " --show-object=7 --raw-stream-data"}, + {$td->FILE => "show-page-1-content-raw.out", + $td->EXIT_STATUS => 0}); + +$td->runtest("show-page-1-content-filtered", + {$td->COMMAND => "qpdf encrypted-with-images.pdf" . + " --show-object=7 --filtered-stream-data"}, + {$td->FILE => "show-page-1-content-filtered.out", + $td->EXIT_STATUS => 0}); + +$td->runtest("show-page-1-content-normalized", + {$td->COMMAND => "qpdf encrypted-with-images.pdf" . + " --show-object=7,0 --filtered-stream-data --normalize-content=y"}, + {$td->FILE => "show-page-1-content-normalized.out", + $td->EXIT_STATUS => 0}); + +$td->runtest("show-page-1-image", + {$td->COMMAND => "qpdf encrypted-with-images.pdf" . + " --show-object=8 --raw-stream-data"}, + {$td->FILE => "show-page-1-image.out", + $td->EXIT_STATUS => 0}); + +$td->runtest("unfilterable stream data", + {$td->COMMAND => "qpdf encrypted-with-images.pdf" . + " --show-object=8 --filtered-stream-data"}, + {$td->FILE => "show-unfilterable.out", + $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("show-xref-by-id", + {$td->COMMAND => "qpdf encrypted-with-images.pdf" . + " --show-object=12"}, + {$td->FILE => "show-xref-by-id.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("show-xref-by-id-filtered", + {$td->COMMAND => "qpdf encrypted-with-images.pdf" . + " --show-object=12 --filtered-stream-data"}, + {$td->FILE => "show-xref-by-id-filtered.out", + $td->EXIT_STATUS => 0}); + +show_ntests(); +# ---------- +$td->notify("--- Clear-text Metadata Tests ---"); +$n_tests += 58; + +# args: file, exp_encrypted, exp_cleartext +check_metadata("compressed-metadata.pdf", 0, 0); +check_metadata("enc-base.pdf", 0, 1); + +foreach my $f (qw(compressed-metadata.pdf enc-base.pdf)) +{ + foreach my $w (qw(compress preserve)) + { + $td->runtest("$w streams", + {$td->COMMAND => "qpdf --stream-data=$w $f a.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); + check_metadata("a.pdf", 0, 1); + $td->runtest("encrypt normally", + {$td->COMMAND => + "qpdf --encrypt '' '' 128 -- a.pdf b.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); + check_metadata("b.pdf", 1, 0); + unlink "b.pdf"; + $td->runtest("encrypt V4", + {$td->COMMAND => + "qpdf --encrypt '' '' 128 --force-V4 -- a.pdf b.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); + check_metadata("b.pdf", 1, 0); + unlink "b.pdf"; + $td->runtest("encrypt with cleartext metadata", + {$td->COMMAND => + "qpdf --encrypt '' '' 128 --cleartext-metadata --" . + " a.pdf b.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); + check_metadata("b.pdf", 1, 1); + $td->runtest("preserve encryption", + {$td->COMMAND => "qpdf b.pdf c.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); + check_metadata("c.pdf", 1, 1); + unlink "b.pdf", "c.pdf"; + $td->runtest("encrypt with aes and cleartext metadata", + {$td->COMMAND => + "qpdf --encrypt '' '' 128" . + " --cleartext-metadata --use-aes=y -- a.pdf b.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); + check_metadata("b.pdf", 1, 1); + $td->runtest("preserve encryption", + {$td->COMMAND => "qpdf b.pdf c.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); + check_metadata("c.pdf", 1, 1); + unlink "b.pdf", "c.pdf"; + } +} + +show_ntests(); +# ---------- +$td->notify("--- Linearization Tests ---"); +# $n_tests incremented after initialization of @linearized_files and +# @to_linearize. + +# *'ed files were linearized with Pdlin. +my @linearized_files = + ('lin0', # not linearized + 'lin1', # * outlines, page labels, pdlin + 'lin2', # * lin1 with null and newline + 'lin3', # same file saved with acrobat + 'lin4', # * lin1 with no /PageMode + 'lin5', # lin3 with embedded thumbnails + 'lin6', # * lin5 with pdlin + 'lin7', # lin5 with /PageMode /UseThumbs + 'lin8', # * lin7 with pdlin + 'lin9', # * shared objects, indirect null + 'badlin1', # parameter dictionary errors + ); + +my @to_linearize = + ('lin-special', # lots of weird cases -- see file comments + 'delete-and-reuse', # deleted, reused objects + 'lin-delete-and-reuse', # linearized, then delete and reuse + 'object-stream', # contains object streams + 'hybrid-xref', # contains both xref tables and streams + @linearized_files, # we should be able to relinearize + ); + +$n_tests += @linearized_files + 6; +$n_tests += (3 * @to_linearize * 5) + 6; + +foreach my $base (@linearized_files) +{ + $td->runtest("dump linearization: $base", + {$td->COMMAND => "qpdf --show-linearization $base.pdf"}, + {$td->FILE => "$base.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +} + +# Check normal modified and linearized modified files, making sure +# that their qdf files are identical. The next two tests have the +# same expected output files and different input files. +check_pdf("modified", + "qpdf --static-id --qdf --no-original-object-ids" . + " delete-and-reuse.pdf", "delete-and-reuse.qdf", + 0); +check_pdf("linearized and modified", + "qpdf --static-id --qdf --no-original-object-ids" . + " lin-delete-and-reuse.pdf", "delete-and-reuse.qdf", # same output + 0); + +$td->runtest("check linearized and modified", + {$td->COMMAND => "qpdf --check lin-delete-and-reuse.pdf"}, + {$td->FILE => "lin-delete-and-reuse-check.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check multiple modifications", + {$td->COMMAND => "qpdf --check multiple-mods.pdf"}, + {$td->FILE => "multiple-mods-check.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +foreach my $base (@to_linearize) +{ + foreach my $omode (qw(disable preserve generate)) + { + my $oarg = "-object-streams=$omode"; + $td->runtest("linearize $base ($omode)", + {$td->COMMAND => + "qpdf -linearize $oarg --static-id $base.pdf a.pdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); + $td->runtest("check linearization", + {$td->COMMAND => "qpdf --check-linearization a.pdf"}, + {$td->STRING => "a.pdf: no linearization errors\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + # Relinearizing twice should produce identical results. We + # have to do it twice because, if objects changed ordering + # during the original linearization, the hint tables won't + # exactly match. This is because object identifiers are + # inserted into the hint table in their original order since + # we don't yet have renumbering information when we compute + # the table values. + $td->runtest("relinearize $base 1", + {$td->COMMAND => + "qpdf -linearize --static-id a.pdf b.pdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); + $td->runtest("relinearize $base 2", + {$td->COMMAND => + "qpdf -linearize --static-id b.pdf c.pdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); + $td->runtest("compare files ($omode)", + {$td->FILE => "b.pdf"}, + {$td->FILE => "c.pdf"}); + if (($base eq 'lin-special') || ($base eq 'object-stream')) + { + $td->runtest("check $base ($omode)", + {$td->FILE => "a.pdf"}, + {$td->FILE => "$base.$omode.exp"}); + } + } +} + +show_ntests(); +# ---------- +$td->notify("--- Encryption Tests ---"); +# $n_tests incremented below + +# The enc-file.pdf files were encrypted using Acrobat 5.0, not the +# qpdf library. The files are decrypted using qpdf, then re-encrypted +# using qpdf with specific flags. The /P value is checked. The +# resulting files were saved and manually checked with Acrobat 5.0 to +# ensure that the security settings were as intended. + +# Values: basename, password, encryption flags, /P Encrypt key, +# extract-for-accessibility, extract-for-any-purpose, +# print-low-res, print-high-res, modify-assembly, modify-forms, +# modify-annotate, modify-other, modify-all +my @encrypted_files = + (['base', ''], + ['R3,V2', '', + '-accessibility=n -extract=n -print=full -modify=all', -532, + 0, 0, 1, 1, 1, 1, 1, 1, 1], + ['R3,V2,U=view', 'view', + '-accessibility=y -extract=n -print=none -modify=none', -3392, + 1, 0, 0, 0, 0, 0, 0, 0, 0], + ['R3,V2,O=master', 'master', + '-accessibility=n -extract=y -print=none -modify=annotate', -2576, + 0, 1, 0, 0, 1, 1, 1, 0, 0], + ['R3,V2,O=master', '', + '-accessibility=n -extract=n -print=none -modify=form', -2624, + 0, 0, 0, 0, 1, 1, 0, 0, 0], + ['R3,V2,U=view,O=master', 'view', + '-accessibility=n -extract=n -print=none -modify=assembly', -2880, + 0, 0, 0, 0, 1, 0, 0, 0, 0], + ['R3,V2,U=view,O=master', 'master', + '-accessibility=n -print=low', -2564, + 0, 1, 1, 0, 1, 1, 1, 1, 1], + ['R2,V1', '', + '-print=n -modify=n -extract=n -annotate=n', -64, + 0, 0, 0, 0, 0, 0, 0, 0, 0], + ['R2,V1,U=view', 'view', + '-print=y -modify=n -extract=n -annotate=n', -60, + 0, 0, 1, 1, 0, 0, 0, 0, 0], + ['R2,V1,O=master', 'master', + '-print=n -modify=y -extract=n -annotate=n', -56, + 0, 0, 0, 0, 1, 0, 0, 1, 0], + ['R2,V1,O=master', '', + '-print=n -modify=n -extract=y -annotate=n', -48, + 1, 1, 0, 0, 0, 0, 0, 0, 0], + ['R2,V1,U=view,O=master', 'view', + '-print=n -modify=n -extract=n -annotate=y', -32, + 0, 0, 0, 0, 0, 1, 1, 0, 0], + ['R2,V1,U=view,O=master', 'master', + '', -4, + 1, 1, 1, 1, 1, 1, 1, 1, 1], + ['long-password', 'asdf asdf asdf asdf asdf asdf qwer'], + ['long-password', 'asdf asdf asdf asdf asdf asdf qw']); + +$n_tests += 3 + (2 * (@encrypted_files)) + (6 * (@encrypted_files - 3)) + 9; + +$td->runtest("encrypted file", + {$td->COMMAND => "test_driver 2 U25A0.pdf"}, + {$td->FILE => "encrypted1.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("preserve encryption", + {$td->COMMAND => "qpdf U25A0.pdf U25A0.enc"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); +$td->runtest("recheck encrypted file", + {$td->COMMAND => "test_driver 2 U25A0.enc"}, + {$td->FILE => "encrypted1.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +foreach my $d (@encrypted_files) +{ + my ($file, $pass, $xeflags, $P, + $accessible, $extract, $printlow, $printhigh, + $modifyassembly, $modifyform, $modifyannot, + $modifyother, $modifyall) = @$d; + + my $f = sub { $_[0] ? "allowed" : "not allowed" }; + my $enc_details = + "extract for accessibility: " . &$f($accessible) . "\n" . + "extract for any purpose: " . &$f($extract) . "\n" . + "print low resolution: " . &$f($printlow) . "\n" . + "print high resolution: " . &$f($printhigh) . "\n" . + "modify document assembly: " . &$f($modifyassembly) . "\n" . + "modify forms: " . &$f($modifyform) . "\n" . + "modify annotations: " . &$f($modifyannot) . "\n" . + "modify other: " . &$f($modifyother) . "\n" . + "modify anything: " . &$f($modifyall) . "\n"; + + # Test writing to stdout + $td->runtest("decrypt $file", + {$td->COMMAND => + "qpdf --static-id -qdf --no-original-object-ids" . + " --password=\"$pass\" enc-$file.pdf -" . + " > $file.enc"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); + if ($file eq 'base') + { + $td->runtest("check ID", + {$td->COMMAND => "perl check-ID.pl $file.enc"}, + {$td->STRING => "ID okay\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + } + else + { + $td->runtest("check against base", + {$td->COMMAND => "./diff-encrypted base.enc $file.enc"}, + {$td->STRING => "okay\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + } + if ($file =~ m/^R(\d),V(\d)(?:,U=(\w+))?(?:,O=(\w+))?$/) + { + my $R = $1; + my $V = $2; + my $upass = $3 || ""; + my $opass = $4 || ""; + my $bits = (($V == 2) ? 128 : 40); + + my $eflags = "-encrypt \"$upass\" \"$opass\" $bits $xeflags --"; + $td->runtest("encrypt $file", + {$td->COMMAND => + "qpdf --static-id --no-original-object-ids -qdf" . + " $eflags $file.enc $file.enc2"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); + $td->runtest("check /P", + {$td->COMMAND => + "qpdf --show-encryption --password=\"$pass\"" . + " $file.enc2"}, + {$td->STRING => "R = $R\nP = $P\n" . + "User password = $upass\n$enc_details", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + $td->runtest("decrypt again", + {$td->COMMAND => + "qpdf --static-id --no-original-object-ids -qdf" . + " --password=\"$pass\"" . + " $file.enc2 $file.enc3"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); + $td->runtest("compare", + {$td->FILE => "$file.enc"}, + {$td->FILE => "$file.enc3"}); + $td->runtest("preserve encryption", + {$td->COMMAND => + "qpdf --static-id --password=\"$pass\"" . + " $file.enc2 $file.enc4"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); + $td->runtest("check /P", + {$td->COMMAND => + "qpdf --show-encryption --password=\"$pass\"" . + " $file.enc4"}, + {$td->STRING => "R = $R\nP = $P\n" . + "User password = $upass\n$enc_details", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + } +} + +$td->runtest("non-encrypted", + {$td->COMMAND => "qpdf --show-encryption enc-base.pdf"}, + {$td->STRING => "File is not encrypted\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +$td->runtest("invalid password", + {$td->COMMAND => "qpdf -qdf --password=quack" . + " enc-R2,V1,U=view.pdf a.qdf"}, + {$td->STRING => "enc-R2,V1,U=view.pdf: invalid password\n", + $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); +$td->runtest("C API: invalid password", + {$td->COMMAND => "qpdf-ctest 2 enc-R2,V1,U=view.pdf '' a.qdf"}, + {$td->FILE => "c-invalid-password.out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +my @cenc = ( + [11, 'hybrid-xref.pdf', "''", 'r2', ""], + [12, 'hybrid-xref.pdf', "''", 'r3', ""], + [15, 'hybrid-xref.pdf', "''", 'r4', ""], + [13, 'c-r2.pdf', 'user1', 'decrypt with user', + "user password: user1\n"], + [13, 'c-r3.pdf', 'owner2', 'decrypt with owner', + "user password: user2\n"], + ); +$n_tests += 2 * @cenc; + +foreach my $d (@cenc) +{ + my ($n, $infile, $pass, $description, $output) = @$d; + my $outfile = $description; + $outfile =~ s/ /-/g; + $outfile = "c-$outfile.pdf"; + $td->runtest("C API encryption: $description", + {$td->COMMAND => "qpdf-ctest $n $infile $pass a.pdf"}, + {$td->STRING => $output, $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + $td->runtest("check $description", + {$td->FILE => "a.pdf"}, + {$td->FILE => $outfile}); +} + +# Test combinations of linearization and encryption. Note that we do +# content checks on encrypted and linearized files in various +# combinations below. Here we are just making sure that they are +# linearized and/or encrypted as desired. + +$td->runtest("linearize encrypted file", + {$td->COMMAND => "qpdf --linearize U25A0.pdf a.pdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); +$td->runtest("check encryption", + {$td->COMMAND => "qpdf --show-encryption a.pdf", + $td->FILTER => "grep -v allowed"}, + {$td->STRING => "R = 2\nP = -60\nUser password = \n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check linearization", + {$td->COMMAND => "qpdf --check-linearization a.pdf"}, + {$td->STRING => "a.pdf: no linearization errors\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("linearize and encrypt file", + {$td->COMMAND => + "qpdf --linearize --encrypt user owner 128 --use-aes=y --" . + " lin-special.pdf a.pdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); +$td->runtest("check encryption", + {$td->COMMAND => "qpdf --show-encryption --password=owner a.pdf", + $td->FILTER => "grep -v allowed | grep -v method"}, + {$td->STRING => "R = 4\nP = -4\nUser password = user\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check linearization", + {$td->COMMAND => "qpdf --check-linearization" . + " --password=user a.pdf"}, + {$td->STRING => "a.pdf: no linearization errors\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +# Test AES encryption in various ways. +$n_tests += 14; +$td->runtest("encrypt with AES", + {$td->COMMAND => "qpdf --encrypt '' '' 128 --use-aes=y --" . + " enc-base.pdf a.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); +$td->runtest("check encryption", + {$td->COMMAND => "qpdf --show-encryption a.pdf", + $td->FILTER => "grep -v allowed | grep -v method"}, + {$td->STRING => "R = 4\nP = -4\nUser password = \n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("convert original to qdf", + {$td->COMMAND => "qpdf --static-id --no-original-object-ids" . + " --qdf --min-version=1.6 enc-base.pdf a.qdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); +$td->runtest("convert encrypted to qdf", + {$td->COMMAND => "qpdf --static-id --no-original-object-ids" . + " --qdf a.pdf b.qdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); +$td->runtest("compare files", + {$td->FILE => 'a.qdf'}, + {$td->FILE => 'b.qdf'}); +$td->runtest("linearize with AES and object streams", + {$td->COMMAND => "qpdf --encrypt '' '' 128 --use-aes=y --" . + " --linearize --object-streams=generate enc-base.pdf a.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); +$td->runtest("check encryption", + {$td->COMMAND => "qpdf --show-encryption a.pdf", + $td->FILTER => "grep -v allowed | grep -v method"}, + {$td->STRING => "R = 4\nP = -4\nUser password = \n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("linearize original", + {$td->COMMAND => "qpdf --linearize --object-streams=generate" . + " enc-base.pdf b.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); +$td->runtest("convert linearized original to qdf", + {$td->COMMAND => "qpdf --static-id --no-original-object-ids" . + " --qdf --object-streams=generate --min-version=1.6" . + " b.pdf a.qdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); +$td->runtest("convert encrypted to qdf", + {$td->COMMAND => "qpdf --static-id --no-original-object-ids" . + " --qdf --object-streams=generate a.pdf b.qdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); +$td->runtest("compare files", + {$td->FILE => 'a.qdf'}, + {$td->FILE => 'b.qdf'}); +$td->runtest("force version on aes encrypted", + {$td->COMMAND => "qpdf --force-version=1.4 a.pdf b.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); +$td->runtest("check", + {$td->COMMAND => "qpdf --check b.pdf"}, + {$td->FILE => "aes-forced-check.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("make sure there is no xref stream", + {$td->COMMAND => "grep /ObjStm b.pdf | wc -l"}, + {$td->REGEXP => "\\s*0\\s*", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +# Look at some actual V4 files +$n_tests += 14; +foreach my $d (['--force-V4', 'V4'], + ['--cleartext-metadata', 'V4-clearmeta'], + ['--use-aes=y', 'V4-aes'], + ['--cleartext-metadata --use-aes=y', 'V4-aes-clearmeta']) +{ + my ($args, $out) = @$d; + $td->runtest("encrypt $args", + {$td->COMMAND => "qpdf --static-aes-iv --static-id" . + " --encrypt '' '' 128 $args -- enc-base.pdf a.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); + $td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "$out.pdf"}); + $td->runtest("show encryption", + {$td->COMMAND => "qpdf --show-encryption a.pdf"}, + {$td->FILE => "$out-encryption.out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +} +# Crypt Filter +$td->runtest("decrypt with crypt filter", + {$td->COMMAND => "qpdf --decrypt --static-id" . + " metadata-crypt-filter.pdf a.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); +$td->runtest("check output", + {$td->FILE => 'a.pdf'}, + {$td->FILE => 'decrypted-crypt-filter.pdf'}); + +# Copy encryption parameters +$n_tests += 10; +$td->runtest("create reference qdf", + {$td->COMMAND => + "qpdf --qdf --no-original-object-ids minimal.pdf a.qdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); +$td->runtest("create encrypted file", + {$td->COMMAND => + "qpdf --encrypt user owner 128 --use-aes=y --extract=n --" . + " minimal.pdf a.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); +$td->runtest("copy encryption parameters", + {$td->COMMAND => "test_driver 30 minimal.pdf a.pdf"}, + {$td->STRING => "test 30 done\n", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output encryption", + {$td->COMMAND => "qpdf --show-encryption b.pdf --password=owner"}, + {$td->FILE => "copied-encryption.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("convert to qdf", + {$td->COMMAND => + "qpdf --qdf b.pdf b.qdf" . + " --password=owner --no-original-object-ids"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); +$td->runtest("compare qdf", + {$td->COMMAND => "./diff-ignore-ID-version a.qdf b.qdf"}, + {$td->STRING => "okay\n", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("copy encryption with qpdf", + {$td->COMMAND => + "qpdf --copy-encryption=a.pdf". + " --encryption-file-password=user" . + " minimal.pdf c.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output encryption", + {$td->COMMAND => "qpdf --show-encryption c.pdf --password=owner"}, + {$td->FILE => "copied-encryption.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("convert to qdf", + {$td->COMMAND => + "qpdf --qdf c.pdf c.qdf" . + " --password=owner --no-original-object-ids"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); +$td->runtest("compare qdf", + {$td->COMMAND => "./diff-ignore-ID-version a.qdf c.qdf"}, + {$td->STRING => "okay\n", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + + +show_ntests(); +# ---------- +$td->notify("--- Content Preservation Tests ---"); +# $n_tests incremented below + +my @files = ("U25A0.pdf", # encrypted + "inline-images.pdf", + "lin-special.pdf", + "object-stream.pdf", + "hybrid-xref.pdf"); +my @flags = (["-qdf", # 1 + "qdf"], + ["-qdf --normalize-content=n", # 2 + "qdf not normalized"], + ["-qdf --stream-data=preserve", # 3 + "qdf not uncompressed"], + ["-qdf --stream-data=preserve --normalize-content=n", # 4 + "qdf not normalized or uncompressed"], + ["--stream-data=uncompress", # 5 + "uncompresed"], + ["--normalize-content=y", # 6 + "normalized"], + ["--stream-data=uncompress --normalize-content=y", # 7 + "uncompressed and normalized"], + ["-decrypt", # 8 + "decrypted"], + ["-linearize", # 9 + "linearized"], + ["-encrypt \"\" owner 128 --", # 10 + "encrypted"], + ["-linearize -encrypt \"\" o 128 --", # 11 + "linearized and encrypted"], + ["", # 12 + "no arguments"], + ); + +$n_tests += 1 + (@files * @flags * 2 * 3); +$n_compare_pdfs += 1 + (@files * @flags * 2); +$n_acroread += (@files * @flags * 2); + +foreach my $file (@files) +{ + my $base = basename($file, '.pdf'); + + foreach my $o (qw(disable generate)) + { + my $n = 0; + my $oflags = "--object-streams=$o"; + my $odescrip = "os:" . substr($o, 0, 1); + my $osuf = ($o eq 'generate' ? "-ogen" : ""); + foreach my $d (@flags) + { + my ($flags, $fdescrip) = @$d; + ++$n; + system("rm -f *.pnm"); + + $td->runtest("$file ($odescrip $fdescrip)", + {$td->COMMAND => "qpdf $flags $oflags $file a.pdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); + + $td->runtest("check status", + {$td->COMMAND => "qpdf --check a.pdf"}, + {$td->FILE => "$base.$n$osuf.check", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + + $td->runtest("check with C API", + {$td->COMMAND => [qw(qpdf-ctest 1 a.pdf), "", ""]}, + {$td->FILE => "$base.$n$osuf.c-check", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + + compare_pdfs($file, "a.pdf"); + + if ($have_acroread) + { + # These tests require Adobe Reader > 7.x to work with + # encrypted files. + $td->runtest("check with Adobe Reader", + {$td->COMMAND => + "acroread -toPostScript -pairs a.pdf 1.ps"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); + } + } + flush_tiff_cache(); + } +} + +# inline-images-cr.pdf is xbkm938-dies.pdf from PDF collection +$td->runtest("convert inline-images-cr to qdf", + {$td->COMMAND => "qpdf --static-id --no-original-object-ids" . + " --qdf inline-images-cr.pdf a.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); + +compare_pdfs("inline-images-cr.pdf", "a.pdf"); + +show_ntests(); +# ---------- +$td->notify("--- fix-qdf Tests ---"); +$n_tests += 4; + +for (my $n = 1; $n <= 2; ++$n) +{ + $td->runtest("fix-qdf $n", + {$td->COMMAND => "fix-qdf fix$n.qdf"}, + {$td->FILE => "fix$n.qdf.out", + $td->EXIT_STATUS => 0}); + + $td->runtest("identity fix-qdf $n", + {$td->COMMAND => "fix-qdf fix$n.qdf.out"}, + {$td->FILE => "fix$n.qdf.out", + $td->EXIT_STATUS => 0}); +} + +show_ntests(); +# ---------- +$td->notify("--- Large File Tests ---"); +my $nlarge = 1; +if (defined $large_file_test_path) +{ + $nlarge = 2; +} +else +{ + $td->notify("--- Skipping tests on actual large files ---"); +} +$n_tests += $nlarge * 13; +for (my $large = 0; $large < $nlarge; ++$large) +{ + if ($large) + { + $td->notify("--- Running tests on actual large files ---"); + } + else + { + $td->notify("--- Running large file tests on small files ---"); + } + my $size = ($large ? "large" : "small"); + my $file = $large ? "$large_file_test_path/a.pdf" : "a.pdf"; + $td->runtest("write test file", + {$td->COMMAND => "test_large_file write $size $file"}, + {$td->FILE => "large_file.out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + $td->runtest("read test file", + {$td->COMMAND => "test_large_file read $size $file"}, + {$td->FILE => "large_file.out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + $td->runtest("check", + {$td->COMMAND => "qpdf --suppress-recovery --check $file", + $td->FILTER => "grep -v checking"}, + {$td->FILE => "large_file-check-normal.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + + for my $ostream (0, 1) + { + for my $linearize (0, 1) + { + if (($ostream == 0) && ($linearize == 0)) + { + # Original file has no object streams and is not linearized. + next; + } + my $args = ""; + my $omode = $ostream ? "generate" : "disable"; + my $lin = $linearize ? "--linearize" : ""; + my $newfile = "$file-new"; + + $td->runtest("transform: ostream=$ostream, linearize=$linearize", + {$td->COMMAND => + "qpdf --stream-data=preserve" . + " --object-streams=$omode" . + " $lin $file $newfile"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); + $td->runtest("read test file", + {$td->COMMAND => + "test_large_file read $size $newfile"}, + {$td->FILE => "large_file.out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + my $check_out = + ($linearize + ? ($ostream + ? "large_file-check-ostream-linearized.out" + : "large_file-check-linearized.out") + : ($ostream + ? "large_file-check-ostream.out" + : "large_file-check-normal.out")); + $td->runtest("check: ostream=$ostream, linearize=$linearize", + {$td->COMMAND => + "qpdf --suppress-recovery --check $newfile", + $td->FILTER => "grep -v checking"}, + {$td->FILE => $check_out, $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + unlink $newfile; + } + } + + # Clobber xref + open(F, "+<$file") or die; + seek(F, -50, 2); + my $pos = tell F; + my $buf; + read(F, $buf, 50); + die unless $buf =~ m/^(.*startxref\n)\d+/s; + $pos += length($1); + seek(F, $pos, 0) or die; + print F "oops" or die; + close(F); + + my $cmd = +{$td->COMMAND => "test_large_file read $size $file"}; + if ($large) + { + $cmd->{$td->FILTER} = "sed -e s,$large_file_test_path/,,"; + } + $td->runtest("reconstruct xref table", + $cmd, + {$td->FILE => "large_file_xref_reconstruct.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + unlink $file; +} +# ---------- + +cleanup(); + +# See comments at beginning about calculation of number of tests. We +# do it strictly based on static values, not as a by-product of +# running the test suite. +$td->report(calc_ntests()); + +sub calc_ntests +{ + my $result = $n_tests; + if ($have_acroread) + { + $result += $n_acroread; + } + if ($compare_images) + { + $result += 3 * ($n_compare_pdfs); + } + $result; +} + +sub show_ntests +{ + if (0) + { + $td->emphasize("tests so far: ". calc_ntests()); + } +} + +sub check_pdf +{ + my ($description, $command, $output, $status) = @_; + unlink "a.pdf"; + $td->runtest($description, + {$td->COMMAND => "$command a.pdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => $status}); + $td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => $output}); +} + +sub flush_tiff_cache +{ + system("rm -rf tiff-cache"); +} + +sub compare_pdfs +{ + return unless $compare_images; + + my ($f1, $f2, $exp) = @_; + + $exp = 0 unless defined $exp; + + system("rm -rf tif1 tif2"); + + mkdir "tiff-cache", 0777 unless -d "tiff-cache"; + + my $md5_1 = get_md5_checksum($f1); + my $md5_2 = get_md5_checksum($f2); + + mkdir "tif1", 0777 or die; + mkdir "tif2", 0777 or die; + + if (-f "tiff-cache/$md5_1.tif") + { + $td->runtest("get cached original file image", + {$td->COMMAND => "cp tiff-cache/$md5_1.tif tif1/a.tif"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); + } + else + { + # We discard gs's stderr since it has sometimes been known to + # complain about files that are not bad. In particular, gs + # 9.04 can't handle empty xref sections such as those found in + # the hybrid xref cases. We don't really care whether gs + # complains or not as long as it creates correct images. If + # it doesn't create correct images, the test will fail, and we + # can run manually to see the error message. If it does, then + # we don't care about the warning. + $td->runtest("convert original file to image", + {$td->COMMAND => + "(cd tif1;" . + " gs 2>/dev/null -q -dNOPAUSE -sDEVICE=tiff12nc" . + " -sOutputFile=a.tif - < ../$f1)"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); + copy("tif1/a.tif", "tiff-cache/$md5_1.tif"); + } + + if (-f "tiff-cache/$md5_2.tif") + { + $td->runtest("get cached new file image", + {$td->COMMAND => "cp tiff-cache/$md5_2.tif tif2/a.tif"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); + } + else + { + $td->runtest("convert new file to image", + {$td->COMMAND => + "(cd tif2;" . + " gs 2>/dev/null -q -dNOPAUSE -sDEVICE=tiff12nc" . + " -sOutputFile=a.tif - < ../$f2)"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); + copy("tif2/a.tif", "tiff-cache/$md5_2.tif"); + } + + $td->runtest("compare images", + {$td->COMMAND => "tiffcmp -t tif1/a.tif tif2/a.tif"}, + {$td->REGEXP => ".*", + $td->EXIT_STATUS => $exp}); + + system("rm -rf tif1 tif2"); +} + +sub check_metadata +{ + my ($file, $exp_encrypted, $exp_cleartext) = @_; + my $out = "encrypted=$exp_encrypted; cleartext=$exp_cleartext\n" . + "test 6 done\n"; + $td->runtest("check metadata: $file", + {$td->COMMAND => "test_driver 6 $file"}, + {$td->STRING => $out, $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +} + +sub get_md5_checksum +{ + my $file = shift; + open(F, "<$file") or fatal("can't open $file: $!"); + binmode F; + my $digest = Digest::MD5->new->addfile(*F)->hexdigest; + close(F); + $digest; +} + +sub cleanup +{ + system("rm -rf *.ps *.pnm ?.pdf ?.qdf *.enc* tif1 tif2 tiff-cache"); +} diff --git a/qpdf/qtest/qpdf/20-pages.pdf b/qpdf/qtest/qpdf/20-pages.pdf new file mode 100644 index 0000000..616ac93 Binary files /dev/null and b/qpdf/qtest/qpdf/20-pages.pdf differ diff --git a/qpdf/qtest/qpdf/U25A0.1-ogen.c-check b/qpdf/qtest/qpdf/U25A0.1-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.1-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/U25A0.1-ogen.check b/qpdf/qtest/qpdf/U25A0.1-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.1-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.1.c-check b/qpdf/qtest/qpdf/U25A0.1.c-check new file mode 100644 index 0000000..757cc85 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.1.c-check @@ -0,0 +1,3 @@ +version: 1.3 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/U25A0.1.check b/qpdf/qtest/qpdf/U25A0.1.check new file mode 100644 index 0000000..5da27b2 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.1.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.10-ogen.c-check b/qpdf/qtest/qpdf/U25A0.10-ogen.c-check new file mode 100644 index 0000000..963cdba --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.10-ogen.c-check @@ -0,0 +1,13 @@ +version: 1.5 +linearized: 0 +encrypted: 1 +user password: +extract for accessibility: 1 +extract for any purpose: 1 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 1 +modify forms: 1 +modify annotations: 1 +modify other: 1 +modify anything: 1 diff --git a/qpdf/qtest/qpdf/U25A0.10-ogen.check b/qpdf/qtest/qpdf/U25A0.10-ogen.check new file mode 100644 index 0000000..331cd70 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.10-ogen.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.5 +R = 3 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.10.c-check b/qpdf/qtest/qpdf/U25A0.10.c-check new file mode 100644 index 0000000..628b5fa --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.10.c-check @@ -0,0 +1,13 @@ +version: 1.4 +linearized: 0 +encrypted: 1 +user password: +extract for accessibility: 1 +extract for any purpose: 1 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 1 +modify forms: 1 +modify annotations: 1 +modify other: 1 +modify anything: 1 diff --git a/qpdf/qtest/qpdf/U25A0.10.check b/qpdf/qtest/qpdf/U25A0.10.check new file mode 100644 index 0000000..921e171 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.10.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.4 +R = 3 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.11-ogen.c-check b/qpdf/qtest/qpdf/U25A0.11-ogen.c-check new file mode 100644 index 0000000..ef82b7f --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.11-ogen.c-check @@ -0,0 +1,13 @@ +version: 1.5 +linearized: 1 +encrypted: 1 +user password: +extract for accessibility: 1 +extract for any purpose: 1 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 1 +modify forms: 1 +modify annotations: 1 +modify other: 1 +modify anything: 1 diff --git a/qpdf/qtest/qpdf/U25A0.11-ogen.check b/qpdf/qtest/qpdf/U25A0.11-ogen.check new file mode 100644 index 0000000..aae0b3a --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.11-ogen.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.5 +R = 3 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.11.c-check b/qpdf/qtest/qpdf/U25A0.11.c-check new file mode 100644 index 0000000..a528204 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.11.c-check @@ -0,0 +1,13 @@ +version: 1.4 +linearized: 1 +encrypted: 1 +user password: +extract for accessibility: 1 +extract for any purpose: 1 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 1 +modify forms: 1 +modify annotations: 1 +modify other: 1 +modify anything: 1 diff --git a/qpdf/qtest/qpdf/U25A0.11.check b/qpdf/qtest/qpdf/U25A0.11.check new file mode 100644 index 0000000..74a360c --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.11.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.4 +R = 3 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.12-ogen.c-check b/qpdf/qtest/qpdf/U25A0.12-ogen.c-check new file mode 100644 index 0000000..11d6d63 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.12-ogen.c-check @@ -0,0 +1,13 @@ +version: 1.5 +linearized: 0 +encrypted: 1 +user password: +extract for accessibility: 0 +extract for any purpose: 0 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 0 +modify forms: 0 +modify annotations: 0 +modify other: 0 +modify anything: 0 diff --git a/qpdf/qtest/qpdf/U25A0.12-ogen.check b/qpdf/qtest/qpdf/U25A0.12-ogen.check new file mode 100644 index 0000000..4e945d5 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.12-ogen.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.5 +R = 2 +P = -60 +User password = +extract for accessibility: not allowed +extract for any purpose: not allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: not allowed +modify forms: not allowed +modify annotations: not allowed +modify other: not allowed +modify anything: not allowed +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.12.c-check b/qpdf/qtest/qpdf/U25A0.12.c-check new file mode 100644 index 0000000..b37fa75 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.12.c-check @@ -0,0 +1,13 @@ +version: 1.3 +linearized: 0 +encrypted: 1 +user password: +extract for accessibility: 0 +extract for any purpose: 0 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 0 +modify forms: 0 +modify annotations: 0 +modify other: 0 +modify anything: 0 diff --git a/qpdf/qtest/qpdf/U25A0.12.check b/qpdf/qtest/qpdf/U25A0.12.check new file mode 100644 index 0000000..581b48b --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.12.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.3 +R = 2 +P = -60 +User password = +extract for accessibility: not allowed +extract for any purpose: not allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: not allowed +modify forms: not allowed +modify annotations: not allowed +modify other: not allowed +modify anything: not allowed +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.2-ogen.c-check b/qpdf/qtest/qpdf/U25A0.2-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.2-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/U25A0.2-ogen.check b/qpdf/qtest/qpdf/U25A0.2-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.2-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.2.c-check b/qpdf/qtest/qpdf/U25A0.2.c-check new file mode 100644 index 0000000..757cc85 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.2.c-check @@ -0,0 +1,3 @@ +version: 1.3 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/U25A0.2.check b/qpdf/qtest/qpdf/U25A0.2.check new file mode 100644 index 0000000..5da27b2 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.2.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.3-ogen.c-check b/qpdf/qtest/qpdf/U25A0.3-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.3-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/U25A0.3-ogen.check b/qpdf/qtest/qpdf/U25A0.3-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.3-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.3.c-check b/qpdf/qtest/qpdf/U25A0.3.c-check new file mode 100644 index 0000000..757cc85 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.3.c-check @@ -0,0 +1,3 @@ +version: 1.3 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/U25A0.3.check b/qpdf/qtest/qpdf/U25A0.3.check new file mode 100644 index 0000000..5da27b2 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.3.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.4-ogen.c-check b/qpdf/qtest/qpdf/U25A0.4-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.4-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/U25A0.4-ogen.check b/qpdf/qtest/qpdf/U25A0.4-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.4-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.4.c-check b/qpdf/qtest/qpdf/U25A0.4.c-check new file mode 100644 index 0000000..757cc85 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.4.c-check @@ -0,0 +1,3 @@ +version: 1.3 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/U25A0.4.check b/qpdf/qtest/qpdf/U25A0.4.check new file mode 100644 index 0000000..5da27b2 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.4.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.5-ogen.c-check b/qpdf/qtest/qpdf/U25A0.5-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.5-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/U25A0.5-ogen.check b/qpdf/qtest/qpdf/U25A0.5-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.5-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.5.c-check b/qpdf/qtest/qpdf/U25A0.5.c-check new file mode 100644 index 0000000..757cc85 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.5.c-check @@ -0,0 +1,3 @@ +version: 1.3 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/U25A0.5.check b/qpdf/qtest/qpdf/U25A0.5.check new file mode 100644 index 0000000..5da27b2 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.5.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.6-ogen.c-check b/qpdf/qtest/qpdf/U25A0.6-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.6-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/U25A0.6-ogen.check b/qpdf/qtest/qpdf/U25A0.6-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.6-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.6.c-check b/qpdf/qtest/qpdf/U25A0.6.c-check new file mode 100644 index 0000000..757cc85 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.6.c-check @@ -0,0 +1,3 @@ +version: 1.3 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/U25A0.6.check b/qpdf/qtest/qpdf/U25A0.6.check new file mode 100644 index 0000000..5da27b2 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.6.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.7-ogen.c-check b/qpdf/qtest/qpdf/U25A0.7-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.7-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/U25A0.7-ogen.check b/qpdf/qtest/qpdf/U25A0.7-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.7-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.7.c-check b/qpdf/qtest/qpdf/U25A0.7.c-check new file mode 100644 index 0000000..757cc85 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.7.c-check @@ -0,0 +1,3 @@ +version: 1.3 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/U25A0.7.check b/qpdf/qtest/qpdf/U25A0.7.check new file mode 100644 index 0000000..5da27b2 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.7.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.8-ogen.c-check b/qpdf/qtest/qpdf/U25A0.8-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.8-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/U25A0.8-ogen.check b/qpdf/qtest/qpdf/U25A0.8-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.8-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.8.c-check b/qpdf/qtest/qpdf/U25A0.8.c-check new file mode 100644 index 0000000..757cc85 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.8.c-check @@ -0,0 +1,3 @@ +version: 1.3 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/U25A0.8.check b/qpdf/qtest/qpdf/U25A0.8.check new file mode 100644 index 0000000..5da27b2 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.8.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.9-ogen.c-check b/qpdf/qtest/qpdf/U25A0.9-ogen.c-check new file mode 100644 index 0000000..cc892af --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.9-ogen.c-check @@ -0,0 +1,13 @@ +version: 1.5 +linearized: 1 +encrypted: 1 +user password: +extract for accessibility: 0 +extract for any purpose: 0 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 0 +modify forms: 0 +modify annotations: 0 +modify other: 0 +modify anything: 0 diff --git a/qpdf/qtest/qpdf/U25A0.9-ogen.check b/qpdf/qtest/qpdf/U25A0.9-ogen.check new file mode 100644 index 0000000..1d11997 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.9-ogen.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.5 +R = 2 +P = -60 +User password = +extract for accessibility: not allowed +extract for any purpose: not allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: not allowed +modify forms: not allowed +modify annotations: not allowed +modify other: not allowed +modify anything: not allowed +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.9.c-check b/qpdf/qtest/qpdf/U25A0.9.c-check new file mode 100644 index 0000000..18ee32d --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.9.c-check @@ -0,0 +1,13 @@ +version: 1.3 +linearized: 1 +encrypted: 1 +user password: +extract for accessibility: 0 +extract for any purpose: 0 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 0 +modify forms: 0 +modify annotations: 0 +modify other: 0 +modify anything: 0 diff --git a/qpdf/qtest/qpdf/U25A0.9.check b/qpdf/qtest/qpdf/U25A0.9.check new file mode 100644 index 0000000..e543256 --- /dev/null +++ b/qpdf/qtest/qpdf/U25A0.9.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.3 +R = 2 +P = -60 +User password = +extract for accessibility: not allowed +extract for any purpose: not allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: not allowed +modify forms: not allowed +modify annotations: not allowed +modify other: not allowed +modify anything: not allowed +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/U25A0.pdf b/qpdf/qtest/qpdf/U25A0.pdf new file mode 100644 index 0000000..f8b779d Binary files /dev/null and b/qpdf/qtest/qpdf/U25A0.pdf differ diff --git a/qpdf/qtest/qpdf/V4-aes-clearmeta-encryption.out b/qpdf/qtest/qpdf/V4-aes-clearmeta-encryption.out new file mode 100644 index 0000000..928818d --- /dev/null +++ b/qpdf/qtest/qpdf/V4-aes-clearmeta-encryption.out @@ -0,0 +1,15 @@ +R = 4 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +stream encryption method: AESv2 +string encryption method: AESv2 +file encryption method: AESv2 diff --git a/qpdf/qtest/qpdf/V4-aes-clearmeta.pdf b/qpdf/qtest/qpdf/V4-aes-clearmeta.pdf new file mode 100644 index 0000000..61c57f5 --- /dev/null +++ b/qpdf/qtest/qpdf/V4-aes-clearmeta.pdf @@ -0,0 +1,417 @@ +%PDF-1.6 +%¿÷¢þ +1 0 obj +<< /Metadata 3 0 R /Outlines 4 0 R /PageLabels << /Nums [ 0 << /P <0e1c2a38465462707e8c9aa8b6c4d2e00f262aedded08d15ff2f51f65bab002f> >> 2 << /S /r /St 1 >> 7 << /P <0e1c2a38465462707e8c9aa8b6c4d2e00f262aedded08d15ff2f51f65bab002f> >> 9 << /S /r /St 6 >> 11 << /P <0e1c2a38465462707e8c9aa8b6c4d2e00f262aedded08d15ff2f51f65bab002f> >> 12 << /S /D /St 2 >> 15 << /S /D /St 6 >> 19 << /P <0e1c2a38465462707e8c9aa8b6c4d2e00f262aedded08d15ff2f51f65bab002f> >> 20 << /S /D /St 12 >> 22 << /S /D /St 16059 >> 23 << /S /r /St 50 >> 29 << /S /r /St 54 >> ] >> /PageMode /UseOutlines /Pages 5 0 R /Type /Catalog >> +endobj +2 0 obj +<< /CreationDate <0e1c2a38465462707e8c9aa8b6c4d2e00921a6a7b0c133fb2f989c3da27b2ac814b1c32543f37411fd736a4671a646b7> /ModDate <0e1c2a38465462707e8c9aa8b6c4d2e00921a6a7b0c133fb2f989c3da27b2ac814b1c32543f37411fd736a4671a646b7> >> +endobj +3 0 obj +<< /Subtype /XML /Type /Metadata /Length 770 >> +stream + + + + + + 2003-10-10T18:04:32-03:00 + 2003-10-10T18:04:32-03:00 + + + + 2003-10-10T18:04:32-03:00 + 2003-10-10T18:04:32-03:00 + 2003-10-10T18:04:32-03:00 + + + +endstream +endobj +4 0 obj +<< /Count 6 /First 6 0 R /Last 7 0 R /Type /Outlines >> +endobj +5 0 obj +<< /Count 30 /Kids [ 8 0 R 9 0 R 10 0 R 11 0 R 12 0 R 13 0 R 14 0 R 15 0 R 16 0 R 17 0 R 18 0 R 19 0 R 20 0 R 21 0 R 22 0 R 23 0 R 24 0 R 25 0 R 26 0 R 27 0 R 28 0 R 29 0 R 30 0 R 31 0 R 32 0 R 33 0 R 34 0 R 35 0 R 36 0 R 37 0 R ] /Type /Pages >> +endobj +6 0 obj +<< /Count 4 /Dest [ 13 0 R /XYZ null null null ] /First 38 0 R /Last 39 0 R /Next 7 0 R /Parent 4 0 R /Title <0e1c2a38465462707e8c9aa8b6c4d2e0b238a868ad6ebb3fd7d78dc22672a04960be7d3e8245bea76dbe68c23e5f03de54c759f400d5dcbfdac739c9d936cf84> /Type /Outline >> +endobj +7 0 obj +<< /Dest [ 23 0 R /XYZ 66 756 3 ] /Parent 4 0 R /Prev 6 0 R /Title <0e1c2a38465462707e8c9aa8b6c4d2e0ca5f0294db4ad20336e77370836f9058f3c825cbf836d07b61ebbfaa698ec301> /Type /Outline >> +endobj +8 0 obj +<< /Contents 40 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +9 0 obj +<< /Contents 43 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +10 0 obj +<< /Contents 44 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +11 0 obj +<< /Contents 45 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +12 0 obj +<< /Contents 46 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +13 0 obj +<< /Contents 47 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +14 0 obj +<< /Contents 48 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +15 0 obj +<< /Contents 49 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +16 0 obj +<< /Contents 50 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +17 0 obj +<< /Contents 51 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +18 0 obj +<< /Contents 52 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +19 0 obj +<< /Contents 53 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +20 0 obj +<< /Contents 54 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +21 0 obj +<< /Contents 55 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +22 0 obj +<< /Contents 56 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +23 0 obj +<< /Contents 57 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +24 0 obj +<< /Contents 58 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +25 0 obj +<< /Contents 59 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +26 0 obj +<< /Contents 60 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +27 0 obj +<< /Contents 61 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +28 0 obj +<< /Contents 62 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +29 0 obj +<< /Contents 63 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +30 0 obj +<< /Contents 64 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +31 0 obj +<< /Contents 65 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +32 0 obj +<< /Contents 66 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +33 0 obj +<< /Contents 67 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +34 0 obj +<< /Contents 68 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +35 0 obj +<< /Contents 69 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +36 0 obj +<< /Contents 70 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +37 0 obj +<< /Contents 71 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +38 0 obj +<< /Count -3 /Dest [ 19 0 R /Fit ] /First 72 0 R /Last 73 0 R /Next 39 0 R /Parent 6 0 R /Title <0e1c2a38465462707e8c9aa8b6c4d2e09ca6cded56239338246ee0f67eaedc7a5934c16efed6ab448a94b6aea5813c37> /Type /Outline >> +endobj +39 0 obj +<< /Count 2 /Dest [ 21 0 R /FitH 792 ] /First 74 0 R /Last 75 0 R /Parent 6 0 R /Prev 38 0 R /Title <0e1c2a38465462707e8c9aa8b6c4d2e0a67a0507bb5990eb05f0e2d4963d3fe76e56d39f83b79788f140d31295a240f0> /Type /Outline >> +endobj +40 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàˆs¥^‰||Æ÷m„]I·&œ‰Ä}Õ¾[Z^Oªãýrš¥¼Ev;c¤^Ð+$*0‘ÿ˜Éמ{ûU=ªQendstream +endobj +41 0 obj +<< /BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font >> +endobj +42 0 obj +[ /PDF /Text ] +endobj +43 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà²ÓÂDžâo®Ôä‚°æàž%û÷Ï@TÕ¼þ¿¬ÑçAêû5dÜÏ‘t°÷}dIÛÃ>†ûëuÅ_Í®•´²±íendstream +endobj +44 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà¿‘‰aŽÎÔ~ƒ’ Ë̼QO…º‘?ØЮ–=¹™(!‡¬Î Tm÷j2)~k™ãßùJÅyÅ^¾oèendstream +endobj +45 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà°s¿³»@¼Xýª!è>›‹ü¬%«+jNŽýòi„Xt-;ðÇ–Køc÷Z׈waÞbe1Ž“64JÍendstream +endobj +46 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒànðÂygs× +An KR䧛QúµNœýu°˜™2Ž0†›²NÃÒ$}öÏ[ +yyuOÝendstream +endobj +47 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà5¤ÛÇ Êr/°2“r‡ *·ÉZÜ©_iU6~Ã38*xÖ™á8i¥‹\¶œtø;øZ@êØ-Ž`?»‚endstream +endobj +48 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàl Ô‰,écZ‚‰¤†)c|°~R‚¨¹lA SÔ=i*Œ¼ç ~•2Q[—<þ‹BÝ÷n7ºî–|eB9øendstream +endobj +49 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàL°3`±ò¹Àü¾g{Š±nA pkB¿ÌÉåy²õ8ešZëØi=¨ bZÉTÄ<žt +°éRŠðƒ˜¦êendstream +endobj +50 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàÀlÚñ2Wä„p@sðk.})3~+EQ"iÊçÚÞó•b;L¶m™™x—ºl²ˆG°¼Îh¥«lnõ—eÌ:®endstream +endobj +51 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà8›Ý::[šãlê«Þ‚å}ª°bܲ‘‰Žê›wTu×´F9Í"Sw:€o >]í .ú·¢iqtŠrendstream +endobj +52 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒ྄ø÷ä5sì’‰I‘ѵC¥£fèÔ_®N2…žŸ¢gËÅe¸RÈd¦i˜w²âEOôù/q÷â;wendstream +endobj +53 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà +;´§P]ã:ßÔ/é3E-%èÆ·ë«’3V¾9¬ËÌh,2;÷'ˆ½ÙQ;u=²Ùì¿AI®q àendstream +endobj +54 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàÍ}!×òY6aÓDÕw4N"Þ§½S,ºŠ+åø3÷ÕULP¯„)yf!Tg\4Ü™§5džÝ+endstream +endobj +55 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà+®µ£Xt4[‰Ñ맾¶Mñ »»`tÎrq“->¦’Gôäûý×ÖYN ò$/z÷xÔÇ1Xö7”­føN endstream +endobj +56 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàŽ7'›”|+t¶FÀX5Pü”öÕo[¹¬FA ó¦'Þ}4=  >M¿úx_¬¬qÇÖÄÙ·òÀ8ÅÅö©endstream +endobj +57 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàˆI´Žž›!Ð @IxIô'î:[¾Z K3-îEûï„rãä(hH>þÅ*²r±~ØðÎ M? XRendstream +endobj +58 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàfyWlñÍ4.oÇIwÌÔÿÞ‡§Î·Ú?¶è|’ŽÜ#,ˆo?0%›Ã’•Ðw1Øeð¢}ÁÈ»OýÍendstream +endobj +59 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà0yí\ÖénRã„ Å=9r_ï• +ᜄå2ÿc|-ná¤[•zʉ²2ïZ北&­¼“œ>sŸ%È1ûendstream +endobj +60 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà‘ ‡Í`[¿ûâ¿~pl< ^½/L®§Þ-t KEsS¤¯A©fAWc¿ÊÖãÔœÓ1qIŒ1SÉónlendstream +endobj +61 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàËk†O ñÑ:FþþŒEà  zh¥t£ë"õ”ðsETƒ=‚S–ÍÈ£À$w[˜— ½Fu§ÝèkÔ4‹Yendstream +endobj +62 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàB-køÇWx—æC)+¿†ú²ô¢<¿T$ÃÚy Tªö×*¬žØØç[¦eš/zÿŠß}Ëé34ÒŠsíè©endstream +endobj +63 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàìð–d¥lƒø—Ê À͛֠óø~2ÚÆ´ëC'#09Ë><®@w¾›D +î“[îÄV4ü©˜8 N_þ@>4Ùendstream +endobj +64 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàHmyû5­ev$Dî ºOÔ Må +âd: +øjd¹w:¨o-´‹V*¹vd7CL¥\eb[É.g‹dÆ“ça§Eqendstream +endobj +65 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàlÎ`Ð(›-U|•wâ)è¡Æì†T†ºÎ ¥ý.×[]áÛwˆ££¦­UØ7‚¹™Ä@£¸]ƒ›Ëendstream +endobj +66 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàZr›ŒgcoXs³9†Ú§Ìö}kx]Äã–ÊG±fi ;¹Î ÕT> +stream +*8FTbp~Œš¨¶ÄÒàlEXžÓ?-ŒÞB²»_“y!:ZF,{Æx\ÐúrΟOÏ kác§Gér»ØD&m?!€¢iZ|ÄIóendstream +endobj +68 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàF÷¡›†ÑJGÄPÕÕAu0ˆk’ßß« ©yÁmûéÇìc¼Ru°pHÌG›4¢ÐéqÞµï`Ý:/f¥>endstream +endobj +69 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàI#â"¾™³@u¡²6Vå•’ÚÛe¥UæÑ%%®ÆéÂ’ÓóC‰ÐOÀ Qàg°f›÷×Ý÷ÖºtµÞ‡z÷endstream +endobj +70 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàÕÉ€GÄÄȺ>ž.£Ã^Aúp$0èçƒÀèÑ?DŠ½eðÚi³«$Û¦Q°Z¨Ô‚O(>Ë܃ñï°Ib §Hxendstream +endobj +71 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàêŸ9ê'”¸†÷¦^ž´ËΟj$=pÝ7o·ÌöAÍR-"ƒàæ³øHIûU@ÅP[ìÓfêIˆ/õJøµÞendstream +endobj +72 0 obj +<< /Count -2 /Dest [ 20 0 R /FitV 100 ] /First 76 0 R /Last 77 0 R /Next 73 0 R /Parent 38 0 R /Title <0e1c2a38465462707e8c9aa8b6c4d2e009f4dac5b02074cf4849a0d15459676b96276012437a65dfe861c2b7d3d43dd6> /Type /Outline >> +endobj +73 0 obj +<< /Count 1 /Dest [ 20 0 R /XYZ null null null ] /First 78 0 R /Last 78 0 R /Parent 38 0 R /Prev 72 0 R /Title <0e1c2a38465462707e8c9aa8b6c4d2e0c8222a80899552e8f55dff601a31f50ffc49f7b882208cd32b38b84cfe08d06192fc7fe104a29384ae6afba06ffad9f6> /Type /Outline >> +endobj +74 0 obj +<< /Dest [ 9 0 R /FitR 66 714 180 770 ] /Next 75 0 R /Parent 39 0 R /Title <0e1c2a38465462707e8c9aa8b6c4d2e0db2e1806fe2bc539dca1f3bd07df1c861300b43e8d6d1687249b4d7eb69b0cdfa03e717dfdaaff3f9da9e992e7ce7799> /Type /Outline >> +endobj +75 0 obj +<< /Dest [ 8 0 R /XYZ null null null ] /Parent 39 0 R /Prev 74 0 R /Title <0e1c2a38465462707e8c9aa8b6c4d2e00ac2f6a290fab9e2e24e3fd1f20574bac271aecc390740758b0021043b15220d46b1ad3fad6590683df8d41be3cc2dac> /Type /Outline >> +endobj +76 0 obj +<< /Dest [ 26 0 R /XYZ null null null ] /Next 77 0 R /Parent 72 0 R /Title <0e1c2a38465462707e8c9aa8b6c4d2e046551c4c9d5ec737ae978879e7bfa7738e87f54a8f1db0e78c3b34ae0a955661fac26995b1dd5f61f84227daff5e8a0a> /Type /Outline >> +endobj +77 0 obj +<< /Dest [ 27 0 R /XYZ null null null ] /Parent 72 0 R /Prev 76 0 R /Title <0e1c2a38465462707e8c9aa8b6c4d2e0ed02472a72f56c1be52ac90f82aa7ccd10e56983f5f1d989945c2682605e030fdd5ab6e2c0e46505fe6148f3574fe4af> /Type /Outline >> +endobj +78 0 obj +<< /Dest [ 30 0 R /XYZ null null null ] /Parent 73 0 R /Title <0e1c2a38465462707e8c9aa8b6c4d2e04e0071f73ffb55e63fee8c296c57a5116ad91676f573b1c2fe59aca102ad3421cc50bd84f88f518cd8bbd9962c7a59d0> /Type /Outline >> +endobj +79 0 obj +<< /CF << /StdCF << /AuthEvent /DocOpen /CFM /AESV2 >> >> /EncryptMetadata false /Filter /Standard /Length 128 /O <36451bd39d753b7c1d10922c28e6665aa4f3353fb0348b536893e3b1db5c579b> /P -4 /R 4 /StmF /StdCF /StrF /StdCF /U /V 4 >> +endobj +xref +0 80 +0000000000 65535 f +0000000015 00000 n +0000000634 00000 n +0000000876 00000 n +0000001726 00000 n +0000001797 00000 n +0000002059 00000 n +0000002332 00000 n +0000002531 00000 n +0000002712 00000 n +0000002893 00000 n +0000003075 00000 n +0000003257 00000 n +0000003439 00000 n +0000003621 00000 n +0000003803 00000 n +0000003985 00000 n +0000004167 00000 n +0000004349 00000 n +0000004531 00000 n +0000004713 00000 n +0000004895 00000 n +0000005077 00000 n +0000005259 00000 n +0000005441 00000 n +0000005623 00000 n +0000005805 00000 n +0000005987 00000 n +0000006169 00000 n +0000006351 00000 n +0000006533 00000 n +0000006715 00000 n +0000006897 00000 n +0000007079 00000 n +0000007261 00000 n +0000007443 00000 n +0000007625 00000 n +0000007807 00000 n +0000007989 00000 n +0000008218 00000 n +0000008451 00000 n +0000008602 00000 n +0000008710 00000 n +0000008741 00000 n +0000008892 00000 n +0000009043 00000 n +0000009194 00000 n +0000009345 00000 n +0000009496 00000 n +0000009647 00000 n +0000009798 00000 n +0000009949 00000 n +0000010100 00000 n +0000010251 00000 n +0000010402 00000 n +0000010553 00000 n +0000010704 00000 n +0000010855 00000 n +0000011006 00000 n +0000011157 00000 n +0000011308 00000 n +0000011459 00000 n +0000011610 00000 n +0000011761 00000 n +0000011912 00000 n +0000012063 00000 n +0000012214 00000 n +0000012365 00000 n +0000012516 00000 n +0000012667 00000 n +0000012818 00000 n +0000012969 00000 n +0000013120 00000 n +0000013355 00000 n +0000013631 00000 n +0000013871 00000 n +0000014110 00000 n +0000014350 00000 n +0000014590 00000 n +0000014817 00000 n +trailer << /Info 2 0 R /Root 1 0 R /Size 80 /ID [<66d36a30a97e0f16f39955c6221e0c2a><31415926535897932384626433832795>] /Encrypt 79 0 R >> +startxref +15129 +%%EOF diff --git a/qpdf/qtest/qpdf/V4-aes-encryption.out b/qpdf/qtest/qpdf/V4-aes-encryption.out new file mode 100644 index 0000000..928818d --- /dev/null +++ b/qpdf/qtest/qpdf/V4-aes-encryption.out @@ -0,0 +1,15 @@ +R = 4 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +stream encryption method: AESv2 +string encryption method: AESv2 +file encryption method: AESv2 diff --git a/qpdf/qtest/qpdf/V4-aes.pdf b/qpdf/qtest/qpdf/V4-aes.pdf new file mode 100644 index 0000000..a779a50 --- /dev/null +++ b/qpdf/qtest/qpdf/V4-aes.pdf @@ -0,0 +1,396 @@ +%PDF-1.6 +%¿÷¢þ +1 0 obj +<< /Metadata 3 0 R /Outlines 4 0 R /PageLabels << /Nums [ 0 << /P <0e1c2a38465462707e8c9aa8b6c4d2e04a74ca52697dc92e78001ad964146eca> >> 2 << /S /r /St 1 >> 7 << /P <0e1c2a38465462707e8c9aa8b6c4d2e04a74ca52697dc92e78001ad964146eca> >> 9 << /S /r /St 6 >> 11 << /P <0e1c2a38465462707e8c9aa8b6c4d2e04a74ca52697dc92e78001ad964146eca> >> 12 << /S /D /St 2 >> 15 << /S /D /St 6 >> 19 << /P <0e1c2a38465462707e8c9aa8b6c4d2e04a74ca52697dc92e78001ad964146eca> >> 20 << /S /D /St 12 >> 22 << /S /D /St 16059 >> 23 << /S /r /St 50 >> 29 << /S /r /St 54 >> ] >> /PageMode /UseOutlines /Pages 5 0 R /Type /Catalog >> +endobj +2 0 obj +<< /CreationDate <0e1c2a38465462707e8c9aa8b6c4d2e0e9899cdac1e580de96cee46c62bbe494cccd4890015eb51e9ebe9e163bd4e9db> /ModDate <0e1c2a38465462707e8c9aa8b6c4d2e0e9899cdac1e580de96cee46c62bbe494cccd4890015eb51e9ebe9e163bd4e9db> >> +endobj +3 0 obj +<< /Subtype /XML /Type /Metadata /Length 336 /Filter /FlateDecode >> +stream +*8FTbp~Œš¨¶ÄÒàTMÀF5¥¯œ÷YL3“Ü#íbÕÎd¢«¯21Î ÿÊCÊ+ƒK†N¯™ŸçËA¸ƒv®±Ô“§{’´“QÂío+Ì/;ÜùÓ£•À–ønÏO離§i‰D Q'ä5ºd‘)b”óØÆøtZ,VNjí#f¤ÐPj¸'Êpà0súq»òB> T©AÖ>U1´3\o¿.Aa¹±`ì’´˜˜¨áv™^tïá+Õ©{Òj€CÒ¯Ñ!ÇLOIrÎoŒšuð]í#©#"ÛbŒ¯Íù8iæ| èÕăFšöõ4¢§æ]×dójÎÚTT6'Âe¡r}N“6J 5h¹âMèeë3œvp.±98U¡x¿8ÐQ  1ŠæPÏ7PÕp­Cyh±Ü—mÎ4_åd#3óÒœÜO¼ñ¿áendstream +endobj +4 0 obj +<< /Count 6 /First 6 0 R /Last 7 0 R /Type /Outlines >> +endobj +5 0 obj +<< /Count 30 /Kids [ 8 0 R 9 0 R 10 0 R 11 0 R 12 0 R 13 0 R 14 0 R 15 0 R 16 0 R 17 0 R 18 0 R 19 0 R 20 0 R 21 0 R 22 0 R 23 0 R 24 0 R 25 0 R 26 0 R 27 0 R 28 0 R 29 0 R 30 0 R 31 0 R 32 0 R 33 0 R 34 0 R 35 0 R 36 0 R 37 0 R ] /Type /Pages >> +endobj +6 0 obj +<< /Count 4 /Dest [ 13 0 R /XYZ null null null ] /First 38 0 R /Last 39 0 R /Next 7 0 R /Parent 4 0 R /Title <0e1c2a38465462707e8c9aa8b6c4d2e06136b49986838be63dd18d04525fd8bf58c0dc5fe6482939c2c7a9ca3c1ad893cd4ba6267c0a6bd4524eac5c97204097> /Type /Outline >> +endobj +7 0 obj +<< /Dest [ 23 0 R /XYZ 66 756 3 ] /Parent 4 0 R /Prev 6 0 R /Title <0e1c2a38465462707e8c9aa8b6c4d2e01aab63c49ef4a1b1c1be421714d196a241c3db586c7b1a023de3fad2ee034155> /Type /Outline >> +endobj +8 0 obj +<< /Contents 40 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +9 0 obj +<< /Contents 43 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +10 0 obj +<< /Contents 44 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +11 0 obj +<< /Contents 45 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +12 0 obj +<< /Contents 46 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +13 0 obj +<< /Contents 47 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +14 0 obj +<< /Contents 48 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +15 0 obj +<< /Contents 49 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +16 0 obj +<< /Contents 50 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +17 0 obj +<< /Contents 51 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +18 0 obj +<< /Contents 52 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +19 0 obj +<< /Contents 53 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +20 0 obj +<< /Contents 54 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +21 0 obj +<< /Contents 55 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +22 0 obj +<< /Contents 56 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +23 0 obj +<< /Contents 57 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +24 0 obj +<< /Contents 58 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +25 0 obj +<< /Contents 59 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +26 0 obj +<< /Contents 60 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +27 0 obj +<< /Contents 61 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +28 0 obj +<< /Contents 62 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +29 0 obj +<< /Contents 63 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +30 0 obj +<< /Contents 64 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +31 0 obj +<< /Contents 65 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +32 0 obj +<< /Contents 66 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +33 0 obj +<< /Contents 67 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +34 0 obj +<< /Contents 68 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +35 0 obj +<< /Contents 69 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +36 0 obj +<< /Contents 70 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +37 0 obj +<< /Contents 71 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +38 0 obj +<< /Count -3 /Dest [ 19 0 R /Fit ] /First 72 0 R /Last 73 0 R /Next 39 0 R /Parent 6 0 R /Title <0e1c2a38465462707e8c9aa8b6c4d2e00d32ee8de70f8143ac3ffce5881e2d1e8551ed442e4deac827472d66d5d787e2> /Type /Outline >> +endobj +39 0 obj +<< /Count 2 /Dest [ 21 0 R /FitH 792 ] /First 74 0 R /Last 75 0 R /Parent 6 0 R /Prev 38 0 R /Title <0e1c2a38465462707e8c9aa8b6c4d2e0137ae7685fcbcc14362f866f06ed55a84cb760275f947487ad009505412e6472> /Type /Outline >> +endobj +40 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà+°ÜÛZ°ç^xàòÔÑÌÉñlÆãfñN?è"•®­Á•”d¢q)”ÃýÈŽwlÕ¬ÀÍÍ0~#WžúÉâ¤endstream +endobj +41 0 obj +<< /BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font >> +endobj +42 0 obj +[ /PDF /Text ] +endobj +43 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàª#ÄÏ8†µú¤IÕƒÖ<:T–bÝÁqÆÃ#ïGk]´Ý”Nöˆ˜ŠÇªŒuOÿf¯PfÏsyÇ„–nõ{ endstream +endobj +44 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàiWÛä…ÜbJ@[wQh©Š + Éc®ÇZ|ÇYt3'PÆíY …6£ñLC®I›…/½9îê¹ói¸k¡Åendstream +endobj +45 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà:+X©–~Ÿò £ƒÒ˜HoÅ5L»?7À-ž¹s¨> +stream +*8FTbp~Œš¨¶ÄÒàÊVÐX&±Àó^»ä‚,ÍÞtíô Ié +{„$ãÍÁéÿKP¾WËT€ˆL&kÌ}=ÃïG²U!ý+Õ¼„ù„¼endstream +endobj +47 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà-‰•Ü¾áÔÓÇ&1ÖÛ*Œ<Ù{YY^œIò‚ÅN4o‚†?ÔÏ +ͪ„ª¡þÛüæ2“±ÿ':õ£endstream +endobj +48 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà˜+”[Œ%óÍ`P´9‡¯Ç™"Ö²Nݵ7­·©@0»iðùeó XM~þZô3†ÄÆØyœÊÆØ&öÐYwVnÂendstream +endobj +49 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà*’5xXXzuN†%4m«Š¢è-õºïùÞoÁžS}}ÑÎ(Ÿz/ÁÒH€•1X¯±2ù¿"Ævk3Åm‚pI÷ˆendstream +endobj +50 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàªî_@<ž’†¢^NC¾kóŽÑ:T¶q¥¶u˜Ùl! —Œë^&ïÚ‘Èë D=¶‡lûÔJõO³‡TÈ3endstream +endobj +51 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàÓ¥:p&¿‘)B?òceFÛÊØëß„>t>ÒÂë¤öðÇí #ä…Ъ.S-DHš3Žùz:øòI}%6äendstream +endobj +52 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà+;”t;Õ-Ip¶”ñ'[{?°¸Ÿç¿{gëv¢XBµÌ¤ò‚>VTÚ…Vì\HÏ^CÈ9Ã,$ñ + Jendstream +endobj +53 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàиˆ¥D™@yö‹]ì´Ž°®÷T{JNiý•ÛnÓ ×ƒF˘.TÈ«bÞÄ{Y=Ñ¡w¼þøjŽÍendstream +endobj +54 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàÚœ‰sXP@aDtÕåv»Fëqíry«âÈepõÛ(Tã“8Sr‚ ¦ †¸ÆûJÉ”-+æí+hì³=²endstream +endobj +55 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà_„ïòínË®g{ÄX+!· +ƀ؂ú~)ò/;8I-t¤3Nûb·?w݉ÈÀú¬_ó:§Ä??ÏR„VÃéendstream +endobj +56 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà«¡Ì÷qNPß\žÁò j'(n8t‡‡ÊR|ÙÇœ¤úÆ‹çWBæ«? µåòÅp ±ª>r…9l:psendstream +endobj +57 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàUŸ- ‚ D£sÊA”4?PÇü¾fË®F@vœx´Â#¡nó×Ðõøá¹Ã¡§Œ‰‚”jJã͵endstream +endobj +58 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàÇdggýjî´ÇÅKu_¢ªî¶!¢™ø÷S‘7EßeÍ$2ߘ‘ ´RÊÊ-‰B2Û=Ëj’öPþ'·gûpendstream +endobj +59 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà×óöcRÜގؽ¥iG9p~Ìþñ­©ƒŠÛCMt=“RqâIQPèÄ´÷cÄ.Ž«îu? $‰¥üendstream +endobj +60 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà4{êIŒK Ï^Ï‘çÊÅü’Ê é‰?ú £SÁ‘Iò¬h‚­! +cd£f‹õS¨ëz´-F¶yÎ]D a +endstream +endobj +61 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà‘U´ôⵊ'quà9ÛêE_X‘Š2?÷oƒ}ñüŸ“µP²Ý|ö$8–5¡vÉN1êñ!…mkNûGËêkendstream +endobj +62 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàR_Úù¿ÑÔÊ&åçNý¶½ú +¿sÒ9å.±Ö±ãw™ÐïÁ-)«2o{ÎT]¦ rŸåÞØùÑ'K:N‡´,ž endstream +endobj +63 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàÚ¬à™X6‚ãÙë2‰VíVò½¨s¬±Ü‡|‡±ã~ôžÉæúùMgO_ž÷ù:'z)¤ñeÞ %ñ©Rºendstream +endobj +64 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà£ðŸ ^¾…ÖX€K,~y¼ÑBˇ»ýeW»óñPË"Op°{—ÍV'IrHöÁÝl}À‡í¤íxœÜ,DÌõ>¦endstream +endobj +65 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà-ÒD)A3½N¡ÔØÝÜKÇ‹Ÿ›{3¦.Xž/ƒWQä0¨û ©¼s;Œ=u è¢O €é¦ +bШ}µF)endstream +endobj +66 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàH}:¿‰ŽèçáÀäz(Mph8,çŸ Æ´‡´ò]Ð $‹¼ùL„Q@âë$;YÙ/Ž»œ¶`âÏendstream +endobj +67 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàÅb^šQp/¹Íðh¥~Ûë.€†Ê«=!veÔàot™G¦*4o²¾‹ÈߣЩn¥îÙÖu}á7§Dendstream +endobj +68 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒà°ØõüWK2L‘ÜÔ—J„_Øc$)iB²& ËÝM•è]‘¦Øú¥MvåfÊJ8:V”kϧövE*ñ0ôendstream +endobj +69 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàp ^±íØàg´² ’°©d6']‘p„Q÷붬;éuûæ*}òÜ&l"‚¿²‰‹Ý–˜"D«/1ÐôÚUÿ1endstream +endobj +70 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàY§Çú¡Œªÿú®½ø—î 2î8.ÄEÔë&rͨu#…Å)ns^¯`‚±'±•Ã©:y¹ÛE.ï ™Ôendstream +endobj +71 0 obj +<< /Filter /FlateDecode /Length 80 >> +stream +*8FTbp~Œš¨¶ÄÒàÏÈê9ĉa•ù®M³òFx÷›GÂxÿ´~¬s\‰õÕ›JŸ\V„›ð Êî=…BcEêóÑEoEendstream +endobj +72 0 obj +<< /Count -2 /Dest [ 20 0 R /FitV 100 ] /First 76 0 R /Last 77 0 R /Next 73 0 R /Parent 38 0 R /Title <0e1c2a38465462707e8c9aa8b6c4d2e07c76f6fcecead465c803262ea791484b04c51c26159b59425907bcc42e1be548> /Type /Outline >> +endobj +73 0 obj +<< /Count 1 /Dest [ 20 0 R /XYZ null null null ] /First 78 0 R /Last 78 0 R /Parent 38 0 R /Prev 72 0 R /Title <0e1c2a38465462707e8c9aa8b6c4d2e00ecc6b31415d55a1de00b0903aeaad8c731ac82890762caeaafc79be29e82ffb4691d98b5d4d3cb09a4b4039f2998101> /Type /Outline >> +endobj +74 0 obj +<< /Dest [ 9 0 R /FitR 66 714 180 770 ] /Next 75 0 R /Parent 39 0 R /Title <0e1c2a38465462707e8c9aa8b6c4d2e039e9f7d0e37272d3b044d6d3b507bdb1998c19b21c89a1744fa9237eeece598e6eec369f7c3a8499c611dbd9c816132d> /Type /Outline >> +endobj +75 0 obj +<< /Dest [ 8 0 R /XYZ null null null ] /Parent 39 0 R /Prev 74 0 R /Title <0e1c2a38465462707e8c9aa8b6c4d2e04d5f590b78857cf339220d36761f4a713eec4515820b51b71a1ef5c342350c34cc1cf169ba36ea4d5bfd2d091d9b2205> /Type /Outline >> +endobj +76 0 obj +<< /Dest [ 26 0 R /XYZ null null null ] /Next 77 0 R /Parent 72 0 R /Title <0e1c2a38465462707e8c9aa8b6c4d2e0574eadbdf1cacfaa4d10c6db42bba8a7787fed0d573c3da76ade6b526ece9d5ef1d82645e02cd7e9927a49c6bbec87f1> /Type /Outline >> +endobj +77 0 obj +<< /Dest [ 27 0 R /XYZ null null null ] /Parent 72 0 R /Prev 76 0 R /Title <0e1c2a38465462707e8c9aa8b6c4d2e0fa2fa2ce18f2e66b9047bb8c62213738cbb5f5467f1d81f21aa746aeefef585601e35e5915b8cf99a095f615d866824b> /Type /Outline >> +endobj +78 0 obj +<< /Dest [ 30 0 R /XYZ null null null ] /Parent 73 0 R /Title <0e1c2a38465462707e8c9aa8b6c4d2e0a57e63f459f8a8428dfc859f799038f972379574e01ef823841a76dbefaa14665223960437217436968f6261cc32feb9> /Type /Outline >> +endobj +79 0 obj +<< /CF << /StdCF << /AuthEvent /DocOpen /CFM /AESV2 >> >> /Filter /Standard /Length 128 /O <36451bd39d753b7c1d10922c28e6665aa4f3353fb0348b536893e3b1db5c579b> /P -4 /R 4 /StmF /StdCF /StrF /StdCF /U <32c27288b9ec6a4fab94e6188828595c0122456a91bae5134273a6db134c87c4> /V 4 >> +endobj +xref +0 80 +0000000000 65535 f +0000000015 00000 n +0000000634 00000 n +0000000876 00000 n +0000001313 00000 n +0000001384 00000 n +0000001646 00000 n +0000001919 00000 n +0000002118 00000 n +0000002299 00000 n +0000002480 00000 n +0000002662 00000 n +0000002844 00000 n +0000003026 00000 n +0000003208 00000 n +0000003390 00000 n +0000003572 00000 n +0000003754 00000 n +0000003936 00000 n +0000004118 00000 n +0000004300 00000 n +0000004482 00000 n +0000004664 00000 n +0000004846 00000 n +0000005028 00000 n +0000005210 00000 n +0000005392 00000 n +0000005574 00000 n +0000005756 00000 n +0000005938 00000 n +0000006120 00000 n +0000006302 00000 n +0000006484 00000 n +0000006666 00000 n +0000006848 00000 n +0000007030 00000 n +0000007212 00000 n +0000007394 00000 n +0000007576 00000 n +0000007805 00000 n +0000008038 00000 n +0000008189 00000 n +0000008297 00000 n +0000008328 00000 n +0000008479 00000 n +0000008630 00000 n +0000008781 00000 n +0000008932 00000 n +0000009083 00000 n +0000009234 00000 n +0000009385 00000 n +0000009536 00000 n +0000009687 00000 n +0000009838 00000 n +0000009989 00000 n +0000010140 00000 n +0000010291 00000 n +0000010442 00000 n +0000010593 00000 n +0000010744 00000 n +0000010895 00000 n +0000011046 00000 n +0000011197 00000 n +0000011348 00000 n +0000011499 00000 n +0000011650 00000 n +0000011801 00000 n +0000011952 00000 n +0000012103 00000 n +0000012254 00000 n +0000012405 00000 n +0000012556 00000 n +0000012707 00000 n +0000012942 00000 n +0000013218 00000 n +0000013458 00000 n +0000013697 00000 n +0000013937 00000 n +0000014177 00000 n +0000014404 00000 n +trailer << /Info 2 0 R /Root 1 0 R /Size 80 /ID [<66d36a30a97e0f16f39955c6221e0c2a><31415926535897932384626433832795>] /Encrypt 79 0 R >> +startxref +14693 +%%EOF diff --git a/qpdf/qtest/qpdf/V4-clearmeta-encryption.out b/qpdf/qtest/qpdf/V4-clearmeta-encryption.out new file mode 100644 index 0000000..157fb8d --- /dev/null +++ b/qpdf/qtest/qpdf/V4-clearmeta-encryption.out @@ -0,0 +1,15 @@ +R = 4 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +stream encryption method: RC4 +string encryption method: RC4 +file encryption method: RC4 diff --git a/qpdf/qtest/qpdf/V4-clearmeta.pdf b/qpdf/qtest/qpdf/V4-clearmeta.pdf new file mode 100644 index 0000000..01325cc Binary files /dev/null and b/qpdf/qtest/qpdf/V4-clearmeta.pdf differ diff --git a/qpdf/qtest/qpdf/V4-encryption.out b/qpdf/qtest/qpdf/V4-encryption.out new file mode 100644 index 0000000..157fb8d --- /dev/null +++ b/qpdf/qtest/qpdf/V4-encryption.out @@ -0,0 +1,15 @@ +R = 4 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +stream encryption method: RC4 +string encryption method: RC4 +file encryption method: RC4 diff --git a/qpdf/qtest/qpdf/V4.pdf b/qpdf/qtest/qpdf/V4.pdf new file mode 100644 index 0000000..2848782 Binary files /dev/null and b/qpdf/qtest/qpdf/V4.pdf differ diff --git a/qpdf/qtest/qpdf/add-contents.pdf b/qpdf/qtest/qpdf/add-contents.pdf new file mode 100644 index 0000000..06b683a --- /dev/null +++ b/qpdf/qtest/qpdf/add-contents.pdf @@ -0,0 +1,54 @@ +%PDF-1.3 +%¿÷¢þ +1 0 obj +<< /Pages 2 0 R /Type /Catalog >> +endobj +2 0 obj +<< /Count 1 /Kids [ 3 0 R ] /Type /Pages >> +endobj +3 0 obj +<< /Contents [ 4 0 R 5 0 R 6 0 R ] /MediaBox [ 0 0 612 792 ] /Parent 2 0 R /Resources << /Font << /F1 7 0 R >> /ProcSet 8 0 R >> /Type /Page >> +endobj +4 0 obj +<< /Length 37 >> +stream +BT /F1 12 Tf 72 620 Td (Baked) Tj ET +endstream +endobj +5 0 obj +<< /Length 44 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj +6 0 obj +<< /Length 38 >> +stream +BT /F1 18 Tf 72 520 Td (Mashed) Tj ET +endstream +endobj +7 0 obj +<< /BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font >> +endobj +8 0 obj +[ /PDF /Text ] +endobj +xref +0 9 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000123 00000 n +0000000282 00000 n +0000000368 00000 n +0000000461 00000 n +0000000548 00000 n +0000000655 00000 n +trailer << /Root 1 0 R /Size 9 /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] >> +startxref +685 +%%EOF diff --git a/qpdf/qtest/qpdf/aes-forced-check.out b/qpdf/qtest/qpdf/aes-forced-check.out new file mode 100644 index 0000000..a7f3445 --- /dev/null +++ b/qpdf/qtest/qpdf/aes-forced-check.out @@ -0,0 +1,6 @@ +checking b.pdf +PDF Version: 1.4 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/append-page-content-damaged-c-check.out b/qpdf/qtest/qpdf/append-page-content-damaged-c-check.out new file mode 100644 index 0000000..ae557e5 --- /dev/null +++ b/qpdf/qtest/qpdf/append-page-content-damaged-c-check.out @@ -0,0 +1,21 @@ +WARNING: append-page-content-damaged.pdf: file is damaged +WARNING: append-page-content-damaged.pdf: can't find startxref +WARNING: append-page-content-damaged.pdf: Attempting to reconstruct cross-reference table +version: 1.3 +linearized: 0 +encrypted: 0 +warning: append-page-content-damaged.pdf: file is damaged + code: 5 + file: append-page-content-damaged.pdf + pos : 0 + text: file is damaged +warning: append-page-content-damaged.pdf: can't find startxref + code: 5 + file: append-page-content-damaged.pdf + pos : 0 + text: can't find startxref +warning: append-page-content-damaged.pdf: Attempting to reconstruct cross-reference table + code: 5 + file: append-page-content-damaged.pdf + pos : 0 + text: Attempting to reconstruct cross-reference table diff --git a/qpdf/qtest/qpdf/append-page-content-damaged-check.out b/qpdf/qtest/qpdf/append-page-content-damaged-check.out new file mode 100644 index 0000000..b529bc3 --- /dev/null +++ b/qpdf/qtest/qpdf/append-page-content-damaged-check.out @@ -0,0 +1,7 @@ +WARNING: append-page-content-damaged.pdf: file is damaged +WARNING: append-page-content-damaged.pdf: can't find startxref +WARNING: append-page-content-damaged.pdf: Attempting to reconstruct cross-reference table +checking append-page-content-damaged.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized diff --git a/qpdf/qtest/qpdf/append-page-content-damaged.out b/qpdf/qtest/qpdf/append-page-content-damaged.out new file mode 100644 index 0000000..bd4ecfa --- /dev/null +++ b/qpdf/qtest/qpdf/append-page-content-damaged.out @@ -0,0 +1,4 @@ +WARNING: append-page-content-damaged.pdf: file is damaged +WARNING: append-page-content-damaged.pdf: can't find startxref +WARNING: append-page-content-damaged.pdf: Attempting to reconstruct cross-reference table +qpdf: operation succeeded with warnings; resulting file may have some problems diff --git a/qpdf/qtest/qpdf/append-page-content-damaged.pdf b/qpdf/qtest/qpdf/append-page-content-damaged.pdf new file mode 100644 index 0000000..7f15df3 --- /dev/null +++ b/qpdf/qtest/qpdf/append-page-content-damaged.pdf @@ -0,0 +1,1592 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /PageLabels 107 0 R + /Pages 2 0 R + /Type /Catalog + /PageMode /UseOutlines + /Outlines 95 0 R +>> +endobj + +2 0 obj +<< + /Count 30 + /Kids [ + 3 0 R + 4 0 R + 5 0 R + 6 0 R + 7 0 R + 8 0 R + 9 0 R + 10 0 R + 11 0 R + 12 0 R + 13 0 R + 14 0 R + 15 0 R + 16 0 R + 17 0 R + 18 0 R + 19 0 R + 20 0 R + 21 0 R + 22 0 R + 23 0 R + 24 0 R + 25 0 R + 26 0 R + 27 0 R + 28 0 R + 29 0 R + 30 0 R + 31 0 R + 32 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +3 0 obj +<< + /Contents 33 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 2 +4 0 obj +<< + /Contents 37 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 3 +5 0 obj +<< + /Contents 39 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 4 +6 0 obj +<< + /Contents 41 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 5 +7 0 obj +<< + /Contents 43 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 6 +8 0 obj +<< + /Contents 45 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 7 +9 0 obj +<< + /Contents 47 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 8 +10 0 obj +<< + /Contents 49 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 9 +11 0 obj +<< + /Contents 51 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 10 +12 0 obj +<< + /Contents 53 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 11 +13 0 obj +<< + /Contents 55 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 12 +14 0 obj +<< + /Contents 57 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 13 +15 0 obj +<< + /Contents 59 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 14 +16 0 obj +<< + /Contents 61 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 15 +17 0 obj +<< + /Contents 63 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 16 +18 0 obj +<< + /Contents 65 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 17 +19 0 obj +<< + /Contents 67 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 18 +20 0 obj +<< + /Contents 69 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 19 +21 0 obj +<< + /Contents 71 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 20 +22 0 obj +<< + /Contents 73 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 21 +23 0 obj +<< + /Contents 75 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 22 +24 0 obj +<< + /Contents 77 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 23 +25 0 obj +<< + /Contents 79 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 24 +26 0 obj +<< + /Contents 81 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 25 +27 0 obj +<< + /Contents 83 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 26 +28 0 obj +<< + /Contents 85 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 27 +29 0 obj +<< + /Contents 87 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 28 +30 0 obj +<< + /Contents 89 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 29 +31 0 obj +<< + /Contents 91 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 30 +32 0 obj +<< + /Contents 93 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +33 0 obj +<< + /Length 34 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 0) Tj +ET +endstream +endobj + +34 0 obj +46 +endobj + +35 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +36 0 obj +[ + /PDF + /Text +] +endobj + +%% Contents for page 2 +37 0 obj +<< + /Length 38 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 1) Tj +ET +endstream +endobj + +38 0 obj +46 +endobj + +%% Contents for page 3 +39 0 obj +<< + /Length 40 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 2) Tj +ET +endstream +endobj + +40 0 obj +46 +endobj + +%% Contents for page 4 +41 0 obj +<< + /Length 42 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 3) Tj +ET +endstream +endobj + +42 0 obj +46 +endobj + +%% Contents for page 5 +43 0 obj +<< + /Length 44 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 4) Tj +ET +endstream +endobj + +44 0 obj +46 +endobj + +%% Contents for page 6 +45 0 obj +<< + /Length 46 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 5) Tj +ET +endstream +endobj + +46 0 obj +46 +endobj + +%% Contents for page 7 +47 0 obj +<< + /Length 48 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 6) Tj +ET +endstream +endobj + +48 0 obj +46 +endobj + +%% Contents for page 8 +49 0 obj +<< + /Length 50 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 7) Tj +ET +endstream +endobj + +50 0 obj +46 +endobj + +%% Contents for page 9 +51 0 obj +<< + /Length 52 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 8) Tj +ET +endstream +endobj + +52 0 obj +46 +endobj + +%% Contents for page 10 +53 0 obj +<< + /Length 54 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 9) Tj +ET +endstream +endobj + +54 0 obj +46 +endobj + +%% Contents for page 11 +55 0 obj +<< + /Length 56 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 10) Tj +ET +endstream +endobj + +56 0 obj +47 +endobj + +%% Contents for page 12 +57 0 obj +<< + /Length 58 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 11) Tj +ET +endstream +endobj + +58 0 obj +47 +endobj + +%% Contents for page 13 +59 0 obj +<< + /Length 60 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 12) Tj +ET +endstream +endobj + +60 0 obj +47 +endobj + +%% Contents for page 14 +61 0 obj +<< + /Length 62 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 13) Tj +ET +endstream +endobj + +62 0 obj +47 +endobj + +%% Contents for page 15 +63 0 obj +<< + /Length 64 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 14) Tj +ET +endstream +endobj + +64 0 obj +47 +endobj + +%% Contents for page 16 +65 0 obj +<< + /Length 66 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 15) Tj +ET +endstream +endobj + +66 0 obj +47 +endobj + +%% Contents for page 17 +67 0 obj +<< + /Length 68 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 16) Tj +ET +endstream +endobj + +68 0 obj +47 +endobj + +%% Contents for page 18 +69 0 obj +<< + /Length 70 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 17) Tj +ET +endstream +endobj + +70 0 obj +47 +endobj + +%% Contents for page 19 +71 0 obj +<< + /Length 72 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 18) Tj +ET +endstream +endobj + +72 0 obj +47 +endobj + +%% Contents for page 20 +73 0 obj +<< + /Length 74 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 19) Tj +ET +endstream +endobj + +74 0 obj +47 +endobj + +%% Contents for page 21 +75 0 obj +<< + /Length 76 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 20) Tj +ET +endstream +endobj + +76 0 obj +47 +endobj + +%% Contents for page 22 +77 0 obj +<< + /Length 78 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 21) Tj +ET +endstream +endobj + +78 0 obj +47 +endobj + +%% Contents for page 23 +79 0 obj +<< + /Length 80 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 22) Tj +ET +endstream +endobj + +80 0 obj +47 +endobj + +%% Contents for page 24 +81 0 obj +<< + /Length 82 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 23) Tj +ET +endstream +endobj + +82 0 obj +47 +endobj + +%% Contents for page 25 +83 0 obj +<< + /Length 84 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 24) Tj +ET +endstream +endobj + +84 0 obj +47 +endobj + +%% Contents for page 26 +85 0 obj +<< + /Length 86 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 25) Tj +ET +endstream +endobj + +86 0 obj +47 +endobj + +%% Contents for page 27 +87 0 obj +<< + /Length 88 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 26) Tj +ET +endstream +endobj + +88 0 obj +47 +endobj + +%% Contents for page 28 +89 0 obj +<< + /Length 90 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 27) Tj +ET +endstream +endobj + +90 0 obj +47 +endobj + +%% Contents for page 29 +91 0 obj +<< + /Length 92 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 28) Tj +ET +endstream +endobj + +92 0 obj +47 +endobj + +%% Contents for page 30 +93 0 obj +<< + /Length 94 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 29) Tj +ET +endstream +endobj + +94 0 obj +47 +endobj + +95 0 obj +<< + /Type /Outlines + /First 96 0 R + /Last 97 0 R + /Count 6 +>> +endobj + +96 0 obj +<< + /Type /Outline + /Title (Isís 1 -> 5: /XYZ null null null) + /Parent 95 0 R + /Count 4 + /Next 97 0 R + /First 98 0 R + /Last 99 0 R + /Dest [ 8 0 R /XYZ null null null ] +>> +endobj + +97 0 obj +<< + /Type /Outline + /Title (Trepak 2 -> 15: /XYZ 66 756 3) + /Parent 95 0 R + /Prev 96 0 R + /Dest [ 18 0 R /XYZ 66 756 3 ] +>> +endobj + +98 0 obj +<< + /Type /Outline + /Title (Amanda 1.1 -> 11: /Fit) + /Parent 96 0 R + /Next 99 0 R + /First 100 0 R + /Last 101 0 R + /Count -3 + /Dest [ 14 0 R /Fit ] +>> +endobj + +99 0 obj +<< + /Type /Outline + % /Title (Sandy (Sandy [Greek]) 1.2 -> 13: /FitH 792) + /Title + /Parent 96 0 R + /Prev 98 0 R + /First 105 0 R + /Last 106 0 R + /Count 2 + /Dest [ 16 0 R /FitH 792 ] +>> +endobj + +100 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.1 -> 12: /FitV 100) + /Parent 98 0 R + /Next 101 0 R + /First 102 0 R + /Last 103 0 R + /Count -2 + /Dest [ 15 0 R /FitV 100 ] +>> +endobj + +101 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.2 -> 12: /XYZ null null null) + /Parent 98 0 R + /Prev 100 0 R + /First 104 0 R + /Last 104 0 R + /Count 1 + /Dest [ 15 0 R /XYZ null null null ] +>> +endobj + +102 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.1.1 -> 18: /XYZ null null null) + /Parent 100 0 R + /Next 103 0 R + /Dest [ 21 0 R /XYZ null null null ] +>> +endobj + +103 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.1.2 -> 19: /XYZ null null null) + /Parent 100 0 R + /Prev 102 0 R + /Dest [ 22 0 R /XYZ null null null ] +>> +endobj + +104 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.2.1 -> 22: /XYZ null null null) + /Parent 101 0 R + /Dest [ 25 0 R /XYZ null null null ] +>> +endobj + +105 0 obj +<< + /Type /Outline + /Title (Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770) + /Parent 99 0 R + /Next 106 0 R + /Dest [ 4 0 R /FitR 66 714 180 770 ] +>> +endobj + +106 0 obj +<< + /Type /Outline + /Title (Trepsicle 1.2.2 -> 0: /XYZ null null null) + /Parent 99 0 R + /Prev 105 0 R + /Dest [ 3 0 R /XYZ null null null ] +>> +endobj + +107 0 obj + << /Nums [ + 0 << /P () >> + 2 << /S /r /St 1 >> + 7 << /P () >> + 9 << /S /r /St 6 >> + 11 << /P () >> + 12 << /S /D /St 2 >> + 15 << /S /D /St 6 >> + 19 << /P () >> + 20 << /S /D /St 12 >> + 22 << /S /D /St 16059 >> + 23 << /S /r /St 50 >> + 29 << /S /r /St 54 >> + ] >> +endobj + +xref +0 108 +0000000000 65535 f +0000000025 00000 n +0000000145 00000 n +0000000541 00000 n +0000000746 00000 n +0000000951 00000 n +0000001156 00000 n +0000001361 00000 n +0000001566 00000 n +0000001771 00000 n +0000001976 00000 n +0000002182 00000 n +0000002389 00000 n +0000002596 00000 n +0000002803 00000 n +0000003010 00000 n +0000003217 00000 n +0000003424 00000 n +0000003631 00000 n +0000003838 00000 n +0000004045 00000 n +0000004252 00000 n +0000004459 00000 n +0000004666 00000 n +0000004873 00000 n +0000005080 00000 n +0000005287 00000 n +0000005494 00000 n +0000005701 00000 n +0000005908 00000 n +0000006115 00000 n +0000006322 00000 n +0000006529 00000 n +0000006748 00000 n +0000006851 00000 n +0000006871 00000 n +0000006990 00000 n +0000007049 00000 n +0000007152 00000 n +0000007195 00000 n +0000007298 00000 n +0000007341 00000 n +0000007444 00000 n +0000007487 00000 n +0000007590 00000 n +0000007633 00000 n +0000007736 00000 n +0000007779 00000 n +0000007882 00000 n +0000007925 00000 n +0000008028 00000 n +0000008071 00000 n +0000008174 00000 n +0000008218 00000 n +0000008321 00000 n +0000008365 00000 n +0000008469 00000 n +0000008513 00000 n +0000008617 00000 n +0000008661 00000 n +0000008765 00000 n +0000008809 00000 n +0000008913 00000 n +0000008957 00000 n +0000009061 00000 n +0000009105 00000 n +0000009209 00000 n +0000009253 00000 n +0000009357 00000 n +0000009401 00000 n +0000009505 00000 n +0000009549 00000 n +0000009653 00000 n +0000009697 00000 n +0000009801 00000 n +0000009845 00000 n +0000009949 00000 n +0000009993 00000 n +0000010097 00000 n +0000010141 00000 n +0000010245 00000 n +0000010289 00000 n +0000010393 00000 n +0000010437 00000 n +0000010541 00000 n +0000010585 00000 n +0000010689 00000 n +0000010733 00000 n +0000010837 00000 n +0000010881 00000 n +0000010985 00000 n +0000011029 00000 n +0000011133 00000 n +0000011177 00000 n +0000011281 00000 n +0000011301 00000 n +0000011388 00000 n +0000011584 00000 n +0000011730 00000 n +0000011905 00000 n +0000012258 00000 n +0000012449 00000 n +0000012659 00000 n +0000012828 00000 n +0000012997 00000 n +0000013150 00000 n +0000013319 00000 n +0000013484 00000 n +trailer << + /Root 1 0 R + /Size 108 +>> +startxref +13801 +%%EOF + +% 1. Delete page labels +xref +0 1 +0000000107 65535 f +107 1 +0000000000 00001 f +trailer << /Root 1 0 R /Size 108 /Prev 13801 >> +startxref +16059 +%%EOF + +% 2. Delete outlines, reuse page labels. + +107 1 obj + << /Nums [ + 0 << /P () >> + 2 << /S /D /St 1 >> + 7 << /P () >> + 9 << /S /R /St 6 >> + 11 << /P () >> + 12 << /S /r /St 2 >> + 15 << /S /r /St 6 >> + 19 << /P () >> + 20 << /S /R /St 12 >> + 22 << /S /D /St 16059 >> + 23 << /S /r /St 50 >> + 29 << /S /r /St 54 >> + ] >> +endobj + +% Reuse object 1 with the same generation number. Leave outlines +% there pointing to a deleted object. +1 0 obj +<< + /PageLabels 107 1 R + /Pages 2 0 R + /Type /Catalog + /PageMode /UseOutlines + /Outlines 95 0 R +>> +endobj + +% Reuse object 33 to replace contents for page 1 +33 0 obj +<< + /Length 50 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 0 new) Tj +ET +endstream +endobj + +% Delete object 34 + +xref +0 2 +0000000034 65535 f +0000016648 00000 n +33 2 +0000016817 00000 n +0000000095 00001 f +95 13 +0000000096 00001 f +0000000097 00001 f +0000000098 00001 f +0000000099 00001 f +0000000100 00001 f +0000000101 00001 f +0000000102 00001 f +0000000103 00001 f +0000000104 00001 f +0000000105 00001 f +0000000106 00001 f +0000000000 00001 f +0000016227 00001 n +trailer << /Size 108 /Prev 16059 /Root 1 0 R >> +startxref +oops +%%EOF diff --git a/qpdf/qtest/qpdf/append-page-content-damaged.qdf b/qpdf/qtest/qpdf/append-page-content-damaged.qdf new file mode 100644 index 0000000..d81bd67 --- /dev/null +++ b/qpdf/qtest/qpdf/append-page-content-damaged.qdf @@ -0,0 +1,1614 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /Outlines 2 0 R + /PageLabels 3 0 R + /PageMode /UseOutlines + /Pages 4 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /Count 6 + /First 5 0 R + /Last 6 0 R + /Type /Outlines +>> +endobj + +3 0 obj +<< + /Nums [ + 0 + << + /P () + >> + 2 + << + /S /D + /St 1 + >> + 7 + << + /P () + >> + 9 + << + /S /R + /St 6 + >> + 11 + << + /P () + >> + 12 + << + /S /r + /St 2 + >> + 15 + << + /S /r + /St 6 + >> + 19 + << + /P () + >> + 20 + << + /S /R + /St 12 + >> + 22 + << + /S /D + /St 16059 + >> + 23 + << + /S /r + /St 50 + >> + 29 + << + /S /r + /St 54 + >> + ] +>> +endobj + +4 0 obj +<< + /Count 30 + /Kids [ + 7 0 R + 8 0 R + 9 0 R + 10 0 R + 11 0 R + 12 0 R + 13 0 R + 14 0 R + 15 0 R + 16 0 R + 17 0 R + 18 0 R + 19 0 R + 20 0 R + 21 0 R + 22 0 R + 23 0 R + 24 0 R + 25 0 R + 26 0 R + 27 0 R + 28 0 R + 29 0 R + 30 0 R + 31 0 R + 32 0 R + 33 0 R + 34 0 R + 35 0 R + 36 0 R + ] + /Type /Pages +>> +endobj + +5 0 obj +<< + /Count 4 + /Dest [ + 12 0 R + /XYZ + null + null + null + ] + /First 37 0 R + /Last 38 0 R + /Next 6 0 R + /Parent 2 0 R + /Title (Isís 1 -> 5: /XYZ null null null) + /Type /Outline +>> +endobj + +6 0 obj +<< + /Dest [ + 22 0 R + /XYZ + 66 + 756 + 3 + ] + /Parent 2 0 R + /Prev 5 0 R + /Title (Trepak 2 -> 15: /XYZ 66 756 3) + /Type /Outline +>> +endobj + +%% Page 1 +7 0 obj +<< + /Contents 39 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 2 +8 0 obj +<< + /Contents 43 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 3 +9 0 obj +<< + /Contents 45 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 4 +10 0 obj +<< + /Contents 47 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 5 +11 0 obj +<< + /Contents 49 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 6 +12 0 obj +<< + /Contents 51 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 7 +13 0 obj +<< + /Contents 53 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 8 +14 0 obj +<< + /Contents 55 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 9 +15 0 obj +<< + /Contents 57 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 10 +16 0 obj +<< + /Contents 59 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 11 +17 0 obj +<< + /Contents 61 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 12 +18 0 obj +<< + /Contents 63 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 13 +19 0 obj +<< + /Contents 65 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 14 +20 0 obj +<< + /Contents 67 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 15 +21 0 obj +<< + /Contents 69 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 16 +22 0 obj +<< + /Contents 71 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 17 +23 0 obj +<< + /Contents 73 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 18 +24 0 obj +<< + /Contents 75 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 19 +25 0 obj +<< + /Contents 77 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 20 +26 0 obj +<< + /Contents 79 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 21 +27 0 obj +<< + /Contents 81 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 22 +28 0 obj +<< + /Contents 83 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 23 +29 0 obj +<< + /Contents 85 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 24 +30 0 obj +<< + /Contents 87 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 25 +31 0 obj +<< + /Contents 89 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 26 +32 0 obj +<< + /Contents 91 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 27 +33 0 obj +<< + /Contents 93 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 28 +34 0 obj +<< + /Contents 95 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 29 +35 0 obj +<< + /Contents 97 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +%% Page 30 +36 0 obj +<< + /Contents 99 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 41 0 R + >> + /ProcSet 42 0 R + >> + /Type /Page +>> +endobj + +37 0 obj +<< + /Count -3 + /Dest [ + 18 0 R + /Fit + ] + /First 101 0 R + /Last 102 0 R + /Next 38 0 R + /Parent 5 0 R + /Title (Amanda 1.1 -> 11: /Fit) + /Type /Outline +>> +endobj + +38 0 obj +<< + /Count 2 + /Dest [ + 20 0 R + /FitH + 792 + ] + /First 103 0 R + /Last 104 0 R + /Parent 5 0 R + /Prev 37 0 R + /Title + /Type /Outline +>> +endobj + +%% Contents for page 1 +39 0 obj +<< + /Length 40 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 0 new) Tj +ET +endstream +endobj + +40 0 obj +50 +endobj + +41 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +42 0 obj +[ + /PDF + /Text +] +endobj + +%% Contents for page 2 +43 0 obj +<< + /Length 44 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 1) Tj +ET +endstream +endobj + +44 0 obj +46 +endobj + +%% Contents for page 3 +45 0 obj +<< + /Length 46 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 2) Tj +ET +endstream +endobj + +46 0 obj +46 +endobj + +%% Contents for page 4 +47 0 obj +<< + /Length 48 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 3) Tj +ET +endstream +endobj + +48 0 obj +46 +endobj + +%% Contents for page 5 +49 0 obj +<< + /Length 50 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 4) Tj +ET +endstream +endobj + +50 0 obj +46 +endobj + +%% Contents for page 6 +51 0 obj +<< + /Length 52 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 5) Tj +ET +endstream +endobj + +52 0 obj +46 +endobj + +%% Contents for page 7 +53 0 obj +<< + /Length 54 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 6) Tj +ET +endstream +endobj + +54 0 obj +46 +endobj + +%% Contents for page 8 +55 0 obj +<< + /Length 56 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 7) Tj +ET +endstream +endobj + +56 0 obj +46 +endobj + +%% Contents for page 9 +57 0 obj +<< + /Length 58 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 8) Tj +ET +endstream +endobj + +58 0 obj +46 +endobj + +%% Contents for page 10 +59 0 obj +<< + /Length 60 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 9) Tj +ET +endstream +endobj + +60 0 obj +46 +endobj + +%% Contents for page 11 +61 0 obj +<< + /Length 62 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 10) Tj +ET +endstream +endobj + +62 0 obj +47 +endobj + +%% Contents for page 12 +63 0 obj +<< + /Length 64 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 11) Tj +ET +endstream +endobj + +64 0 obj +47 +endobj + +%% Contents for page 13 +65 0 obj +<< + /Length 66 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 12) Tj +ET +endstream +endobj + +66 0 obj +47 +endobj + +%% Contents for page 14 +67 0 obj +<< + /Length 68 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 13) Tj +ET +endstream +endobj + +68 0 obj +47 +endobj + +%% Contents for page 15 +69 0 obj +<< + /Length 70 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 14) Tj +ET +endstream +endobj + +70 0 obj +47 +endobj + +%% Contents for page 16 +71 0 obj +<< + /Length 72 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 15) Tj +ET +endstream +endobj + +72 0 obj +47 +endobj + +%% Contents for page 17 +73 0 obj +<< + /Length 74 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 16) Tj +ET +endstream +endobj + +74 0 obj +47 +endobj + +%% Contents for page 18 +75 0 obj +<< + /Length 76 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 17) Tj +ET +endstream +endobj + +76 0 obj +47 +endobj + +%% Contents for page 19 +77 0 obj +<< + /Length 78 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 18) Tj +ET +endstream +endobj + +78 0 obj +47 +endobj + +%% Contents for page 20 +79 0 obj +<< + /Length 80 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 19) Tj +ET +endstream +endobj + +80 0 obj +47 +endobj + +%% Contents for page 21 +81 0 obj +<< + /Length 82 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 20) Tj +ET +endstream +endobj + +82 0 obj +47 +endobj + +%% Contents for page 22 +83 0 obj +<< + /Length 84 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 21) Tj +ET +endstream +endobj + +84 0 obj +47 +endobj + +%% Contents for page 23 +85 0 obj +<< + /Length 86 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 22) Tj +ET +endstream +endobj + +86 0 obj +47 +endobj + +%% Contents for page 24 +87 0 obj +<< + /Length 88 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 23) Tj +ET +endstream +endobj + +88 0 obj +47 +endobj + +%% Contents for page 25 +89 0 obj +<< + /Length 90 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 24) Tj +ET +endstream +endobj + +90 0 obj +47 +endobj + +%% Contents for page 26 +91 0 obj +<< + /Length 92 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 25) Tj +ET +endstream +endobj + +92 0 obj +47 +endobj + +%% Contents for page 27 +93 0 obj +<< + /Length 94 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 26) Tj +ET +endstream +endobj + +94 0 obj +47 +endobj + +%% Contents for page 28 +95 0 obj +<< + /Length 96 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 27) Tj +ET +endstream +endobj + +96 0 obj +47 +endobj + +%% Contents for page 29 +97 0 obj +<< + /Length 98 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 28) Tj +ET +endstream +endobj + +98 0 obj +47 +endobj + +%% Contents for page 30 +99 0 obj +<< + /Length 100 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 29) Tj +ET +endstream +endobj + +100 0 obj +47 +endobj + +101 0 obj +<< + /Count -2 + /Dest [ + 19 0 R + /FitV + 100 + ] + /First 105 0 R + /Last 106 0 R + /Next 102 0 R + /Parent 37 0 R + /Title (Isosicle 1.1.1 -> 12: /FitV 100) + /Type /Outline +>> +endobj + +102 0 obj +<< + /Count 1 + /Dest [ + 19 0 R + /XYZ + null + null + null + ] + /First 107 0 R + /Last 107 0 R + /Parent 37 0 R + /Prev 101 0 R + /Title (Isosicle 1.1.2 -> 12: /XYZ null null null) + /Type /Outline +>> +endobj + +103 0 obj +<< + /Dest [ + 8 0 R + /FitR + 66 + 714 + 180 + 770 + ] + /Next 104 0 R + /Parent 38 0 R + /Title (Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770) + /Type /Outline +>> +endobj + +104 0 obj +<< + /Dest [ + 7 0 R + /XYZ + null + null + null + ] + /Parent 38 0 R + /Prev 103 0 R + /Title (Trepsicle 1.2.2 -> 0: /XYZ null null null) + /Type /Outline +>> +endobj + +105 0 obj +<< + /Dest [ + 25 0 R + /XYZ + null + null + null + ] + /Next 106 0 R + /Parent 101 0 R + /Title (Isosicle 1.1.1.1 -> 18: /XYZ null null null) + /Type /Outline +>> +endobj + +106 0 obj +<< + /Dest [ + 26 0 R + /XYZ + null + null + null + ] + /Parent 101 0 R + /Prev 105 0 R + /Title (Isosicle 1.1.1.2 -> 19: /XYZ null null null) + /Type /Outline +>> +endobj + +107 0 obj +<< + /Dest [ + 29 0 R + /XYZ + null + null + null + ] + /Parent 102 0 R + /Title (Isosicle 1.1.2.1 -> 22: /XYZ null null null) + /Type /Outline +>> +endobj + +xref +0 108 +0000000000 65535 f +0000000025 00000 n +0000000142 00000 n +0000000222 00000 n +0000000753 00000 n +0000001143 00000 n +0000001359 00000 n +0000001534 00000 n +0000001739 00000 n +0000001944 00000 n +0000002149 00000 n +0000002355 00000 n +0000002561 00000 n +0000002767 00000 n +0000002973 00000 n +0000003179 00000 n +0000003386 00000 n +0000003593 00000 n +0000003800 00000 n +0000004007 00000 n +0000004214 00000 n +0000004421 00000 n +0000004628 00000 n +0000004835 00000 n +0000005042 00000 n +0000005249 00000 n +0000005456 00000 n +0000005663 00000 n +0000005870 00000 n +0000006077 00000 n +0000006284 00000 n +0000006491 00000 n +0000006698 00000 n +0000006905 00000 n +0000007112 00000 n +0000007319 00000 n +0000007526 00000 n +0000007722 00000 n +0000007906 00000 n +0000008239 00000 n +0000008346 00000 n +0000008366 00000 n +0000008485 00000 n +0000008544 00000 n +0000008647 00000 n +0000008690 00000 n +0000008793 00000 n +0000008836 00000 n +0000008939 00000 n +0000008982 00000 n +0000009085 00000 n +0000009128 00000 n +0000009231 00000 n +0000009274 00000 n +0000009377 00000 n +0000009420 00000 n +0000009523 00000 n +0000009566 00000 n +0000009669 00000 n +0000009713 00000 n +0000009816 00000 n +0000009860 00000 n +0000009964 00000 n +0000010008 00000 n +0000010112 00000 n +0000010156 00000 n +0000010260 00000 n +0000010304 00000 n +0000010408 00000 n +0000010452 00000 n +0000010556 00000 n +0000010600 00000 n +0000010704 00000 n +0000010748 00000 n +0000010852 00000 n +0000010896 00000 n +0000011000 00000 n +0000011044 00000 n +0000011148 00000 n +0000011192 00000 n +0000011296 00000 n +0000011340 00000 n +0000011444 00000 n +0000011488 00000 n +0000011592 00000 n +0000011636 00000 n +0000011740 00000 n +0000011784 00000 n +0000011888 00000 n +0000011932 00000 n +0000012036 00000 n +0000012080 00000 n +0000012184 00000 n +0000012228 00000 n +0000012332 00000 n +0000012376 00000 n +0000012480 00000 n +0000012524 00000 n +0000012628 00000 n +0000012672 00000 n +0000012777 00000 n +0000012798 00000 n +0000013003 00000 n +0000013235 00000 n +0000013430 00000 n +0000013617 00000 n +0000013808 00000 n +0000013999 00000 n +trailer << + /Root 1 0 R + /Size 108 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +startxref +14174 +%%EOF diff --git a/qpdf/qtest/qpdf/append-page-content-good.qdf b/qpdf/qtest/qpdf/append-page-content-good.qdf new file mode 100644 index 0000000..7f11503 --- /dev/null +++ b/qpdf/qtest/qpdf/append-page-content-good.qdf @@ -0,0 +1,1408 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /PageLabels 2 0 R + /PageMode /UseOutlines + /Pages 3 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /Nums [ + 0 + << + /P () + >> + 2 + << + /S /D + /St 1 + >> + 7 + << + /P () + >> + 9 + << + /S /R + /St 6 + >> + 11 + << + /P () + >> + 12 + << + /S /r + /St 2 + >> + 15 + << + /S /r + /St 6 + >> + 19 + << + /P () + >> + 20 + << + /S /R + /St 12 + >> + 22 + << + /S /D + /St 16059 + >> + 23 + << + /S /r + /St 50 + >> + 29 + << + /S /r + /St 54 + >> + ] +>> +endobj + +3 0 obj +<< + /Count 30 + /Kids [ + 4 0 R + 5 0 R + 6 0 R + 7 0 R + 8 0 R + 9 0 R + 10 0 R + 11 0 R + 12 0 R + 13 0 R + 14 0 R + 15 0 R + 16 0 R + 17 0 R + 18 0 R + 19 0 R + 20 0 R + 21 0 R + 22 0 R + 23 0 R + 24 0 R + 25 0 R + 26 0 R + 27 0 R + 28 0 R + 29 0 R + 30 0 R + 31 0 R + 32 0 R + 33 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +4 0 obj +<< + /Contents 34 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 2 +5 0 obj +<< + /Contents 38 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 3 +6 0 obj +<< + /Contents 40 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 4 +7 0 obj +<< + /Contents 42 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 5 +8 0 obj +<< + /Contents 44 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 6 +9 0 obj +<< + /Contents 46 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 7 +10 0 obj +<< + /Contents 48 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 8 +11 0 obj +<< + /Contents 50 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 9 +12 0 obj +<< + /Contents 52 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 10 +13 0 obj +<< + /Contents 54 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 11 +14 0 obj +<< + /Contents 56 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 12 +15 0 obj +<< + /Contents 58 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 13 +16 0 obj +<< + /Contents 60 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 14 +17 0 obj +<< + /Contents 62 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 15 +18 0 obj +<< + /Contents 64 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 16 +19 0 obj +<< + /Contents 66 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 17 +20 0 obj +<< + /Contents 68 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 18 +21 0 obj +<< + /Contents 70 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 19 +22 0 obj +<< + /Contents 72 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 20 +23 0 obj +<< + /Contents 74 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 21 +24 0 obj +<< + /Contents 76 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 22 +25 0 obj +<< + /Contents 78 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 23 +26 0 obj +<< + /Contents 80 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 24 +27 0 obj +<< + /Contents 82 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 25 +28 0 obj +<< + /Contents 84 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 26 +29 0 obj +<< + /Contents 86 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 27 +30 0 obj +<< + /Contents 88 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 28 +31 0 obj +<< + /Contents 90 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 29 +32 0 obj +<< + /Contents 92 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 30 +33 0 obj +<< + /Contents 94 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +34 0 obj +<< + /Length 35 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 0 new) Tj +ET +endstream +endobj + +35 0 obj +50 +endobj + +36 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +37 0 obj +[ + /PDF + /Text +] +endobj + +%% Contents for page 2 +38 0 obj +<< + /Length 39 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 1) Tj +ET +endstream +endobj + +39 0 obj +46 +endobj + +%% Contents for page 3 +40 0 obj +<< + /Length 41 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 2) Tj +ET +endstream +endobj + +41 0 obj +46 +endobj + +%% Contents for page 4 +42 0 obj +<< + /Length 43 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 3) Tj +ET +endstream +endobj + +43 0 obj +46 +endobj + +%% Contents for page 5 +44 0 obj +<< + /Length 45 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 4) Tj +ET +endstream +endobj + +45 0 obj +46 +endobj + +%% Contents for page 6 +46 0 obj +<< + /Length 47 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 5) Tj +ET +endstream +endobj + +47 0 obj +46 +endobj + +%% Contents for page 7 +48 0 obj +<< + /Length 49 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 6) Tj +ET +endstream +endobj + +49 0 obj +46 +endobj + +%% Contents for page 8 +50 0 obj +<< + /Length 51 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 7) Tj +ET +endstream +endobj + +51 0 obj +46 +endobj + +%% Contents for page 9 +52 0 obj +<< + /Length 53 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 8) Tj +ET +endstream +endobj + +53 0 obj +46 +endobj + +%% Contents for page 10 +54 0 obj +<< + /Length 55 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 9) Tj +ET +endstream +endobj + +55 0 obj +46 +endobj + +%% Contents for page 11 +56 0 obj +<< + /Length 57 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 10) Tj +ET +endstream +endobj + +57 0 obj +47 +endobj + +%% Contents for page 12 +58 0 obj +<< + /Length 59 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 11) Tj +ET +endstream +endobj + +59 0 obj +47 +endobj + +%% Contents for page 13 +60 0 obj +<< + /Length 61 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 12) Tj +ET +endstream +endobj + +61 0 obj +47 +endobj + +%% Contents for page 14 +62 0 obj +<< + /Length 63 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 13) Tj +ET +endstream +endobj + +63 0 obj +47 +endobj + +%% Contents for page 15 +64 0 obj +<< + /Length 65 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 14) Tj +ET +endstream +endobj + +65 0 obj +47 +endobj + +%% Contents for page 16 +66 0 obj +<< + /Length 67 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 15) Tj +ET +endstream +endobj + +67 0 obj +47 +endobj + +%% Contents for page 17 +68 0 obj +<< + /Length 69 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 16) Tj +ET +endstream +endobj + +69 0 obj +47 +endobj + +%% Contents for page 18 +70 0 obj +<< + /Length 71 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 17) Tj +ET +endstream +endobj + +71 0 obj +47 +endobj + +%% Contents for page 19 +72 0 obj +<< + /Length 73 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 18) Tj +ET +endstream +endobj + +73 0 obj +47 +endobj + +%% Contents for page 20 +74 0 obj +<< + /Length 75 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 19) Tj +ET +endstream +endobj + +75 0 obj +47 +endobj + +%% Contents for page 21 +76 0 obj +<< + /Length 77 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 20) Tj +ET +endstream +endobj + +77 0 obj +47 +endobj + +%% Contents for page 22 +78 0 obj +<< + /Length 79 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 21) Tj +ET +endstream +endobj + +79 0 obj +47 +endobj + +%% Contents for page 23 +80 0 obj +<< + /Length 81 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 22) Tj +ET +endstream +endobj + +81 0 obj +47 +endobj + +%% Contents for page 24 +82 0 obj +<< + /Length 83 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 23) Tj +ET +endstream +endobj + +83 0 obj +47 +endobj + +%% Contents for page 25 +84 0 obj +<< + /Length 85 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 24) Tj +ET +endstream +endobj + +85 0 obj +47 +endobj + +%% Contents for page 26 +86 0 obj +<< + /Length 87 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 25) Tj +ET +endstream +endobj + +87 0 obj +47 +endobj + +%% Contents for page 27 +88 0 obj +<< + /Length 89 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 26) Tj +ET +endstream +endobj + +89 0 obj +47 +endobj + +%% Contents for page 28 +90 0 obj +<< + /Length 91 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 27) Tj +ET +endstream +endobj + +91 0 obj +47 +endobj + +%% Contents for page 29 +92 0 obj +<< + /Length 93 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 28) Tj +ET +endstream +endobj + +93 0 obj +47 +endobj + +%% Contents for page 30 +94 0 obj +<< + /Length 95 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 29) Tj +ET +endstream +endobj + +95 0 obj +47 +endobj + +xref +0 96 +0000000000 65535 f +0000000025 00000 n +0000000124 00000 n +0000000655 00000 n +0000001052 00000 n +0000001257 00000 n +0000001462 00000 n +0000001667 00000 n +0000001872 00000 n +0000002077 00000 n +0000002282 00000 n +0000002488 00000 n +0000002694 00000 n +0000002901 00000 n +0000003108 00000 n +0000003315 00000 n +0000003522 00000 n +0000003729 00000 n +0000003936 00000 n +0000004143 00000 n +0000004350 00000 n +0000004557 00000 n +0000004764 00000 n +0000004971 00000 n +0000005178 00000 n +0000005385 00000 n +0000005592 00000 n +0000005799 00000 n +0000006006 00000 n +0000006213 00000 n +0000006420 00000 n +0000006627 00000 n +0000006834 00000 n +0000007041 00000 n +0000007260 00000 n +0000007367 00000 n +0000007387 00000 n +0000007506 00000 n +0000007565 00000 n +0000007668 00000 n +0000007711 00000 n +0000007814 00000 n +0000007857 00000 n +0000007960 00000 n +0000008003 00000 n +0000008106 00000 n +0000008149 00000 n +0000008252 00000 n +0000008295 00000 n +0000008398 00000 n +0000008441 00000 n +0000008544 00000 n +0000008587 00000 n +0000008690 00000 n +0000008734 00000 n +0000008837 00000 n +0000008881 00000 n +0000008985 00000 n +0000009029 00000 n +0000009133 00000 n +0000009177 00000 n +0000009281 00000 n +0000009325 00000 n +0000009429 00000 n +0000009473 00000 n +0000009577 00000 n +0000009621 00000 n +0000009725 00000 n +0000009769 00000 n +0000009873 00000 n +0000009917 00000 n +0000010021 00000 n +0000010065 00000 n +0000010169 00000 n +0000010213 00000 n +0000010317 00000 n +0000010361 00000 n +0000010465 00000 n +0000010509 00000 n +0000010613 00000 n +0000010657 00000 n +0000010761 00000 n +0000010805 00000 n +0000010909 00000 n +0000010953 00000 n +0000011057 00000 n +0000011101 00000 n +0000011205 00000 n +0000011249 00000 n +0000011353 00000 n +0000011397 00000 n +0000011501 00000 n +0000011545 00000 n +0000011649 00000 n +0000011693 00000 n +0000011797 00000 n +trailer << + /Root 1 0 R + /Size 96 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +startxref +11817 +%%EOF diff --git a/qpdf/qtest/qpdf/append-page-content.pdf b/qpdf/qtest/qpdf/append-page-content.pdf new file mode 100644 index 0000000..38fd28f --- /dev/null +++ b/qpdf/qtest/qpdf/append-page-content.pdf @@ -0,0 +1,1592 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /PageLabels 107 0 R + /Pages 2 0 R + /Type /Catalog + /PageMode /UseOutlines + /Outlines 95 0 R +>> +endobj + +2 0 obj +<< + /Count 30 + /Kids [ + 3 0 R + 4 0 R + 5 0 R + 6 0 R + 7 0 R + 8 0 R + 9 0 R + 10 0 R + 11 0 R + 12 0 R + 13 0 R + 14 0 R + 15 0 R + 16 0 R + 17 0 R + 18 0 R + 19 0 R + 20 0 R + 21 0 R + 22 0 R + 23 0 R + 24 0 R + 25 0 R + 26 0 R + 27 0 R + 28 0 R + 29 0 R + 30 0 R + 31 0 R + 32 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +3 0 obj +<< + /Contents 33 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 2 +4 0 obj +<< + /Contents 37 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 3 +5 0 obj +<< + /Contents 39 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 4 +6 0 obj +<< + /Contents 41 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 5 +7 0 obj +<< + /Contents 43 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 6 +8 0 obj +<< + /Contents 45 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 7 +9 0 obj +<< + /Contents 47 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 8 +10 0 obj +<< + /Contents 49 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 9 +11 0 obj +<< + /Contents 51 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 10 +12 0 obj +<< + /Contents 53 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 11 +13 0 obj +<< + /Contents 55 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 12 +14 0 obj +<< + /Contents 57 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 13 +15 0 obj +<< + /Contents 59 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 14 +16 0 obj +<< + /Contents 61 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 15 +17 0 obj +<< + /Contents 63 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 16 +18 0 obj +<< + /Contents 65 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 17 +19 0 obj +<< + /Contents 67 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 18 +20 0 obj +<< + /Contents 69 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 19 +21 0 obj +<< + /Contents 71 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 20 +22 0 obj +<< + /Contents 73 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 21 +23 0 obj +<< + /Contents 75 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 22 +24 0 obj +<< + /Contents 77 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 23 +25 0 obj +<< + /Contents 79 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 24 +26 0 obj +<< + /Contents 81 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 25 +27 0 obj +<< + /Contents 83 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 26 +28 0 obj +<< + /Contents 85 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 27 +29 0 obj +<< + /Contents 87 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 28 +30 0 obj +<< + /Contents 89 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 29 +31 0 obj +<< + /Contents 91 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 30 +32 0 obj +<< + /Contents 93 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +33 0 obj +<< + /Length 34 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 0) Tj +ET +endstream +endobj + +34 0 obj +46 +endobj + +35 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +36 0 obj +[ + /PDF + /Text +] +endobj + +%% Contents for page 2 +37 0 obj +<< + /Length 38 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 1) Tj +ET +endstream +endobj + +38 0 obj +46 +endobj + +%% Contents for page 3 +39 0 obj +<< + /Length 40 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 2) Tj +ET +endstream +endobj + +40 0 obj +46 +endobj + +%% Contents for page 4 +41 0 obj +<< + /Length 42 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 3) Tj +ET +endstream +endobj + +42 0 obj +46 +endobj + +%% Contents for page 5 +43 0 obj +<< + /Length 44 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 4) Tj +ET +endstream +endobj + +44 0 obj +46 +endobj + +%% Contents for page 6 +45 0 obj +<< + /Length 46 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 5) Tj +ET +endstream +endobj + +46 0 obj +46 +endobj + +%% Contents for page 7 +47 0 obj +<< + /Length 48 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 6) Tj +ET +endstream +endobj + +48 0 obj +46 +endobj + +%% Contents for page 8 +49 0 obj +<< + /Length 50 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 7) Tj +ET +endstream +endobj + +50 0 obj +46 +endobj + +%% Contents for page 9 +51 0 obj +<< + /Length 52 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 8) Tj +ET +endstream +endobj + +52 0 obj +46 +endobj + +%% Contents for page 10 +53 0 obj +<< + /Length 54 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 9) Tj +ET +endstream +endobj + +54 0 obj +46 +endobj + +%% Contents for page 11 +55 0 obj +<< + /Length 56 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 10) Tj +ET +endstream +endobj + +56 0 obj +47 +endobj + +%% Contents for page 12 +57 0 obj +<< + /Length 58 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 11) Tj +ET +endstream +endobj + +58 0 obj +47 +endobj + +%% Contents for page 13 +59 0 obj +<< + /Length 60 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 12) Tj +ET +endstream +endobj + +60 0 obj +47 +endobj + +%% Contents for page 14 +61 0 obj +<< + /Length 62 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 13) Tj +ET +endstream +endobj + +62 0 obj +47 +endobj + +%% Contents for page 15 +63 0 obj +<< + /Length 64 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 14) Tj +ET +endstream +endobj + +64 0 obj +47 +endobj + +%% Contents for page 16 +65 0 obj +<< + /Length 66 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 15) Tj +ET +endstream +endobj + +66 0 obj +47 +endobj + +%% Contents for page 17 +67 0 obj +<< + /Length 68 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 16) Tj +ET +endstream +endobj + +68 0 obj +47 +endobj + +%% Contents for page 18 +69 0 obj +<< + /Length 70 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 17) Tj +ET +endstream +endobj + +70 0 obj +47 +endobj + +%% Contents for page 19 +71 0 obj +<< + /Length 72 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 18) Tj +ET +endstream +endobj + +72 0 obj +47 +endobj + +%% Contents for page 20 +73 0 obj +<< + /Length 74 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 19) Tj +ET +endstream +endobj + +74 0 obj +47 +endobj + +%% Contents for page 21 +75 0 obj +<< + /Length 76 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 20) Tj +ET +endstream +endobj + +76 0 obj +47 +endobj + +%% Contents for page 22 +77 0 obj +<< + /Length 78 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 21) Tj +ET +endstream +endobj + +78 0 obj +47 +endobj + +%% Contents for page 23 +79 0 obj +<< + /Length 80 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 22) Tj +ET +endstream +endobj + +80 0 obj +47 +endobj + +%% Contents for page 24 +81 0 obj +<< + /Length 82 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 23) Tj +ET +endstream +endobj + +82 0 obj +47 +endobj + +%% Contents for page 25 +83 0 obj +<< + /Length 84 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 24) Tj +ET +endstream +endobj + +84 0 obj +47 +endobj + +%% Contents for page 26 +85 0 obj +<< + /Length 86 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 25) Tj +ET +endstream +endobj + +86 0 obj +47 +endobj + +%% Contents for page 27 +87 0 obj +<< + /Length 88 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 26) Tj +ET +endstream +endobj + +88 0 obj +47 +endobj + +%% Contents for page 28 +89 0 obj +<< + /Length 90 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 27) Tj +ET +endstream +endobj + +90 0 obj +47 +endobj + +%% Contents for page 29 +91 0 obj +<< + /Length 92 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 28) Tj +ET +endstream +endobj + +92 0 obj +47 +endobj + +%% Contents for page 30 +93 0 obj +<< + /Length 94 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 29) Tj +ET +endstream +endobj + +94 0 obj +47 +endobj + +95 0 obj +<< + /Type /Outlines + /First 96 0 R + /Last 97 0 R + /Count 6 +>> +endobj + +96 0 obj +<< + /Type /Outline + /Title (Isís 1 -> 5: /XYZ null null null) + /Parent 95 0 R + /Count 4 + /Next 97 0 R + /First 98 0 R + /Last 99 0 R + /Dest [ 8 0 R /XYZ null null null ] +>> +endobj + +97 0 obj +<< + /Type /Outline + /Title (Trepak 2 -> 15: /XYZ 66 756 3) + /Parent 95 0 R + /Prev 96 0 R + /Dest [ 18 0 R /XYZ 66 756 3 ] +>> +endobj + +98 0 obj +<< + /Type /Outline + /Title (Amanda 1.1 -> 11: /Fit) + /Parent 96 0 R + /Next 99 0 R + /First 100 0 R + /Last 101 0 R + /Count -3 + /Dest [ 14 0 R /Fit ] +>> +endobj + +99 0 obj +<< + /Type /Outline + % /Title (Sandy (Sandy [Greek]) 1.2 -> 13: /FitH 792) + /Title + /Parent 96 0 R + /Prev 98 0 R + /First 105 0 R + /Last 106 0 R + /Count 2 + /Dest [ 16 0 R /FitH 792 ] +>> +endobj + +100 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.1 -> 12: /FitV 100) + /Parent 98 0 R + /Next 101 0 R + /First 102 0 R + /Last 103 0 R + /Count -2 + /Dest [ 15 0 R /FitV 100 ] +>> +endobj + +101 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.2 -> 12: /XYZ null null null) + /Parent 98 0 R + /Prev 100 0 R + /First 104 0 R + /Last 104 0 R + /Count 1 + /Dest [ 15 0 R /XYZ null null null ] +>> +endobj + +102 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.1.1 -> 18: /XYZ null null null) + /Parent 100 0 R + /Next 103 0 R + /Dest [ 21 0 R /XYZ null null null ] +>> +endobj + +103 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.1.2 -> 19: /XYZ null null null) + /Parent 100 0 R + /Prev 102 0 R + /Dest [ 22 0 R /XYZ null null null ] +>> +endobj + +104 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.2.1 -> 22: /XYZ null null null) + /Parent 101 0 R + /Dest [ 25 0 R /XYZ null null null ] +>> +endobj + +105 0 obj +<< + /Type /Outline + /Title (Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770) + /Parent 99 0 R + /Next 106 0 R + /Dest [ 4 0 R /FitR 66 714 180 770 ] +>> +endobj + +106 0 obj +<< + /Type /Outline + /Title (Trepsicle 1.2.2 -> 0: /XYZ null null null) + /Parent 99 0 R + /Prev 105 0 R + /Dest [ 3 0 R /XYZ null null null ] +>> +endobj + +107 0 obj + << /Nums [ + 0 << /P () >> + 2 << /S /r /St 1 >> + 7 << /P () >> + 9 << /S /r /St 6 >> + 11 << /P () >> + 12 << /S /D /St 2 >> + 15 << /S /D /St 6 >> + 19 << /P () >> + 20 << /S /D /St 12 >> + 22 << /S /D /St 16059 >> + 23 << /S /r /St 50 >> + 29 << /S /r /St 54 >> + ] >> +endobj + +xref +0 108 +0000000000 65535 f +0000000025 00000 n +0000000145 00000 n +0000000541 00000 n +0000000746 00000 n +0000000951 00000 n +0000001156 00000 n +0000001361 00000 n +0000001566 00000 n +0000001771 00000 n +0000001976 00000 n +0000002182 00000 n +0000002389 00000 n +0000002596 00000 n +0000002803 00000 n +0000003010 00000 n +0000003217 00000 n +0000003424 00000 n +0000003631 00000 n +0000003838 00000 n +0000004045 00000 n +0000004252 00000 n +0000004459 00000 n +0000004666 00000 n +0000004873 00000 n +0000005080 00000 n +0000005287 00000 n +0000005494 00000 n +0000005701 00000 n +0000005908 00000 n +0000006115 00000 n +0000006322 00000 n +0000006529 00000 n +0000006748 00000 n +0000006851 00000 n +0000006871 00000 n +0000006990 00000 n +0000007049 00000 n +0000007152 00000 n +0000007195 00000 n +0000007298 00000 n +0000007341 00000 n +0000007444 00000 n +0000007487 00000 n +0000007590 00000 n +0000007633 00000 n +0000007736 00000 n +0000007779 00000 n +0000007882 00000 n +0000007925 00000 n +0000008028 00000 n +0000008071 00000 n +0000008174 00000 n +0000008218 00000 n +0000008321 00000 n +0000008365 00000 n +0000008469 00000 n +0000008513 00000 n +0000008617 00000 n +0000008661 00000 n +0000008765 00000 n +0000008809 00000 n +0000008913 00000 n +0000008957 00000 n +0000009061 00000 n +0000009105 00000 n +0000009209 00000 n +0000009253 00000 n +0000009357 00000 n +0000009401 00000 n +0000009505 00000 n +0000009549 00000 n +0000009653 00000 n +0000009697 00000 n +0000009801 00000 n +0000009845 00000 n +0000009949 00000 n +0000009993 00000 n +0000010097 00000 n +0000010141 00000 n +0000010245 00000 n +0000010289 00000 n +0000010393 00000 n +0000010437 00000 n +0000010541 00000 n +0000010585 00000 n +0000010689 00000 n +0000010733 00000 n +0000010837 00000 n +0000010881 00000 n +0000010985 00000 n +0000011029 00000 n +0000011133 00000 n +0000011177 00000 n +0000011281 00000 n +0000011301 00000 n +0000011388 00000 n +0000011584 00000 n +0000011730 00000 n +0000011905 00000 n +0000012258 00000 n +0000012449 00000 n +0000012659 00000 n +0000012828 00000 n +0000012997 00000 n +0000013150 00000 n +0000013319 00000 n +0000013484 00000 n +trailer << + /Root 1 0 R + /Size 108 +>> +startxref +13801 +%%EOF + +% 1. Delete page labels +xref +0 1 +0000000107 65535 f +107 1 +0000000000 00001 f +trailer << /Root 1 0 R /Size 108 /Prev 13801 >> +startxref +16059 +%%EOF + +% 2. Delete outlines, reuse page labels. + +107 1 obj + << /Nums [ + 0 << /P () >> + 2 << /S /D /St 1 >> + 7 << /P () >> + 9 << /S /R /St 6 >> + 11 << /P () >> + 12 << /S /r /St 2 >> + 15 << /S /r /St 6 >> + 19 << /P () >> + 20 << /S /R /St 12 >> + 22 << /S /D /St 16059 >> + 23 << /S /r /St 50 >> + 29 << /S /r /St 54 >> + ] >> +endobj + +% Reuse object 1 with the same generation number. Leave outlines +% there pointing to a deleted object. +1 0 obj +<< + /PageLabels 107 1 R + /Pages 2 0 R + /Type /Catalog + /PageMode /UseOutlines + /Outlines 95 0 R +>> +endobj + +% Reuse object 33 to replace contents for page 1 +33 0 obj +<< + /Length 50 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 0 new) Tj +ET +endstream +endobj + +% Delete object 34 + +xref +0 2 +0000000034 65535 f +0000016648 00000 n +33 2 +0000016817 00000 n +0000000095 00001 f +95 13 +0000000096 00001 f +0000000097 00001 f +0000000098 00001 f +0000000099 00001 f +0000000100 00001 f +0000000101 00001 f +0000000102 00001 f +0000000103 00001 f +0000000104 00001 f +0000000105 00001 f +0000000106 00001 f +0000000000 00001 f +0000016227 00001 n +trailer << /Size 108 /Prev 16059 /Root 1 0 R >> +startxref +16940 +%%EOF diff --git a/qpdf/qtest/qpdf/bad1-recover.out b/qpdf/qtest/qpdf/bad1-recover.out new file mode 100644 index 0000000..f89eeb6 --- /dev/null +++ b/qpdf/qtest/qpdf/bad1-recover.out @@ -0,0 +1 @@ +bad1.pdf: not a PDF file diff --git a/qpdf/qtest/qpdf/bad1.out b/qpdf/qtest/qpdf/bad1.out new file mode 100644 index 0000000..f89eeb6 --- /dev/null +++ b/qpdf/qtest/qpdf/bad1.out @@ -0,0 +1 @@ +bad1.pdf: not a PDF file diff --git a/qpdf/qtest/qpdf/bad1.pdf b/qpdf/qtest/qpdf/bad1.pdf new file mode 100644 index 0000000..75891bc --- /dev/null +++ b/qpdf/qtest/qpdf/bad1.pdf @@ -0,0 +1 @@ +oops diff --git a/qpdf/qtest/qpdf/bad10-recover.out b/qpdf/qtest/qpdf/bad10-recover.out new file mode 100644 index 0000000..25de9bc --- /dev/null +++ b/qpdf/qtest/qpdf/bad10-recover.out @@ -0,0 +1,9 @@ +WARNING: bad10.pdf: file is damaged +WARNING: bad10.pdf (trailer, file position 712): /Size key in trailer dictionary is not an integer +WARNING: bad10.pdf: Attempting to reconstruct cross-reference table +/QTest is implicit +/QTest is direct +/QTest is null +unparse: null +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/bad10.out b/qpdf/qtest/qpdf/bad10.out new file mode 100644 index 0000000..2545a72 --- /dev/null +++ b/qpdf/qtest/qpdf/bad10.out @@ -0,0 +1 @@ +bad10.pdf (trailer, file position 712): /Size key in trailer dictionary is not an integer diff --git a/qpdf/qtest/qpdf/bad10.pdf b/qpdf/qtest/qpdf/bad10.pdf new file mode 100644 index 0000000..1f2be0c --- /dev/null +++ b/qpdf/qtest/qpdf/bad10.pdf @@ -0,0 +1,79 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size (h) + /Root 1 0 R +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/bad11-recover.out b/qpdf/qtest/qpdf/bad11-recover.out new file mode 100644 index 0000000..43bcd06 --- /dev/null +++ b/qpdf/qtest/qpdf/bad11-recover.out @@ -0,0 +1,9 @@ +WARNING: bad11.pdf: file is damaged +WARNING: bad11.pdf (trailer, file position 905): /Prev key in trailer dictionary is not an integer +WARNING: bad11.pdf: Attempting to reconstruct cross-reference table +/QTest is implicit +/QTest is direct +/QTest is null +unparse: null +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/bad11.out b/qpdf/qtest/qpdf/bad11.out new file mode 100644 index 0000000..78ad060 --- /dev/null +++ b/qpdf/qtest/qpdf/bad11.out @@ -0,0 +1 @@ +bad11.pdf (trailer, file position 905): /Prev key in trailer dictionary is not an integer diff --git a/qpdf/qtest/qpdf/bad11.pdf b/qpdf/qtest/qpdf/bad11.pdf new file mode 100644 index 0000000..4cf46e5 --- /dev/null +++ b/qpdf/qtest/qpdf/bad11.pdf @@ -0,0 +1,104 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000128 00000 n +0000000300 00000 n +0000000389 00000 n +0000000424 00000 n +trailer << + /Size 7 + /Root 1 0 R +>> +startxref +542 +%%EOF + +4 0 obj +<< + /Length 43 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Salad) Tj +ET +endstream +endobj + +xref +0 1 +0000000000 65535 f +4 1 +0000000750 00000 n +trailer << + /Size 7 + /Root 1 0 R + /Prev [542] +>> +startxref +845 +%%EOF diff --git a/qpdf/qtest/qpdf/bad12-recover.out b/qpdf/qtest/qpdf/bad12-recover.out new file mode 100644 index 0000000..97dfb64 --- /dev/null +++ b/qpdf/qtest/qpdf/bad12-recover.out @@ -0,0 +1,7 @@ +WARNING: bad12.pdf: reported number of objects (9) inconsistent with actual number of objects (8) +/QTest is implicit +/QTest is direct +/QTest is null +unparse: null +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/bad12.out b/qpdf/qtest/qpdf/bad12.out new file mode 100644 index 0000000..d07d74b --- /dev/null +++ b/qpdf/qtest/qpdf/bad12.out @@ -0,0 +1,7 @@ +WARNING: bad12.pdf: reported number of objects (9) inconsistent with actual number of objects (8) +/QTest is implicit +/QTest is direct +/QTest is null +unparse: null +unparseResolved: null +test 0 done diff --git a/qpdf/qtest/qpdf/bad12.pdf b/qpdf/qtest/qpdf/bad12.pdf new file mode 100644 index 0000000..0fc8028 --- /dev/null +++ b/qpdf/qtest/qpdf/bad12.pdf @@ -0,0 +1,122 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000128 00000 n +0000000300 00000 n +0000000389 00000 n +0000000424 00000 n +trailer << + /Size 7 + /Root 1 0 R +>> +startxref +542 +%%EOF + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 7 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +7 0 obj +<< + /Length 48 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Sandwiches) Tj +ET +endstream +endobj + +xref +0 1 +0000000004 65535 f +3 2 +0000000750 00000 n +0000000000 00001 f +7 1 +0000000922 00000 n +trailer << + /Size 9 + /Root 1 0 R + /Prev 542 +>> +startxref +1022 +%%EOF diff --git a/qpdf/qtest/qpdf/bad13-recover.out b/qpdf/qtest/qpdf/bad13-recover.out new file mode 100644 index 0000000..c20d98a --- /dev/null +++ b/qpdf/qtest/qpdf/bad13-recover.out @@ -0,0 +1,4 @@ +WARNING: bad13.pdf: file is damaged +WARNING: bad13.pdf (trailer, file position 753): unexpected brace token +WARNING: bad13.pdf: Attempting to reconstruct cross-reference table +bad13.pdf (trailer, file position 753): unexpected brace token diff --git a/qpdf/qtest/qpdf/bad13.out b/qpdf/qtest/qpdf/bad13.out new file mode 100644 index 0000000..04c34e3 --- /dev/null +++ b/qpdf/qtest/qpdf/bad13.out @@ -0,0 +1 @@ +bad13.pdf (trailer, file position 753): unexpected brace token diff --git a/qpdf/qtest/qpdf/bad13.pdf b/qpdf/qtest/qpdf/bad13.pdf new file mode 100644 index 0000000..2fb59d2 --- /dev/null +++ b/qpdf/qtest/qpdf/bad13.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /Something { +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/bad14-recover.out b/qpdf/qtest/qpdf/bad14-recover.out new file mode 100644 index 0000000..e66441a --- /dev/null +++ b/qpdf/qtest/qpdf/bad14-recover.out @@ -0,0 +1,4 @@ +WARNING: bad14.pdf: file is damaged +WARNING: bad14.pdf (trailer, file position 753): unexpected brace token +WARNING: bad14.pdf: Attempting to reconstruct cross-reference table +bad14.pdf (trailer, file position 753): unexpected brace token diff --git a/qpdf/qtest/qpdf/bad14.out b/qpdf/qtest/qpdf/bad14.out new file mode 100644 index 0000000..6d32b70 --- /dev/null +++ b/qpdf/qtest/qpdf/bad14.out @@ -0,0 +1 @@ +bad14.pdf (trailer, file position 753): unexpected brace token diff --git a/qpdf/qtest/qpdf/bad14.pdf b/qpdf/qtest/qpdf/bad14.pdf new file mode 100644 index 0000000..551fdfd --- /dev/null +++ b/qpdf/qtest/qpdf/bad14.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /Something } +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/bad15-recover.out b/qpdf/qtest/qpdf/bad15-recover.out new file mode 100644 index 0000000..0575a33 --- /dev/null +++ b/qpdf/qtest/qpdf/bad15-recover.out @@ -0,0 +1,4 @@ +WARNING: bad15.pdf: file is damaged +WARNING: bad15.pdf (trailer, file position 753): unexpected array close token +WARNING: bad15.pdf: Attempting to reconstruct cross-reference table +bad15.pdf (trailer, file position 753): unexpected array close token diff --git a/qpdf/qtest/qpdf/bad15.out b/qpdf/qtest/qpdf/bad15.out new file mode 100644 index 0000000..54e799d --- /dev/null +++ b/qpdf/qtest/qpdf/bad15.out @@ -0,0 +1 @@ +bad15.pdf (trailer, file position 753): unexpected array close token diff --git a/qpdf/qtest/qpdf/bad15.pdf b/qpdf/qtest/qpdf/bad15.pdf new file mode 100644 index 0000000..5578e1d --- /dev/null +++ b/qpdf/qtest/qpdf/bad15.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /Something ] +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/bad16-recover.out b/qpdf/qtest/qpdf/bad16-recover.out new file mode 100644 index 0000000..1256cea --- /dev/null +++ b/qpdf/qtest/qpdf/bad16-recover.out @@ -0,0 +1,4 @@ +WARNING: bad16.pdf: file is damaged +WARNING: bad16.pdf (trailer, file position 753): unexpected dictionary close token +WARNING: bad16.pdf: Attempting to reconstruct cross-reference table +bad16.pdf (trailer, file position 753): unexpected dictionary close token diff --git a/qpdf/qtest/qpdf/bad16.out b/qpdf/qtest/qpdf/bad16.out new file mode 100644 index 0000000..d3a7221 --- /dev/null +++ b/qpdf/qtest/qpdf/bad16.out @@ -0,0 +1 @@ +bad16.pdf (trailer, file position 753): unexpected dictionary close token diff --git a/qpdf/qtest/qpdf/bad16.pdf b/qpdf/qtest/qpdf/bad16.pdf new file mode 100644 index 0000000..b8bdb5f --- /dev/null +++ b/qpdf/qtest/qpdf/bad16.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /Something[>> +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/bad17-recover.out b/qpdf/qtest/qpdf/bad17-recover.out new file mode 100644 index 0000000..d09805a --- /dev/null +++ b/qpdf/qtest/qpdf/bad17-recover.out @@ -0,0 +1,4 @@ +WARNING: bad17.pdf: file is damaged +WARNING: bad17.pdf (trailer, file position 753): dictionary ending here has an odd number of elements +WARNING: bad17.pdf: Attempting to reconstruct cross-reference table +bad17.pdf (trailer, file position 753): dictionary ending here has an odd number of elements diff --git a/qpdf/qtest/qpdf/bad17.out b/qpdf/qtest/qpdf/bad17.out new file mode 100644 index 0000000..7285b0a --- /dev/null +++ b/qpdf/qtest/qpdf/bad17.out @@ -0,0 +1 @@ +bad17.pdf (trailer, file position 753): dictionary ending here has an odd number of elements diff --git a/qpdf/qtest/qpdf/bad17.pdf b/qpdf/qtest/qpdf/bad17.pdf new file mode 100644 index 0000000..5afb00d --- /dev/null +++ b/qpdf/qtest/qpdf/bad17.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /Something +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/bad18-recover.out b/qpdf/qtest/qpdf/bad18-recover.out new file mode 100644 index 0000000..b312804 --- /dev/null +++ b/qpdf/qtest/qpdf/bad18-recover.out @@ -0,0 +1,4 @@ +WARNING: bad18.pdf: file is damaged +WARNING: bad18.pdf (trailer, file position 753): unexpected ) +WARNING: bad18.pdf: Attempting to reconstruct cross-reference table +bad18.pdf (trailer, file position 753): unexpected ) diff --git a/qpdf/qtest/qpdf/bad18.out b/qpdf/qtest/qpdf/bad18.out new file mode 100644 index 0000000..b5ea090 --- /dev/null +++ b/qpdf/qtest/qpdf/bad18.out @@ -0,0 +1 @@ +bad18.pdf (trailer, file position 753): unexpected ) diff --git a/qpdf/qtest/qpdf/bad18.pdf b/qpdf/qtest/qpdf/bad18.pdf new file mode 100644 index 0000000..96cf793 --- /dev/null +++ b/qpdf/qtest/qpdf/bad18.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /Something ) +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/bad19-recover.out b/qpdf/qtest/qpdf/bad19-recover.out new file mode 100644 index 0000000..133dcb9 --- /dev/null +++ b/qpdf/qtest/qpdf/bad19-recover.out @@ -0,0 +1,4 @@ +WARNING: bad19.pdf: file is damaged +WARNING: bad19.pdf (trailer, file position 753): unexpected > +WARNING: bad19.pdf: Attempting to reconstruct cross-reference table +bad19.pdf (trailer, file position 753): unexpected > diff --git a/qpdf/qtest/qpdf/bad19.out b/qpdf/qtest/qpdf/bad19.out new file mode 100644 index 0000000..3ff479a --- /dev/null +++ b/qpdf/qtest/qpdf/bad19.out @@ -0,0 +1 @@ +bad19.pdf (trailer, file position 753): unexpected > diff --git a/qpdf/qtest/qpdf/bad19.pdf b/qpdf/qtest/qpdf/bad19.pdf new file mode 100644 index 0000000..f95036f --- /dev/null +++ b/qpdf/qtest/qpdf/bad19.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /Something > +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/bad2-recover.out b/qpdf/qtest/qpdf/bad2-recover.out new file mode 100644 index 0000000..569ca19 --- /dev/null +++ b/qpdf/qtest/qpdf/bad2-recover.out @@ -0,0 +1,9 @@ +WARNING: bad2.pdf: file is damaged +WARNING: bad2.pdf: can't find startxref +WARNING: bad2.pdf: Attempting to reconstruct cross-reference table +/QTest is implicit +/QTest is direct +/QTest is null +unparse: null +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/bad2.out b/qpdf/qtest/qpdf/bad2.out new file mode 100644 index 0000000..9179b77 --- /dev/null +++ b/qpdf/qtest/qpdf/bad2.out @@ -0,0 +1 @@ +bad2.pdf: can't find startxref diff --git a/qpdf/qtest/qpdf/bad2.pdf b/qpdf/qtest/qpdf/bad2.pdf new file mode 100644 index 0000000..aa63b0b --- /dev/null +++ b/qpdf/qtest/qpdf/bad2.pdf @@ -0,0 +1,76 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000128 00000 n +0000000300 00000 n +0000000389 00000 n +0000000424 00000 n +trailer << + /Size 7 + /Root 1 0 R +>> +farbage 542 +%%EOF diff --git a/qpdf/qtest/qpdf/bad20-recover.out b/qpdf/qtest/qpdf/bad20-recover.out new file mode 100644 index 0000000..d9e3566 --- /dev/null +++ b/qpdf/qtest/qpdf/bad20-recover.out @@ -0,0 +1,4 @@ +WARNING: bad20.pdf: file is damaged +WARNING: bad20.pdf (trailer, file position 753): invalid character (q) in hexstring +WARNING: bad20.pdf: Attempting to reconstruct cross-reference table +bad20.pdf (trailer, file position 753): invalid character (q) in hexstring diff --git a/qpdf/qtest/qpdf/bad20.out b/qpdf/qtest/qpdf/bad20.out new file mode 100644 index 0000000..0b70ae1 --- /dev/null +++ b/qpdf/qtest/qpdf/bad20.out @@ -0,0 +1 @@ +bad20.pdf (trailer, file position 753): invalid character (q) in hexstring diff --git a/qpdf/qtest/qpdf/bad20.pdf b/qpdf/qtest/qpdf/bad20.pdf new file mode 100644 index 0000000..e42cfe0 --- /dev/null +++ b/qpdf/qtest/qpdf/bad20.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /Something +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/bad21-recover.out b/qpdf/qtest/qpdf/bad21-recover.out new file mode 100644 index 0000000..73d2e89 --- /dev/null +++ b/qpdf/qtest/qpdf/bad21-recover.out @@ -0,0 +1,4 @@ +WARNING: bad21.pdf: file is damaged +WARNING: bad21.pdf (trailer, file position 742): invalid name token +WARNING: bad21.pdf: Attempting to reconstruct cross-reference table +bad21.pdf (trailer, file position 742): invalid name token diff --git a/qpdf/qtest/qpdf/bad21.out b/qpdf/qtest/qpdf/bad21.out new file mode 100644 index 0000000..055484c --- /dev/null +++ b/qpdf/qtest/qpdf/bad21.out @@ -0,0 +1 @@ +bad21.pdf (trailer, file position 742): invalid name token diff --git a/qpdf/qtest/qpdf/bad21.pdf b/qpdf/qtest/qpdf/bad21.pdf new file mode 100644 index 0000000..4be5f0e --- /dev/null +++ b/qpdf/qtest/qpdf/bad21.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /Som#ething 1 +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/bad22-recover.out b/qpdf/qtest/qpdf/bad22-recover.out new file mode 100644 index 0000000..41eb3e3 --- /dev/null +++ b/qpdf/qtest/qpdf/bad22-recover.out @@ -0,0 +1,21 @@ +WARNING: bad22.pdf (object 4 0, file position 341): attempting to recover stream length +/QTest is indirect +/QTest is a stream. Dictionary: << /Qength 44 >> +Raw stream data: +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET + +Uncompressed stream data: +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET + +End of stream data +unparse: 4 0 R +unparseResolved: 4 0 R +test 1 done diff --git a/qpdf/qtest/qpdf/bad22.out b/qpdf/qtest/qpdf/bad22.out new file mode 100644 index 0000000..ec6d5f8 --- /dev/null +++ b/qpdf/qtest/qpdf/bad22.out @@ -0,0 +1 @@ +bad22.pdf (object 4 0, file position 314): stream dictionary lacks /Length key diff --git a/qpdf/qtest/qpdf/bad22.pdf b/qpdf/qtest/qpdf/bad22.pdf new file mode 100644 index 0000000..b0d42ac --- /dev/null +++ b/qpdf/qtest/qpdf/bad22.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Qength 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /QTest 4 0 R +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/bad23-recover.out b/qpdf/qtest/qpdf/bad23-recover.out new file mode 100644 index 0000000..773205a --- /dev/null +++ b/qpdf/qtest/qpdf/bad23-recover.out @@ -0,0 +1,21 @@ +WARNING: bad23.pdf (object 4 0, file position 341): attempting to recover stream length +/QTest is indirect +/QTest is a stream. Dictionary: << /Length () >> +Raw stream data: +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET + +Uncompressed stream data: +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET + +End of stream data +unparse: 4 0 R +unparseResolved: 4 0 R +test 1 done diff --git a/qpdf/qtest/qpdf/bad23.out b/qpdf/qtest/qpdf/bad23.out new file mode 100644 index 0000000..b4cf25e --- /dev/null +++ b/qpdf/qtest/qpdf/bad23.out @@ -0,0 +1 @@ +bad23.pdf (object 4 0, file position 314): /Length key in stream dictionary is not an integer diff --git a/qpdf/qtest/qpdf/bad23.pdf b/qpdf/qtest/qpdf/bad23.pdf new file mode 100644 index 0000000..0baead9 --- /dev/null +++ b/qpdf/qtest/qpdf/bad23.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length () +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /QTest 4 0 R +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/bad24-recover.out b/qpdf/qtest/qpdf/bad24-recover.out new file mode 100644 index 0000000..0af01e9 --- /dev/null +++ b/qpdf/qtest/qpdf/bad24-recover.out @@ -0,0 +1,2 @@ +WARNING: bad24.pdf (object 4 0, file position 341): attempting to recover stream length +bad24.pdf (object 4 0, file position 341): unable to recover stream data diff --git a/qpdf/qtest/qpdf/bad24.out b/qpdf/qtest/qpdf/bad24.out new file mode 100644 index 0000000..f503214 --- /dev/null +++ b/qpdf/qtest/qpdf/bad24.out @@ -0,0 +1 @@ +bad24.pdf (object 4 0, file position 385): expected endstream diff --git a/qpdf/qtest/qpdf/bad24.pdf b/qpdf/qtest/qpdf/bad24.pdf new file mode 100644 index 0000000..7af8c7d --- /dev/null +++ b/qpdf/qtest/qpdf/bad24.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +enxstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /QTest 4 0 R +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/bad25-recover.out b/qpdf/qtest/qpdf/bad25-recover.out new file mode 100644 index 0000000..23893d5 --- /dev/null +++ b/qpdf/qtest/qpdf/bad25-recover.out @@ -0,0 +1,10 @@ +WARNING: bad25.pdf: file is damaged +WARNING: bad25.pdf (object 4 0, file position 307): expected n n obj +WARNING: bad25.pdf: Attempting to reconstruct cross-reference table +WARNING: bad25.pdf: object 4 0 not found in file after regenerating cross reference table +/QTest is implicit +/QTest is indirect +/QTest is null +unparse: 4 0 R +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/bad25.out b/qpdf/qtest/qpdf/bad25.out new file mode 100644 index 0000000..f336b34 --- /dev/null +++ b/qpdf/qtest/qpdf/bad25.out @@ -0,0 +1 @@ +bad25.pdf (object 4 0, file position 307): expected n n obj diff --git a/qpdf/qtest/qpdf/bad25.pdf b/qpdf/qtest/qpdf/bad25.pdf new file mode 100644 index 0000000..a51974d --- /dev/null +++ b/qpdf/qtest/qpdf/bad25.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +x 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /QTest 4 0 R +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/bad26-recover.out b/qpdf/qtest/qpdf/bad26-recover.out new file mode 100644 index 0000000..248aff7 --- /dev/null +++ b/qpdf/qtest/qpdf/bad26-recover.out @@ -0,0 +1,10 @@ +WARNING: bad26.pdf: file is damaged +WARNING: bad26.pdf (object 4 0, file position 307): expected n n obj +WARNING: bad26.pdf: Attempting to reconstruct cross-reference table +WARNING: bad26.pdf: object 4 0 not found in file after regenerating cross reference table +/QTest is implicit +/QTest is indirect +/QTest is null +unparse: 4 0 R +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/bad26.out b/qpdf/qtest/qpdf/bad26.out new file mode 100644 index 0000000..30c3b72 --- /dev/null +++ b/qpdf/qtest/qpdf/bad26.out @@ -0,0 +1 @@ +bad26.pdf (object 4 0, file position 307): expected n n obj diff --git a/qpdf/qtest/qpdf/bad26.pdf b/qpdf/qtest/qpdf/bad26.pdf new file mode 100644 index 0000000..4a7e3b2 --- /dev/null +++ b/qpdf/qtest/qpdf/bad26.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 x obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /QTest 4 0 R +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/bad27-recover.out b/qpdf/qtest/qpdf/bad27-recover.out new file mode 100644 index 0000000..f06203b --- /dev/null +++ b/qpdf/qtest/qpdf/bad27-recover.out @@ -0,0 +1,10 @@ +WARNING: bad27.pdf: file is damaged +WARNING: bad27.pdf (object 4 0, file position 307): expected n n obj +WARNING: bad27.pdf: Attempting to reconstruct cross-reference table +WARNING: bad27.pdf: object 4 0 not found in file after regenerating cross reference table +/QTest is implicit +/QTest is indirect +/QTest is null +unparse: 4 0 R +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/bad27.out b/qpdf/qtest/qpdf/bad27.out new file mode 100644 index 0000000..2c494e4 --- /dev/null +++ b/qpdf/qtest/qpdf/bad27.out @@ -0,0 +1 @@ +bad27.pdf (object 4 0, file position 307): expected n n obj diff --git a/qpdf/qtest/qpdf/bad27.pdf b/qpdf/qtest/qpdf/bad27.pdf new file mode 100644 index 0000000..032b212 --- /dev/null +++ b/qpdf/qtest/qpdf/bad27.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 xbj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /QTest 4 0 R +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/bad28-recover.out b/qpdf/qtest/qpdf/bad28-recover.out new file mode 100644 index 0000000..62322d9 --- /dev/null +++ b/qpdf/qtest/qpdf/bad28-recover.out @@ -0,0 +1,21 @@ +WARNING: bad28.pdf (object 4 0, file position 395): expected endobj +/QTest is indirect +/QTest is a stream. Dictionary: << /Length 44 >> +Raw stream data: +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET + +Uncompressed stream data: +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET + +End of stream data +unparse: 4 0 R +unparseResolved: 4 0 R +test 1 done diff --git a/qpdf/qtest/qpdf/bad28.out b/qpdf/qtest/qpdf/bad28.out new file mode 100644 index 0000000..11309bc --- /dev/null +++ b/qpdf/qtest/qpdf/bad28.out @@ -0,0 +1,21 @@ +WARNING: bad28.pdf (object 4 0, file position 395): expected endobj +/QTest is indirect +/QTest is a stream. Dictionary: << /Length 44 >> +Raw stream data: +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET + +Uncompressed stream data: +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET + +End of stream data +unparse: 4 0 R +unparseResolved: 4 0 R +test 0 done diff --git a/qpdf/qtest/qpdf/bad28.pdf b/qpdf/qtest/qpdf/bad28.pdf new file mode 100644 index 0000000..c77a206 --- /dev/null +++ b/qpdf/qtest/qpdf/bad28.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +enwobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /QTest 4 0 R +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/bad29-recover.out b/qpdf/qtest/qpdf/bad29-recover.out new file mode 100644 index 0000000..e027db9 --- /dev/null +++ b/qpdf/qtest/qpdf/bad29-recover.out @@ -0,0 +1,4 @@ +WARNING: bad29.pdf: file is damaged +WARNING: bad29.pdf (trailer, file position 742): null character not allowed in name token +WARNING: bad29.pdf: Attempting to reconstruct cross-reference table +bad29.pdf (trailer, file position 742): null character not allowed in name token diff --git a/qpdf/qtest/qpdf/bad29.out b/qpdf/qtest/qpdf/bad29.out new file mode 100644 index 0000000..7d4189e --- /dev/null +++ b/qpdf/qtest/qpdf/bad29.out @@ -0,0 +1 @@ +bad29.pdf (trailer, file position 742): null character not allowed in name token diff --git a/qpdf/qtest/qpdf/bad29.pdf b/qpdf/qtest/qpdf/bad29.pdf new file mode 100644 index 0000000..a45151e --- /dev/null +++ b/qpdf/qtest/qpdf/bad29.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /Som#00ething 1 +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/bad3-recover.out b/qpdf/qtest/qpdf/bad3-recover.out new file mode 100644 index 0000000..e282d66 --- /dev/null +++ b/qpdf/qtest/qpdf/bad3-recover.out @@ -0,0 +1,9 @@ +WARNING: bad3.pdf: file is damaged +WARNING: bad3.pdf (file position 542): xref not found +WARNING: bad3.pdf: Attempting to reconstruct cross-reference table +/QTest is implicit +/QTest is direct +/QTest is null +unparse: null +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/bad3.out b/qpdf/qtest/qpdf/bad3.out new file mode 100644 index 0000000..ef99562 --- /dev/null +++ b/qpdf/qtest/qpdf/bad3.out @@ -0,0 +1 @@ +bad3.pdf (file position 542): xref not found diff --git a/qpdf/qtest/qpdf/bad3.pdf b/qpdf/qtest/qpdf/bad3.pdf new file mode 100644 index 0000000..3e078f3 --- /dev/null +++ b/qpdf/qtest/qpdf/bad3.pdf @@ -0,0 +1,76 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +noxref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000128 00000 n +0000000300 00000 n +0000000389 00000 n +0000000424 00000 n +trailer << + /Size 7 + /Root 1 0 R +>> +startxref 542 +%%EOF diff --git a/qpdf/qtest/qpdf/bad30-recover.out b/qpdf/qtest/qpdf/bad30-recover.out new file mode 100644 index 0000000..515bfbd --- /dev/null +++ b/qpdf/qtest/qpdf/bad30-recover.out @@ -0,0 +1,6 @@ +/QTest is indirect +/QTest is a stream. Dictionary: << /Filter (FlateDecode) /Length 123 >> +Raw stream data: +xœ%11 û¼b;tà4| wXIDì Øå÷8G·«Í>rQ¨uŠ OÒ êEŒ:©IWìÃPlíµII)Ãr´p4~;§ÎAs/òÒ…jcúú¾÷Žs§åözû»žT.?®uŽæ§<Ž¼…Ð*6ä +Uncompressed stream data: +bad30.pdf (file position 629): stream filter type is not name or array diff --git a/qpdf/qtest/qpdf/bad30.out b/qpdf/qtest/qpdf/bad30.out new file mode 100644 index 0000000..515bfbd --- /dev/null +++ b/qpdf/qtest/qpdf/bad30.out @@ -0,0 +1,6 @@ +/QTest is indirect +/QTest is a stream. Dictionary: << /Filter (FlateDecode) /Length 123 >> +Raw stream data: +xœ%11 û¼b;tà4| wXIDì Øå÷8G·«Í>rQ¨uŠ OÒ êEŒ:©IWìÃPlíµII)Ãr´p4~;§ÎAs/òÒ…jcúú¾÷Žs§åözû»žT.?®uŽæ§<Ž¼…Ð*6ä +Uncompressed stream data: +bad30.pdf (file position 629): stream filter type is not name or array diff --git a/qpdf/qtest/qpdf/bad30.pdf b/qpdf/qtest/qpdf/bad30.pdf new file mode 100644 index 0000000..05c5276 --- /dev/null +++ b/qpdf/qtest/qpdf/bad30.pdf @@ -0,0 +1,93 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +7 0 obj +<< + % Comment + /Length + 123 + /Filter (FlateDecode) +>> +stream +xœ%11 û¼b;tà4| wXIDì Øå÷8G·«Í>rQ¨uŠ OÒ êEŒ:©IWìÃPlíµII)Ãr´p4~;§ÎAs/òÒ…jcúú¾÷Žs§åözû»žT.?®uŽæ§<Ž¼…Ð*6ä +endstream +endobj + +xref +0 8 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +0000000556 00000 n +trailer << + /Size 8 + /Root 1 0 R + /QTest 7 0 R +>> +startxref +771 +%%EOF diff --git a/qpdf/qtest/qpdf/bad31-recover.out b/qpdf/qtest/qpdf/bad31-recover.out new file mode 100644 index 0000000..313e208 --- /dev/null +++ b/qpdf/qtest/qpdf/bad31-recover.out @@ -0,0 +1,9 @@ +/QTest is indirect +/QTest is a stream. Dictionary: << /Filter [ /Oink /Moo /FlateDecode ] /Length 123 >> +Raw stream data: +xœ%11 û¼b;tà4| wXIDì Øå÷8G·«Í>rQ¨uŠ OÒ êEŒ:©IWìÃPlíµII)Ãr´p4~;§ÎAs/òÒ…jcúú¾÷Žs§åözû»žT.?®uŽæ§<Ž¼…Ð*6ä +Uncompressed stream data: +Stream data is not filterable. +unparse: 7 0 R +unparseResolved: 7 0 R +test 1 done diff --git a/qpdf/qtest/qpdf/bad31.out b/qpdf/qtest/qpdf/bad31.out new file mode 100644 index 0000000..2ad0153 --- /dev/null +++ b/qpdf/qtest/qpdf/bad31.out @@ -0,0 +1,9 @@ +/QTest is indirect +/QTest is a stream. Dictionary: << /Filter [ /Oink /Moo /FlateDecode ] /Length 123 >> +Raw stream data: +xœ%11 û¼b;tà4| wXIDì Øå÷8G·«Í>rQ¨uŠ OÒ êEŒ:©IWìÃPlíµII)Ãr´p4~;§ÎAs/òÒ…jcúú¾÷Žs§åözû»žT.?®uŽæ§<Ž¼…Ð*6ä +Uncompressed stream data: +Stream data is not filterable. +unparse: 7 0 R +unparseResolved: 7 0 R +test 0 done diff --git a/qpdf/qtest/qpdf/bad31.pdf b/qpdf/qtest/qpdf/bad31.pdf new file mode 100644 index 0000000..b3c986c --- /dev/null +++ b/qpdf/qtest/qpdf/bad31.pdf @@ -0,0 +1,93 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +7 0 obj +<< + % Comment + /Length + 123 + /Filter [/Oink /Moo /FlateDecode] +>> +stream +xœ%11 û¼b;tà4| wXIDì Øå÷8G·«Í>rQ¨uŠ OÒ êEŒ:©IWìÃPlíµII)Ãr´p4~;§ÎAs/òÒ…jcúú¾÷Žs§åözû»žT.?®uŽæ§<Ž¼…Ð*6ä +endstream +endobj + +xref +0 8 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +0000000556 00000 n +trailer << + /Size 8 + /Root 1 0 R + /QTest 7 0 R +>> +startxref +783 +%%EOF diff --git a/qpdf/qtest/qpdf/bad32-recover.out b/qpdf/qtest/qpdf/bad32-recover.out new file mode 100644 index 0000000..c038a29 --- /dev/null +++ b/qpdf/qtest/qpdf/bad32-recover.out @@ -0,0 +1,10 @@ +WARNING: bad32.pdf: file is damaged +WARNING: bad32.pdf (object 4 0, file position 307): expected 4 0 obj +WARNING: bad32.pdf: Attempting to reconstruct cross-reference table +WARNING: bad32.pdf: object 4 0 not found in file after regenerating cross reference table +/QTest is implicit +/QTest is indirect +/QTest is null +unparse: 4 0 R +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/bad32.out b/qpdf/qtest/qpdf/bad32.out new file mode 100644 index 0000000..60727cc --- /dev/null +++ b/qpdf/qtest/qpdf/bad32.out @@ -0,0 +1 @@ +bad32.pdf (object 4 0, file position 307): expected 4 0 obj diff --git a/qpdf/qtest/qpdf/bad32.pdf b/qpdf/qtest/qpdf/bad32.pdf new file mode 100644 index 0000000..2581993 --- /dev/null +++ b/qpdf/qtest/qpdf/bad32.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +9 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /QTest 4 0 R +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/bad33-recover.out b/qpdf/qtest/qpdf/bad33-recover.out new file mode 100644 index 0000000..51dabe6 --- /dev/null +++ b/qpdf/qtest/qpdf/bad33-recover.out @@ -0,0 +1,9 @@ +WARNING: bad33.pdf: file is damaged +WARNING: bad33.pdf (file position 1771): xref not found +WARNING: bad33.pdf: Attempting to reconstruct cross-reference table +/QTest is indirect +/QTest is a stream. Dictionary: << /Filter (FlateDecode) /Length 123 >> +Raw stream data: +xœ%11 û¼b;tà4| wXIDì Øå÷8G·«Í>rQ¨uŠ OÒ êEŒ:©IWìÃPlíµII)Ãr´p4~;§ÎAs/òÒ…jcúú¾÷Žs§åözû»žT.?®uŽæ§<Ž¼…Ð*6ä +Uncompressed stream data: +bad33.pdf (file position 629): stream filter type is not name or array diff --git a/qpdf/qtest/qpdf/bad33.out b/qpdf/qtest/qpdf/bad33.out new file mode 100644 index 0000000..9057b06 --- /dev/null +++ b/qpdf/qtest/qpdf/bad33.out @@ -0,0 +1 @@ +bad33.pdf (file position 1771): xref not found diff --git a/qpdf/qtest/qpdf/bad33.pdf b/qpdf/qtest/qpdf/bad33.pdf new file mode 100644 index 0000000..963d857 --- /dev/null +++ b/qpdf/qtest/qpdf/bad33.pdf @@ -0,0 +1,93 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +7 0 obj +<< + % Comment + /Length + 123 + /Filter (FlateDecode) +>> +stream +xœ%11 û¼b;tà4| wXIDì Øå÷8G·«Í>rQ¨uŠ OÒ êEŒ:©IWìÃPlíµII)Ãr´p4~;§ÎAs/òÒ…jcúú¾÷Žs§åözû»žT.?®uŽæ§<Ž¼…Ð*6ä +endstream +endobj + +xref +0 8 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +0000000556 00000 n +trailer << + /Size 8 + /Root 1 0 R + /QTest 7 0 R +>> +startxref +1771 +%%EOF diff --git a/qpdf/qtest/qpdf/bad34-recover.out b/qpdf/qtest/qpdf/bad34-recover.out new file mode 100644 index 0000000..08cc7bb --- /dev/null +++ b/qpdf/qtest/qpdf/bad34-recover.out @@ -0,0 +1,23 @@ +WARNING: bad34.pdf: file is damaged +WARNING: bad34.pdf (object 4 0, file position 322): expected n n obj +WARNING: bad34.pdf: Attempting to reconstruct cross-reference table +/QTest is indirect +/QTest is a stream. Dictionary: << /Length 44 /Quack 9 0 R >> +Raw stream data: +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET + +Uncompressed stream data: +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET + +End of stream data +unparse: 4 0 R +unparseResolved: 4 0 R +test 1 done diff --git a/qpdf/qtest/qpdf/bad34.out b/qpdf/qtest/qpdf/bad34.out new file mode 100644 index 0000000..ee65e14 --- /dev/null +++ b/qpdf/qtest/qpdf/bad34.out @@ -0,0 +1 @@ +bad34.pdf (object 4 0, file position 322): expected n n obj diff --git a/qpdf/qtest/qpdf/bad34.pdf b/qpdf/qtest/qpdf/bad34.pdf new file mode 100644 index 0000000..6070a5d --- /dev/null +++ b/qpdf/qtest/qpdf/bad34.pdf @@ -0,0 +1,81 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +4 0 obj +<< + /Length 44 + /Quack 9 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000322 00000 n +0000000418 00000 n +0000000453 00000 n +trailer << + /Size 7 + /Root 1 0 R + /QTest 4 0 R +>> +startxref +571 +%%EOF diff --git a/qpdf/qtest/qpdf/bad35-recover.out b/qpdf/qtest/qpdf/bad35-recover.out new file mode 100644 index 0000000..add1666 --- /dev/null +++ b/qpdf/qtest/qpdf/bad35-recover.out @@ -0,0 +1 @@ +bad35.pdf (object 1 0, file position 521): supposed object stream 1 has wrong type diff --git a/qpdf/qtest/qpdf/bad35.out b/qpdf/qtest/qpdf/bad35.out new file mode 100644 index 0000000..add1666 --- /dev/null +++ b/qpdf/qtest/qpdf/bad35.out @@ -0,0 +1 @@ +bad35.pdf (object 1 0, file position 521): supposed object stream 1 has wrong type diff --git a/qpdf/qtest/qpdf/bad35.pdf b/qpdf/qtest/qpdf/bad35.pdf new file mode 100644 index 0000000..799cb09 Binary files /dev/null and b/qpdf/qtest/qpdf/bad35.pdf differ diff --git a/qpdf/qtest/qpdf/bad4-recover.out b/qpdf/qtest/qpdf/bad4-recover.out new file mode 100644 index 0000000..508acea --- /dev/null +++ b/qpdf/qtest/qpdf/bad4-recover.out @@ -0,0 +1,9 @@ +WARNING: bad4.pdf: file is damaged +WARNING: bad4.pdf (xref table, file position 547): xref syntax invalid +WARNING: bad4.pdf: Attempting to reconstruct cross-reference table +/QTest is implicit +/QTest is direct +/QTest is null +unparse: null +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/bad4.out b/qpdf/qtest/qpdf/bad4.out new file mode 100644 index 0000000..fbfde22 --- /dev/null +++ b/qpdf/qtest/qpdf/bad4.out @@ -0,0 +1 @@ +bad4.pdf (xref table, file position 547): xref syntax invalid diff --git a/qpdf/qtest/qpdf/bad4.pdf b/qpdf/qtest/qpdf/bad4.pdf new file mode 100644 index 0000000..ed833b9 --- /dev/null +++ b/qpdf/qtest/qpdf/bad4.pdf @@ -0,0 +1,77 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +x0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000128 00000 n +0000000300 00000 n +0000000389 00000 n +0000000424 00000 n +trailer << + /Size 7 + /Root 1 0 R +>> +startxref +542 +%%EOF diff --git a/qpdf/qtest/qpdf/bad5-recover.out b/qpdf/qtest/qpdf/bad5-recover.out new file mode 100644 index 0000000..75fe746 --- /dev/null +++ b/qpdf/qtest/qpdf/bad5-recover.out @@ -0,0 +1,9 @@ +WARNING: bad5.pdf: file is damaged +WARNING: bad5.pdf (xref table, file position 591): invalid xref entry (obj=2) +WARNING: bad5.pdf: Attempting to reconstruct cross-reference table +/QTest is implicit +/QTest is direct +/QTest is null +unparse: null +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/bad5.out b/qpdf/qtest/qpdf/bad5.out new file mode 100644 index 0000000..2955619 --- /dev/null +++ b/qpdf/qtest/qpdf/bad5.out @@ -0,0 +1 @@ +bad5.pdf (xref table, file position 591): invalid xref entry (obj=2) diff --git a/qpdf/qtest/qpdf/bad5.pdf b/qpdf/qtest/qpdf/bad5.pdf new file mode 100644 index 0000000..d6b0871 --- /dev/null +++ b/qpdf/qtest/qpdf/bad5.pdf @@ -0,0 +1,77 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +000x000063 00000 n +0000000128 00000 n +0000000300 00000 n +0000000389 00000 n +0000000424 00000 n +trailer << + /Size 7 + /Root 1 0 R +>> +startxref +542 +%%EOF diff --git a/qpdf/qtest/qpdf/bad6-recover.out b/qpdf/qtest/qpdf/bad6-recover.out new file mode 100644 index 0000000..1d31025 --- /dev/null +++ b/qpdf/qtest/qpdf/bad6-recover.out @@ -0,0 +1,6 @@ +/QTest is implicit +/QTest is direct +/QTest is null +unparse: null +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/bad6.out b/qpdf/qtest/qpdf/bad6.out new file mode 100644 index 0000000..26b50cb --- /dev/null +++ b/qpdf/qtest/qpdf/bad6.out @@ -0,0 +1,6 @@ +/QTest is implicit +/QTest is direct +/QTest is null +unparse: null +unparseResolved: null +test 0 done diff --git a/qpdf/qtest/qpdf/bad6.pdf b/qpdf/qtest/qpdf/bad6.pdf new file mode 100644 index 0000000..50238b2 --- /dev/null +++ b/qpdf/qtest/qpdf/bad6.pdf @@ -0,0 +1,122 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000128 00000 n +0000000300 00000 n +0000000389 00000 n +0000000424 00000 n +trailer << + /Size 7 + /Root 1 0 R +>> +startxref +542 +%%EOF + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 7 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +7 0 obj +<< + /Length 48 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Sandwiches) Tj +ET +endstream +endobj + +xref +0 1 +0000000006 65535 f +3 2 +0000000750 00000 n +0000000000 00000 f +7 1 +0000000922 00000 n +trailer << + /Size 8 + /Root 1 0 R + /Prev 542 +>> +startxref +1022 +%%EOF diff --git a/qpdf/qtest/qpdf/bad7-recover.out b/qpdf/qtest/qpdf/bad7-recover.out new file mode 100644 index 0000000..fbf93ce --- /dev/null +++ b/qpdf/qtest/qpdf/bad7-recover.out @@ -0,0 +1,4 @@ +WARNING: bad7.pdf: file is damaged +WARNING: bad7.pdf (file position 698): expected trailer dictionary +WARNING: bad7.pdf: Attempting to reconstruct cross-reference table +bad7.pdf: unable to find trailer dictionary while recovering damaged file diff --git a/qpdf/qtest/qpdf/bad7.out b/qpdf/qtest/qpdf/bad7.out new file mode 100644 index 0000000..ae3da54 --- /dev/null +++ b/qpdf/qtest/qpdf/bad7.out @@ -0,0 +1 @@ +bad7.pdf (file position 698): expected trailer dictionary diff --git a/qpdf/qtest/qpdf/bad7.pdf b/qpdf/qtest/qpdf/bad7.pdf new file mode 100644 index 0000000..f44c1e6 --- /dev/null +++ b/qpdf/qtest/qpdf/bad7.pdf @@ -0,0 +1,77 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000128 00000 n +0000000300 00000 n +0000000389 00000 n +0000000424 00000 n +trailer 3 << + /Size 7 + /Root 1 0 R +>> +startxref +542 +%%EOF diff --git a/qpdf/qtest/qpdf/bad8-recover.out b/qpdf/qtest/qpdf/bad8-recover.out new file mode 100644 index 0000000..f55a794 --- /dev/null +++ b/qpdf/qtest/qpdf/bad8-recover.out @@ -0,0 +1,9 @@ +WARNING: bad8.pdf: file is damaged +WARNING: bad8.pdf (file position 543): xref not found +WARNING: bad8.pdf: Attempting to reconstruct cross-reference table +/QTest is implicit +/QTest is direct +/QTest is null +unparse: null +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/bad8.out b/qpdf/qtest/qpdf/bad8.out new file mode 100644 index 0000000..ace464d --- /dev/null +++ b/qpdf/qtest/qpdf/bad8.out @@ -0,0 +1 @@ +bad8.pdf (file position 543): xref not found diff --git a/qpdf/qtest/qpdf/bad8.pdf b/qpdf/qtest/qpdf/bad8.pdf new file mode 100644 index 0000000..9f424af --- /dev/null +++ b/qpdf/qtest/qpdf/bad8.pdf @@ -0,0 +1,104 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000128 00000 n +0000000300 00000 n +0000000389 00000 n +0000000424 00000 n +trailer << + /Size 7 + /Root 1 0 R +>> +startxref +542 +%%EOF + +4 0 obj +<< + /Length 43 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Salad) Tj +ET +endstream +endobj + +xref +0 1 +0000000000 65535 f +4 1 +0000000750 00000 n +trailer << + /Size 7 + /Root 1 0 R + /Prev 543 +>> +startxref +845 +%%EOF diff --git a/qpdf/qtest/qpdf/bad9-recover.out b/qpdf/qtest/qpdf/bad9-recover.out new file mode 100644 index 0000000..f795a15 --- /dev/null +++ b/qpdf/qtest/qpdf/bad9-recover.out @@ -0,0 +1,9 @@ +WARNING: bad9.pdf: file is damaged +WARNING: bad9.pdf (trailer, file position 712): trailer dictionary lacks /Size key +WARNING: bad9.pdf: Attempting to reconstruct cross-reference table +/QTest is implicit +/QTest is direct +/QTest is null +unparse: null +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/bad9.out b/qpdf/qtest/qpdf/bad9.out new file mode 100644 index 0000000..45524ff --- /dev/null +++ b/qpdf/qtest/qpdf/bad9.out @@ -0,0 +1 @@ +bad9.pdf (trailer, file position 712): trailer dictionary lacks /Size key diff --git a/qpdf/qtest/qpdf/bad9.pdf b/qpdf/qtest/qpdf/bad9.pdf new file mode 100644 index 0000000..a52b15f --- /dev/null +++ b/qpdf/qtest/qpdf/bad9.pdf @@ -0,0 +1,79 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Siqe 7 + /Root 1 0 R +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/badlin1.out b/qpdf/qtest/qpdf/badlin1.out new file mode 100644 index 0000000..8ad4bfd --- /dev/null +++ b/qpdf/qtest/qpdf/badlin1.out @@ -0,0 +1,380 @@ +ERROR: first page object (/O) mismatch +ERROR: space before first xref item (/T) mismatch (computed = 11777; file = 11771 +WARNING: end of first page section (/E) mismatch: /E = 1827; computed = 3889..3891 +WARNING: page 0 has shared identifier entries +WARNING: page 0: shared object 62: in hint table but not computed list +badlin1.pdf: linearization data: + +file_size: 13103 +first_page_object: 63 +first_page_end: 1827 +npages: 30 +xref_zero_offset: 11770 +first_page: 0 +H_offset: 1211 +H_length: 203 + +Page Offsets Hint Table + +min_nobjects: 2 +first_page_offset: 1414 +nbits_delta_nobjects: 4 +min_page_length: 259 +nbits_delta_page_length: 12 +min_content_offset: 0 +nbits_delta_content_offset: 0 +min_content_length: 0 +nbits_delta_content_length: 12 +nbits_nshared_objects: 2 +nbits_shared_identifier: 2 +nbits_shared_numerator: 4 +shared_denominator: 8 +Page 0: + nobjects: 16 + length: 2477 + content_offset: 0 + content_length: 2218 + nshared_objects: 2 + identifier 0: 0 + numerator 0: 0 + identifier 1: 0 + numerator 1: 0 +Page 1: + nobjects: 2 + length: 259 + content_offset: 0 + content_length: 0 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 2: + nobjects: 2 + length: 259 + content_offset: 0 + content_length: 0 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 3: + nobjects: 2 + length: 259 + content_offset: 0 + content_length: 0 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 4: + nobjects: 2 + length: 259 + content_offset: 0 + content_length: 0 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 5: + nobjects: 2 + length: 261 + content_offset: 0 + content_length: 2 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 6: + nobjects: 2 + length: 262 + content_offset: 0 + content_length: 3 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 7: + nobjects: 2 + length: 262 + content_offset: 0 + content_length: 3 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 8: + nobjects: 2 + length: 262 + content_offset: 0 + content_length: 3 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 9: + nobjects: 2 + length: 262 + content_offset: 0 + content_length: 3 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 10: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 11: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 12: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 13: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 14: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 15: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 16: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 17: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 18: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 19: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 20: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 21: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 22: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 23: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 24: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 25: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 26: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 27: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 28: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 29: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + +Shared Objects Hint Table + +first_shared_obj: 0 +first_shared_offset: 0 +nshared_first_page: 16 +nshared_total: 16 +nbits_nobjects: 0 +min_group_length: 34 +nbits_delta_group_length: 9 +Shared Object 0: + group length: 157 +Shared Object 1: + group length: 105 +Shared Object 2: + group length: 117 +Shared Object 3: + group length: 34 +Shared Object 4: + group length: 82 +Shared Object 5: + group length: 191 +Shared Object 6: + group length: 144 +Shared Object 7: + group length: 168 +Shared Object 8: + group length: 291 +Shared Object 9: + group length: 165 +Shared Object 10: + group length: 162 +Shared Object 11: + group length: 182 +Shared Object 12: + group length: 201 +Shared Object 13: + group length: 150 +Shared Object 14: + group length: 164 +Shared Object 15: + group length: 164 + +Outlines Hint Table + +first_object: 66 +first_object_offset: 1827 +nobjects: 12 +group_length: 2064 diff --git a/qpdf/qtest/qpdf/badlin1.pdf b/qpdf/qtest/qpdf/badlin1.pdf new file mode 100644 index 0000000..8539ac4 Binary files /dev/null and b/qpdf/qtest/qpdf/badlin1.pdf differ diff --git a/qpdf/qtest/qpdf/c-decrypt-with-owner.pdf b/qpdf/qtest/qpdf/c-decrypt-with-owner.pdf new file mode 100644 index 0000000..9a0f23b Binary files /dev/null and b/qpdf/qtest/qpdf/c-decrypt-with-owner.pdf differ diff --git a/qpdf/qtest/qpdf/c-decrypt-with-user.pdf b/qpdf/qtest/qpdf/c-decrypt-with-user.pdf new file mode 100644 index 0000000..9a0f23b Binary files /dev/null and b/qpdf/qtest/qpdf/c-decrypt-with-user.pdf differ diff --git a/qpdf/qtest/qpdf/c-ignore-xref-streams.pdf b/qpdf/qtest/qpdf/c-ignore-xref-streams.pdf new file mode 100644 index 0000000..c3d17dc Binary files /dev/null and b/qpdf/qtest/qpdf/c-ignore-xref-streams.pdf differ diff --git a/qpdf/qtest/qpdf/c-info-out.pdf b/qpdf/qtest/qpdf/c-info-out.pdf new file mode 100644 index 0000000..4a81688 --- /dev/null +++ b/qpdf/qtest/qpdf/c-info-out.pdf @@ -0,0 +1,44 @@ +%PDF-1.3 +%¿÷¢þ +1 0 obj +<< /Pages 3 0 R /Type /Catalog >> +endobj +2 0 obj +<< /Author (Mr. Potato Head) /Producer (QPDF library) >> +endobj +3 0 obj +<< /Count 1 /Kids [ 4 0 R ] /Type /Pages >> +endobj +4 0 obj +<< /Contents 5 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 6 0 R >> /ProcSet 7 0 R >> /Type /Page >> +endobj +5 0 obj +<< /Length 44 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj +6 0 obj +<< /BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font >> +endobj +7 0 obj +[ /PDF /Text ] +endobj +xref +0 8 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000136 00000 n +0000000195 00000 n +0000000338 00000 n +0000000431 00000 n +0000000538 00000 n +trailer << /Info 2 0 R /Root 1 0 R /Size 8 /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] >> +startxref +568 +%%EOF diff --git a/qpdf/qtest/qpdf/c-info1.out b/qpdf/qtest/qpdf/c-info1.out new file mode 100644 index 0000000..625eaa3 --- /dev/null +++ b/qpdf/qtest/qpdf/c-info1.out @@ -0,0 +1,6 @@ +Info key /Author: (null) +Info key /Producer: (null) +Info key /Creator: (null) +Info key /Author: Mr. Potato Head +Info key /Producer: QPDF library +Info key /Creator: (null) diff --git a/qpdf/qtest/qpdf/c-info2-in.pdf b/qpdf/qtest/qpdf/c-info2-in.pdf new file mode 100644 index 0000000..7a83ea2 Binary files /dev/null and b/qpdf/qtest/qpdf/c-info2-in.pdf differ diff --git a/qpdf/qtest/qpdf/c-info2.out b/qpdf/qtest/qpdf/c-info2.out new file mode 100644 index 0000000..61d3735 --- /dev/null +++ b/qpdf/qtest/qpdf/c-info2.out @@ -0,0 +1,6 @@ +Info key /Author: Someone Else +Info key /Producer: Something Else +Info key /Creator: A. Nony Mous +Info key /Author: Mr. Potato Head +Info key /Producer: QPDF library +Info key /Creator: (null) diff --git a/qpdf/qtest/qpdf/c-invalid-password.out b/qpdf/qtest/qpdf/c-invalid-password.out new file mode 100644 index 0000000..679643f --- /dev/null +++ b/qpdf/qtest/qpdf/c-invalid-password.out @@ -0,0 +1,5 @@ +error: enc-R2,V1,U=view.pdf: invalid password + code: 4 + file: enc-R2,V1,U=view.pdf + pos : 0 + text: invalid password diff --git a/qpdf/qtest/qpdf/c-linearized.pdf b/qpdf/qtest/qpdf/c-linearized.pdf new file mode 100644 index 0000000..dbe62ff Binary files /dev/null and b/qpdf/qtest/qpdf/c-linearized.pdf differ diff --git a/qpdf/qtest/qpdf/c-no-options.pdf b/qpdf/qtest/qpdf/c-no-options.pdf new file mode 100644 index 0000000..4c777c6 Binary files /dev/null and b/qpdf/qtest/qpdf/c-no-options.pdf differ diff --git a/qpdf/qtest/qpdf/c-no-original-object-ids.pdf b/qpdf/qtest/qpdf/c-no-original-object-ids.pdf new file mode 100644 index 0000000..d46bf04 --- /dev/null +++ b/qpdf/qtest/qpdf/c-no-original-object-ids.pdf @@ -0,0 +1,1512 @@ +%PDF-1.5 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /Outlines 3 0 R + /PageLabels 15 0 R + /PageMode /UseOutlines + /Pages 16 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /Type /ObjStm + /Length 3176 + /N 13 + /First 126 +>> +stream +3 0 +4 100 +5 335 +6 520 +7 718 +8 1044 +9 1262 +10 1508 +11 1715 +12 1922 +13 2115 +14 2329 +15 2535 +%% Object stream: object 3, index 0 +<< + /Count 6 + /First 4 0 R + /Last 5 0 R + /Type /Outlines +>> +%% Object stream: object 4, index 1 +<< + /Count 4 + /Dest [ + 17 0 R + /XYZ + null + null + null + ] + /First 6 0 R + /Last 7 0 R + /Next 5 0 R + /Parent 3 0 R + /Title (Isís 1 -> 5: /XYZ null null null) + /Type /Outline +>> +%% Object stream: object 5, index 2 +<< + /Dest [ + 18 0 R + /XYZ + 66 + 756 + 3 + ] + /Parent 3 0 R + /Prev 4 0 R + /Title (Trepak 2 -> 15: /XYZ 66 756 3) + /Type /Outline +>> +%% Object stream: object 6, index 3 +<< + /Count -3 + /Dest [ + 19 0 R + /Fit + ] + /First 8 0 R + /Last 9 0 R + /Next 7 0 R + /Parent 4 0 R + /Title (Amanda 1.1 -> 11: /Fit) + /Type /Outline +>> +%% Object stream: object 7, index 4 +<< + /Count 2 + /Dest [ + 20 0 R + /FitH + 792 + ] + /First 13 0 R + /Last 14 0 R + /Parent 4 0 R + /Prev 6 0 R + /Title + /Type /Outline +>> +%% Object stream: object 8, index 5 +<< + /Count -2 + /Dest [ + 21 0 R + /FitV + 100 + ] + /First 10 0 R + /Last 11 0 R + /Next 9 0 R + /Parent 6 0 R + /Title (Isosicle 1.1.1 -> 12: /FitV 100) + /Type /Outline +>> +%% Object stream: object 9, index 6 +<< + /Count 1 + /Dest [ + 21 0 R + /XYZ + null + null + null + ] + /First 12 0 R + /Last 12 0 R + /Parent 6 0 R + /Prev 8 0 R + /Title (Isosicle 1.1.2 -> 12: /XYZ null null null) + /Type /Outline +>> +%% Object stream: object 10, index 7 +<< + /Dest [ + 22 0 R + /XYZ + null + null + null + ] + /Next 11 0 R + /Parent 8 0 R + /Title (Isosicle 1.1.1.1 -> 18: /XYZ null null null) + /Type /Outline +>> +%% Object stream: object 11, index 8 +<< + /Dest [ + 23 0 R + /XYZ + null + null + null + ] + /Parent 8 0 R + /Prev 10 0 R + /Title (Isosicle 1.1.1.2 -> 19: /XYZ null null null) + /Type /Outline +>> +%% Object stream: object 12, index 9 +<< + /Dest [ + 24 0 R + /XYZ + null + null + null + ] + /Parent 9 0 R + /Title (Isosicle 1.1.2.1 -> 22: /XYZ null null null) + /Type /Outline +>> +%% Object stream: object 13, index 10 +<< + /Dest [ + 25 0 R + /FitR + 66 + 714 + 180 + 770 + ] + /Next 14 0 R + /Parent 7 0 R + /Title (Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770) + /Type /Outline +>> +%% Object stream: object 14, index 11 +<< + /Dest [ + 26 0 R + /XYZ + null + null + null + ] + /Parent 7 0 R + /Prev 13 0 R + /Title (Trepsicle 1.2.2 -> 0: /XYZ null null null) + /Type /Outline +>> +%% Object stream: object 15, index 12 +<< + /Nums [ + 0 + << + /P () + >> + 2 + << + /S /r + /St 1 + >> + 7 + << + /P () + >> + 9 + << + /S /r + /St 6 + >> + 11 + << + /P () + >> + 12 + << + /S /D + /St 2 + >> + 15 + << + /S /D + /St 6 + >> + 19 + << + /P () + >> + 20 + << + /S /D + /St 12 + >> + 22 + << + /S /D + /St 16059 + >> + 23 + << + /S /r + /St 50 + >> + 29 + << + /S /r + /St 54 + >> + ] +>> +endstream +endobj + +16 0 obj +<< + /Count 30 + /Kids [ + 26 0 R + 25 0 R + 27 0 R + 28 0 R + 29 0 R + 17 0 R + 30 0 R + 31 0 R + 32 0 R + 33 0 R + 34 0 R + 19 0 R + 21 0 R + 20 0 R + 35 0 R + 18 0 R + 36 0 R + 37 0 R + 22 0 R + 23 0 R + 38 0 R + 39 0 R + 24 0 R + 40 0 R + 41 0 R + 42 0 R + 43 0 R + 44 0 R + 45 0 R + 46 0 R + ] + /Type /Pages +>> +endobj + +%% Page 6 +17 0 obj +<< + /Contents 47 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 16 +18 0 obj +<< + /Contents 51 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 12 +19 0 obj +<< + /Contents 53 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 14 +20 0 obj +<< + /Contents 55 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 13 +21 0 obj +<< + /Contents 57 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 19 +22 0 obj +<< + /Contents 59 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 20 +23 0 obj +<< + /Contents 61 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 23 +24 0 obj +<< + /Contents 63 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 2 +25 0 obj +<< + /Contents 65 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 1 +26 0 obj +<< + /Contents 67 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 3 +27 0 obj +<< + /Contents 69 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 4 +28 0 obj +<< + /Contents 71 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 5 +29 0 obj +<< + /Contents 73 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 7 +30 0 obj +<< + /Contents 75 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 8 +31 0 obj +<< + /Contents 77 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 9 +32 0 obj +<< + /Contents 79 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 10 +33 0 obj +<< + /Contents 81 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 11 +34 0 obj +<< + /Contents 83 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 15 +35 0 obj +<< + /Contents 85 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 17 +36 0 obj +<< + /Contents 87 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 18 +37 0 obj +<< + /Contents 89 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 21 +38 0 obj +<< + /Contents 91 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 22 +39 0 obj +<< + /Contents 93 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 24 +40 0 obj +<< + /Contents 95 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 25 +41 0 obj +<< + /Contents 97 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 26 +42 0 obj +<< + /Contents 99 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 27 +43 0 obj +<< + /Contents 101 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 28 +44 0 obj +<< + /Contents 103 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 29 +45 0 obj +<< + /Contents 105 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 30 +46 0 obj +<< + /Contents 107 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 6 +47 0 obj +<< + /Length 48 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 5) Tj +ET +endstream +endobj + +48 0 obj +46 +endobj + +49 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +50 0 obj +[ + /PDF + /Text +] +endobj + +%% Contents for page 16 +51 0 obj +<< + /Length 52 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 15) Tj +ET +endstream +endobj + +52 0 obj +47 +endobj + +%% Contents for page 12 +53 0 obj +<< + /Length 54 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 11) Tj +ET +endstream +endobj + +54 0 obj +47 +endobj + +%% Contents for page 14 +55 0 obj +<< + /Length 56 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 13) Tj +ET +endstream +endobj + +56 0 obj +47 +endobj + +%% Contents for page 13 +57 0 obj +<< + /Length 58 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 12) Tj +ET +endstream +endobj + +58 0 obj +47 +endobj + +%% Contents for page 19 +59 0 obj +<< + /Length 60 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 18) Tj +ET +endstream +endobj + +60 0 obj +47 +endobj + +%% Contents for page 20 +61 0 obj +<< + /Length 62 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 19) Tj +ET +endstream +endobj + +62 0 obj +47 +endobj + +%% Contents for page 23 +63 0 obj +<< + /Length 64 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 22) Tj +ET +endstream +endobj + +64 0 obj +47 +endobj + +%% Contents for page 2 +65 0 obj +<< + /Length 66 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 1) Tj +ET +endstream +endobj + +66 0 obj +46 +endobj + +%% Contents for page 1 +67 0 obj +<< + /Length 68 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 0) Tj +ET +endstream +endobj + +68 0 obj +46 +endobj + +%% Contents for page 3 +69 0 obj +<< + /Length 70 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 2) Tj +ET +endstream +endobj + +70 0 obj +46 +endobj + +%% Contents for page 4 +71 0 obj +<< + /Length 72 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 3) Tj +ET +endstream +endobj + +72 0 obj +46 +endobj + +%% Contents for page 5 +73 0 obj +<< + /Length 74 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 4) Tj +ET +endstream +endobj + +74 0 obj +46 +endobj + +%% Contents for page 7 +75 0 obj +<< + /Length 76 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 6) Tj +ET +endstream +endobj + +76 0 obj +46 +endobj + +%% Contents for page 8 +77 0 obj +<< + /Length 78 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 7) Tj +ET +endstream +endobj + +78 0 obj +46 +endobj + +%% Contents for page 9 +79 0 obj +<< + /Length 80 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 8) Tj +ET +endstream +endobj + +80 0 obj +46 +endobj + +%% Contents for page 10 +81 0 obj +<< + /Length 82 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 9) Tj +ET +endstream +endobj + +82 0 obj +46 +endobj + +%% Contents for page 11 +83 0 obj +<< + /Length 84 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 10) Tj +ET +endstream +endobj + +84 0 obj +47 +endobj + +%% Contents for page 15 +85 0 obj +<< + /Length 86 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 14) Tj +ET +endstream +endobj + +86 0 obj +47 +endobj + +%% Contents for page 17 +87 0 obj +<< + /Length 88 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 16) Tj +ET +endstream +endobj + +88 0 obj +47 +endobj + +%% Contents for page 18 +89 0 obj +<< + /Length 90 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 17) Tj +ET +endstream +endobj + +90 0 obj +47 +endobj + +%% Contents for page 21 +91 0 obj +<< + /Length 92 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 20) Tj +ET +endstream +endobj + +92 0 obj +47 +endobj + +%% Contents for page 22 +93 0 obj +<< + /Length 94 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 21) Tj +ET +endstream +endobj + +94 0 obj +47 +endobj + +%% Contents for page 24 +95 0 obj +<< + /Length 96 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 23) Tj +ET +endstream +endobj + +96 0 obj +47 +endobj + +%% Contents for page 25 +97 0 obj +<< + /Length 98 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 24) Tj +ET +endstream +endobj + +98 0 obj +47 +endobj + +%% Contents for page 26 +99 0 obj +<< + /Length 100 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 25) Tj +ET +endstream +endobj + +100 0 obj +47 +endobj + +%% Contents for page 27 +101 0 obj +<< + /Length 102 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 26) Tj +ET +endstream +endobj + +102 0 obj +47 +endobj + +%% Contents for page 28 +103 0 obj +<< + /Length 104 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 27) Tj +ET +endstream +endobj + +104 0 obj +47 +endobj + +%% Contents for page 29 +105 0 obj +<< + /Length 106 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 28) Tj +ET +endstream +endobj + +106 0 obj +47 +endobj + +%% Contents for page 30 +107 0 obj +<< + /Length 108 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 29) Tj +ET +endstream +endobj + +108 0 obj +47 +endobj + +109 0 obj +<< + /Type /XRef + /Length 440 + /W [ 1 2 1 ] + /Root 1 0 R + /Size 110 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +stream +  +   Sç·‡W'÷Ç—f5Ó¢q@߯Oï ¿!"_#/#ÿ$Ð%¡&r'O'¶'Ê(A(}(å))y)¥* *9*¡*Í+5+a+É+õ,],ˆ,ï---¬..>.¥.Ð/7/b/É/ô0[0†0í11€1¬22@2¨2Ô3<3h3Ð3ü4d44ø5$5Œ5¸6 6L6µ6â7L7y7ã88z8§99& +endstream +endobj + +startxref +14630 +%%EOF diff --git a/qpdf/qtest/qpdf/c-no-recovery.out b/qpdf/qtest/qpdf/c-no-recovery.out new file mode 100644 index 0000000..2db03a7 --- /dev/null +++ b/qpdf/qtest/qpdf/c-no-recovery.out @@ -0,0 +1,5 @@ +error: bad33.pdf (file position 1771): xref not found + code: 5 + file: bad33.pdf + pos : 1771 + text: xref not found diff --git a/qpdf/qtest/qpdf/c-normalized-content.pdf b/qpdf/qtest/qpdf/c-normalized-content.pdf new file mode 100644 index 0000000..77e2206 Binary files /dev/null and b/qpdf/qtest/qpdf/c-normalized-content.pdf differ diff --git a/qpdf/qtest/qpdf/c-object-streams.pdf b/qpdf/qtest/qpdf/c-object-streams.pdf new file mode 100644 index 0000000..ae91ea7 Binary files /dev/null and b/qpdf/qtest/qpdf/c-object-streams.pdf differ diff --git a/qpdf/qtest/qpdf/c-qdf.pdf b/qpdf/qtest/qpdf/c-qdf.pdf new file mode 100644 index 0000000..8eeb28a --- /dev/null +++ b/qpdf/qtest/qpdf/c-qdf.pdf @@ -0,0 +1,1576 @@ +%PDF-1.5 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /Outlines 3 0 R + /PageLabels 15 0 R + /PageMode /UseOutlines + /Pages 16 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /Type /ObjStm + /Length 3496 + /N 13 + /First 150 +>> +stream +3 0 +4 124 +5 383 +6 592 +7 814 +8 1165 +9 1408 +10 1679 +11 1911 +12 2143 +13 2361 +14 2600 +15 2831 +%% Object stream: object 3, index 0; original object ID: 95 +<< + /Count 6 + /First 4 0 R + /Last 5 0 R + /Type /Outlines +>> +%% Object stream: object 4, index 1; original object ID: 96 +<< + /Count 4 + /Dest [ + 17 0 R + /XYZ + null + null + null + ] + /First 6 0 R + /Last 7 0 R + /Next 5 0 R + /Parent 3 0 R + /Title (Isís 1 -> 5: /XYZ null null null) + /Type /Outline +>> +%% Object stream: object 5, index 2; original object ID: 97 +<< + /Dest [ + 18 0 R + /XYZ + 66 + 756 + 3 + ] + /Parent 3 0 R + /Prev 4 0 R + /Title (Trepak 2 -> 15: /XYZ 66 756 3) + /Type /Outline +>> +%% Object stream: object 6, index 3; original object ID: 98 +<< + /Count -3 + /Dest [ + 19 0 R + /Fit + ] + /First 8 0 R + /Last 9 0 R + /Next 7 0 R + /Parent 4 0 R + /Title (Amanda 1.1 -> 11: /Fit) + /Type /Outline +>> +%% Object stream: object 7, index 4; original object ID: 99 +<< + /Count 2 + /Dest [ + 20 0 R + /FitH + 792 + ] + /First 13 0 R + /Last 14 0 R + /Parent 4 0 R + /Prev 6 0 R + /Title + /Type /Outline +>> +%% Object stream: object 8, index 5; original object ID: 100 +<< + /Count -2 + /Dest [ + 21 0 R + /FitV + 100 + ] + /First 10 0 R + /Last 11 0 R + /Next 9 0 R + /Parent 6 0 R + /Title (Isosicle 1.1.1 -> 12: /FitV 100) + /Type /Outline +>> +%% Object stream: object 9, index 6; original object ID: 101 +<< + /Count 1 + /Dest [ + 21 0 R + /XYZ + null + null + null + ] + /First 12 0 R + /Last 12 0 R + /Parent 6 0 R + /Prev 8 0 R + /Title (Isosicle 1.1.2 -> 12: /XYZ null null null) + /Type /Outline +>> +%% Object stream: object 10, index 7; original object ID: 102 +<< + /Dest [ + 22 0 R + /XYZ + null + null + null + ] + /Next 11 0 R + /Parent 8 0 R + /Title (Isosicle 1.1.1.1 -> 18: /XYZ null null null) + /Type /Outline +>> +%% Object stream: object 11, index 8; original object ID: 103 +<< + /Dest [ + 23 0 R + /XYZ + null + null + null + ] + /Parent 8 0 R + /Prev 10 0 R + /Title (Isosicle 1.1.1.2 -> 19: /XYZ null null null) + /Type /Outline +>> +%% Object stream: object 12, index 9; original object ID: 104 +<< + /Dest [ + 24 0 R + /XYZ + null + null + null + ] + /Parent 9 0 R + /Title (Isosicle 1.1.2.1 -> 22: /XYZ null null null) + /Type /Outline +>> +%% Object stream: object 13, index 10; original object ID: 105 +<< + /Dest [ + 25 0 R + /FitR + 66 + 714 + 180 + 770 + ] + /Next 14 0 R + /Parent 7 0 R + /Title (Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770) + /Type /Outline +>> +%% Object stream: object 14, index 11; original object ID: 106 +<< + /Dest [ + 26 0 R + /XYZ + null + null + null + ] + /Parent 7 0 R + /Prev 13 0 R + /Title (Trepsicle 1.2.2 -> 0: /XYZ null null null) + /Type /Outline +>> +%% Object stream: object 15, index 12; original object ID: 107 +<< + /Nums [ + 0 + << + /P () + >> + 2 + << + /S /r + /St 1 + >> + 7 + << + /P () + >> + 9 + << + /S /r + /St 6 + >> + 11 + << + /P () + >> + 12 + << + /S /D + /St 2 + >> + 15 + << + /S /D + /St 6 + >> + 19 + << + /P () + >> + 20 + << + /S /D + /St 12 + >> + 22 + << + /S /D + /St 16059 + >> + 23 + << + /S /r + /St 50 + >> + 29 + << + /S /r + /St 54 + >> + ] +>> +endstream +endobj + +%% Original object ID: 2 0 +16 0 obj +<< + /Count 30 + /Kids [ + 26 0 R + 25 0 R + 27 0 R + 28 0 R + 29 0 R + 17 0 R + 30 0 R + 31 0 R + 32 0 R + 33 0 R + 34 0 R + 19 0 R + 21 0 R + 20 0 R + 35 0 R + 18 0 R + 36 0 R + 37 0 R + 22 0 R + 23 0 R + 38 0 R + 39 0 R + 24 0 R + 40 0 R + 41 0 R + 42 0 R + 43 0 R + 44 0 R + 45 0 R + 46 0 R + ] + /Type /Pages +>> +endobj + +%% Page 6 +%% Original object ID: 8 0 +17 0 obj +<< + /Contents 47 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 16 +%% Original object ID: 18 0 +18 0 obj +<< + /Contents 51 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 12 +%% Original object ID: 14 0 +19 0 obj +<< + /Contents 53 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 14 +%% Original object ID: 16 0 +20 0 obj +<< + /Contents 55 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 13 +%% Original object ID: 15 0 +21 0 obj +<< + /Contents 57 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 19 +%% Original object ID: 21 0 +22 0 obj +<< + /Contents 59 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 20 +%% Original object ID: 22 0 +23 0 obj +<< + /Contents 61 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 23 +%% Original object ID: 25 0 +24 0 obj +<< + /Contents 63 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 2 +%% Original object ID: 4 0 +25 0 obj +<< + /Contents 65 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 1 +%% Original object ID: 3 0 +26 0 obj +<< + /Contents 67 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 3 +%% Original object ID: 5 0 +27 0 obj +<< + /Contents 69 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 4 +%% Original object ID: 6 0 +28 0 obj +<< + /Contents 71 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 5 +%% Original object ID: 7 0 +29 0 obj +<< + /Contents 73 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 7 +%% Original object ID: 9 0 +30 0 obj +<< + /Contents 75 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 8 +%% Original object ID: 10 0 +31 0 obj +<< + /Contents 77 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 9 +%% Original object ID: 11 0 +32 0 obj +<< + /Contents 79 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 10 +%% Original object ID: 12 0 +33 0 obj +<< + /Contents 81 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 11 +%% Original object ID: 13 0 +34 0 obj +<< + /Contents 83 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 15 +%% Original object ID: 17 0 +35 0 obj +<< + /Contents 85 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 17 +%% Original object ID: 19 0 +36 0 obj +<< + /Contents 87 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 18 +%% Original object ID: 20 0 +37 0 obj +<< + /Contents 89 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 21 +%% Original object ID: 23 0 +38 0 obj +<< + /Contents 91 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 22 +%% Original object ID: 24 0 +39 0 obj +<< + /Contents 93 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 24 +%% Original object ID: 26 0 +40 0 obj +<< + /Contents 95 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 25 +%% Original object ID: 27 0 +41 0 obj +<< + /Contents 97 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 26 +%% Original object ID: 28 0 +42 0 obj +<< + /Contents 99 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 27 +%% Original object ID: 29 0 +43 0 obj +<< + /Contents 101 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 28 +%% Original object ID: 30 0 +44 0 obj +<< + /Contents 103 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 29 +%% Original object ID: 31 0 +45 0 obj +<< + /Contents 105 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Page 30 +%% Original object ID: 32 0 +46 0 obj +<< + /Contents 107 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 16 0 R + /Resources << + /Font << + /F1 49 0 R + >> + /ProcSet 50 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 6 +%% Original object ID: 45 0 +47 0 obj +<< + /Length 48 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 5) Tj +ET +endstream +endobj + +48 0 obj +46 +endobj + +%% Original object ID: 35 0 +49 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 36 0 +50 0 obj +[ + /PDF + /Text +] +endobj + +%% Contents for page 16 +%% Original object ID: 65 0 +51 0 obj +<< + /Length 52 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 15) Tj +ET +endstream +endobj + +52 0 obj +47 +endobj + +%% Contents for page 12 +%% Original object ID: 57 0 +53 0 obj +<< + /Length 54 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 11) Tj +ET +endstream +endobj + +54 0 obj +47 +endobj + +%% Contents for page 14 +%% Original object ID: 61 0 +55 0 obj +<< + /Length 56 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 13) Tj +ET +endstream +endobj + +56 0 obj +47 +endobj + +%% Contents for page 13 +%% Original object ID: 59 0 +57 0 obj +<< + /Length 58 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 12) Tj +ET +endstream +endobj + +58 0 obj +47 +endobj + +%% Contents for page 19 +%% Original object ID: 71 0 +59 0 obj +<< + /Length 60 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 18) Tj +ET +endstream +endobj + +60 0 obj +47 +endobj + +%% Contents for page 20 +%% Original object ID: 73 0 +61 0 obj +<< + /Length 62 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 19) Tj +ET +endstream +endobj + +62 0 obj +47 +endobj + +%% Contents for page 23 +%% Original object ID: 79 0 +63 0 obj +<< + /Length 64 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 22) Tj +ET +endstream +endobj + +64 0 obj +47 +endobj + +%% Contents for page 2 +%% Original object ID: 37 0 +65 0 obj +<< + /Length 66 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 1) Tj +ET +endstream +endobj + +66 0 obj +46 +endobj + +%% Contents for page 1 +%% Original object ID: 33 0 +67 0 obj +<< + /Length 68 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 0) Tj +ET +endstream +endobj + +68 0 obj +46 +endobj + +%% Contents for page 3 +%% Original object ID: 39 0 +69 0 obj +<< + /Length 70 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 2) Tj +ET +endstream +endobj + +70 0 obj +46 +endobj + +%% Contents for page 4 +%% Original object ID: 41 0 +71 0 obj +<< + /Length 72 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 3) Tj +ET +endstream +endobj + +72 0 obj +46 +endobj + +%% Contents for page 5 +%% Original object ID: 43 0 +73 0 obj +<< + /Length 74 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 4) Tj +ET +endstream +endobj + +74 0 obj +46 +endobj + +%% Contents for page 7 +%% Original object ID: 47 0 +75 0 obj +<< + /Length 76 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 6) Tj +ET +endstream +endobj + +76 0 obj +46 +endobj + +%% Contents for page 8 +%% Original object ID: 49 0 +77 0 obj +<< + /Length 78 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 7) Tj +ET +endstream +endobj + +78 0 obj +46 +endobj + +%% Contents for page 9 +%% Original object ID: 51 0 +79 0 obj +<< + /Length 80 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 8) Tj +ET +endstream +endobj + +80 0 obj +46 +endobj + +%% Contents for page 10 +%% Original object ID: 53 0 +81 0 obj +<< + /Length 82 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 9) Tj +ET +endstream +endobj + +82 0 obj +46 +endobj + +%% Contents for page 11 +%% Original object ID: 55 0 +83 0 obj +<< + /Length 84 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 10) Tj +ET +endstream +endobj + +84 0 obj +47 +endobj + +%% Contents for page 15 +%% Original object ID: 63 0 +85 0 obj +<< + /Length 86 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 14) Tj +ET +endstream +endobj + +86 0 obj +47 +endobj + +%% Contents for page 17 +%% Original object ID: 67 0 +87 0 obj +<< + /Length 88 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 16) Tj +ET +endstream +endobj + +88 0 obj +47 +endobj + +%% Contents for page 18 +%% Original object ID: 69 0 +89 0 obj +<< + /Length 90 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 17) Tj +ET +endstream +endobj + +90 0 obj +47 +endobj + +%% Contents for page 21 +%% Original object ID: 75 0 +91 0 obj +<< + /Length 92 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 20) Tj +ET +endstream +endobj + +92 0 obj +47 +endobj + +%% Contents for page 22 +%% Original object ID: 77 0 +93 0 obj +<< + /Length 94 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 21) Tj +ET +endstream +endobj + +94 0 obj +47 +endobj + +%% Contents for page 24 +%% Original object ID: 81 0 +95 0 obj +<< + /Length 96 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 23) Tj +ET +endstream +endobj + +96 0 obj +47 +endobj + +%% Contents for page 25 +%% Original object ID: 83 0 +97 0 obj +<< + /Length 98 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 24) Tj +ET +endstream +endobj + +98 0 obj +47 +endobj + +%% Contents for page 26 +%% Original object ID: 85 0 +99 0 obj +<< + /Length 100 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 25) Tj +ET +endstream +endobj + +100 0 obj +47 +endobj + +%% Contents for page 27 +%% Original object ID: 87 0 +101 0 obj +<< + /Length 102 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 26) Tj +ET +endstream +endobj + +102 0 obj +47 +endobj + +%% Contents for page 28 +%% Original object ID: 89 0 +103 0 obj +<< + /Length 104 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 27) Tj +ET +endstream +endobj + +104 0 obj +47 +endobj + +%% Contents for page 29 +%% Original object ID: 91 0 +105 0 obj +<< + /Length 106 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 28) Tj +ET +endstream +endobj + +106 0 obj +47 +endobj + +%% Contents for page 30 +%% Original object ID: 93 0 +107 0 obj +<< + /Length 108 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 29) Tj +ET +endstream +endobj + +108 0 obj +47 +endobj + +109 0 obj +<< + /Type /XRef + /Length 440 + /W [ 1 2 1 ] + /Root 1 0 R + /Size 110 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +stream +4«  +  ÉxdP<(ìÖÀª”~hS>* !!î"Ú#Æ$²%ž&Š'v(b)O*<+),",‰,¹-L-¤. .T.¼//l/´00d0Ì11|1Ä2,2s2Ú3!3ˆ3Ï464}4ä5+5’5Ù6@6‡6î757œ7ä8K8“8û9C9«9ó:[:£; ;S;»<>|>Å?/?x?â@+@•@ÞAHA] +endstream +endobj + +startxref +16733 +%%EOF diff --git a/qpdf/qtest/qpdf/c-r2.pdf b/qpdf/qtest/qpdf/c-r2.pdf new file mode 100644 index 0000000..0301696 Binary files /dev/null and b/qpdf/qtest/qpdf/c-r2.pdf differ diff --git a/qpdf/qtest/qpdf/c-r3.pdf b/qpdf/qtest/qpdf/c-r3.pdf new file mode 100644 index 0000000..55493b2 Binary files /dev/null and b/qpdf/qtest/qpdf/c-r3.pdf differ diff --git a/qpdf/qtest/qpdf/c-r4.pdf b/qpdf/qtest/qpdf/c-r4.pdf new file mode 100644 index 0000000..d985109 Binary files /dev/null and b/qpdf/qtest/qpdf/c-r4.pdf differ diff --git a/qpdf/qtest/qpdf/c-read-errors.out b/qpdf/qtest/qpdf/c-read-errors.out new file mode 100644 index 0000000..4959433 --- /dev/null +++ b/qpdf/qtest/qpdf/c-read-errors.out @@ -0,0 +1,5 @@ +error: bad1.pdf: not a PDF file + code: 5 + file: bad1.pdf + pos : 0 + text: not a PDF file diff --git a/qpdf/qtest/qpdf/c-read-warnings-and-errors.out b/qpdf/qtest/qpdf/c-read-warnings-and-errors.out new file mode 100644 index 0000000..117663e --- /dev/null +++ b/qpdf/qtest/qpdf/c-read-warnings-and-errors.out @@ -0,0 +1,20 @@ +warning: bad17.pdf: file is damaged + code: 5 + file: bad17.pdf + pos : 0 + text: file is damaged +warning: bad17.pdf (trailer, file position 753): dictionary ending here has an odd number of elements + code: 5 + file: bad17.pdf + pos : 753 + text: dictionary ending here has an odd number of elements +warning: bad17.pdf: Attempting to reconstruct cross-reference table + code: 5 + file: bad17.pdf + pos : 0 + text: Attempting to reconstruct cross-reference table +error: bad17.pdf (trailer, file position 753): dictionary ending here has an odd number of elements + code: 5 + file: bad17.pdf + pos : 753 + text: dictionary ending here has an odd number of elements diff --git a/qpdf/qtest/qpdf/c-uncompressed-streams.pdf b/qpdf/qtest/qpdf/c-uncompressed-streams.pdf new file mode 100644 index 0000000..28b3aa0 --- /dev/null +++ b/qpdf/qtest/qpdf/c-uncompressed-streams.pdf @@ -0,0 +1,434 @@ +%PDF-1.5 +%¿÷¢þ +1 0 obj +<< /Outlines 3 0 R /PageLabels 15 0 R /PageMode /UseOutlines /Pages 16 0 R /Type /Catalog >> +endobj +2 0 obj +<< /Type /ObjStm /Length 2064 /N 13 /First 87 >> +stream +3 0 4 56 5 217 6 334 7 470 8 730 9 882 10 1053 11 1191 12 1329 13 1454 14 1594 15 1730 +<< /Count 6 /First 4 0 R /Last 5 0 R /Type /Outlines >> +<< /Count 4 /Dest [ 17 0 R /XYZ null null null ] /First 6 0 R /Last 7 0 R /Next 5 0 R /Parent 3 0 R /Title (Isís 1 -> 5: /XYZ null null null) /Type /Outline >> +<< /Dest [ 18 0 R /XYZ 66 756 3 ] /Parent 3 0 R /Prev 4 0 R /Title (Trepak 2 -> 15: /XYZ 66 756 3) /Type /Outline >> +<< /Count -3 /Dest [ 19 0 R /Fit ] /First 8 0 R /Last 9 0 R /Next 7 0 R /Parent 4 0 R /Title (Amanda 1.1 -> 11: /Fit) /Type /Outline >> +<< /Count 2 /Dest [ 20 0 R /FitH 792 ] /First 13 0 R /Last 14 0 R /Parent 4 0 R /Prev 6 0 R /Title /Type /Outline >> +<< /Count -2 /Dest [ 21 0 R /FitV 100 ] /First 10 0 R /Last 11 0 R /Next 9 0 R /Parent 6 0 R /Title (Isosicle 1.1.1 -> 12: /FitV 100) /Type /Outline >> +<< /Count 1 /Dest [ 21 0 R /XYZ null null null ] /First 12 0 R /Last 12 0 R /Parent 6 0 R /Prev 8 0 R /Title (Isosicle 1.1.2 -> 12: /XYZ null null null) /Type /Outline >> +<< /Dest [ 22 0 R /XYZ null null null ] /Next 11 0 R /Parent 8 0 R /Title (Isosicle 1.1.1.1 -> 18: /XYZ null null null) /Type /Outline >> +<< /Dest [ 23 0 R /XYZ null null null ] /Parent 8 0 R /Prev 10 0 R /Title (Isosicle 1.1.1.2 -> 19: /XYZ null null null) /Type /Outline >> +<< /Dest [ 24 0 R /XYZ null null null ] /Parent 9 0 R /Title (Isosicle 1.1.2.1 -> 22: /XYZ null null null) /Type /Outline >> +<< /Dest [ 25 0 R /FitR 66 714 180 770 ] /Next 14 0 R /Parent 7 0 R /Title (Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770) /Type /Outline >> +<< /Dest [ 26 0 R /XYZ null null null ] /Parent 7 0 R /Prev 13 0 R /Title (Trepsicle 1.2.2 -> 0: /XYZ null null null) /Type /Outline >> +<< /Nums [ 0 << /P () >> 2 << /S /r /St 1 >> 7 << /P () >> 9 << /S /r /St 6 >> 11 << /P () >> 12 << /S /D /St 2 >> 15 << /S /D /St 6 >> 19 << /P () >> 20 << /S /D /St 12 >> 22 << /S /D /St 16059 >> 23 << /S /r /St 50 >> 29 << /S /r /St 54 >> ] >> +endstream +endobj +16 0 obj +<< /Count 30 /Kids [ 26 0 R 25 0 R 27 0 R 28 0 R 29 0 R 17 0 R 30 0 R 31 0 R 32 0 R 33 0 R 34 0 R 19 0 R 21 0 R 20 0 R 35 0 R 18 0 R 36 0 R 37 0 R 22 0 R 23 0 R 38 0 R 39 0 R 24 0 R 40 0 R 41 0 R 42 0 R 43 0 R 44 0 R 45 0 R 46 0 R ] /Type /Pages >> +endobj +17 0 obj +<< /Contents 47 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +18 0 obj +<< /Contents 50 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +19 0 obj +<< /Contents 51 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +20 0 obj +<< /Contents 52 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +21 0 obj +<< /Contents 53 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +22 0 obj +<< /Contents 54 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +23 0 obj +<< /Contents 55 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +24 0 obj +<< /Contents 56 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +25 0 obj +<< /Contents 57 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +26 0 obj +<< /Contents 58 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +27 0 obj +<< /Contents 59 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +28 0 obj +<< /Contents 60 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +29 0 obj +<< /Contents 61 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +30 0 obj +<< /Contents 62 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +31 0 obj +<< /Contents 63 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +32 0 obj +<< /Contents 64 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +33 0 obj +<< /Contents 65 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +34 0 obj +<< /Contents 66 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +35 0 obj +<< /Contents 67 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +36 0 obj +<< /Contents 68 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +37 0 obj +<< /Contents 69 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +38 0 obj +<< /Contents 70 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +39 0 obj +<< /Contents 71 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +40 0 obj +<< /Contents 72 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +41 0 obj +<< /Contents 73 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +42 0 obj +<< /Contents 74 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +43 0 obj +<< /Contents 75 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +44 0 obj +<< /Contents 76 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +45 0 obj +<< /Contents 77 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +46 0 obj +<< /Contents 78 0 R /MediaBox [ 0 0 612 792 ] /Parent 16 0 R /Resources << /Font << /F1 48 0 R >> /ProcSet 49 0 R >> /Type /Page >> +endobj +47 0 obj +<< /Length 46 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 5) Tj +ET +endstream +endobj +48 0 obj +<< /BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font >> +endobj +49 0 obj +[ /PDF /Text ] +endobj +50 0 obj +<< /Length 47 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 15) Tj +ET +endstream +endobj +51 0 obj +<< /Length 47 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 11) Tj +ET +endstream +endobj +52 0 obj +<< /Length 47 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 13) Tj +ET +endstream +endobj +53 0 obj +<< /Length 47 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 12) Tj +ET +endstream +endobj +54 0 obj +<< /Length 47 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 18) Tj +ET +endstream +endobj +55 0 obj +<< /Length 47 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 19) Tj +ET +endstream +endobj +56 0 obj +<< /Length 47 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 22) Tj +ET +endstream +endobj +57 0 obj +<< /Length 46 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 1) Tj +ET +endstream +endobj +58 0 obj +<< /Length 46 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 0) Tj +ET +endstream +endobj +59 0 obj +<< /Length 46 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 2) Tj +ET +endstream +endobj +60 0 obj +<< /Length 46 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 3) Tj +ET +endstream +endobj +61 0 obj +<< /Length 46 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 4) Tj +ET +endstream +endobj +62 0 obj +<< /Length 46 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 6) Tj +ET +endstream +endobj +63 0 obj +<< /Length 46 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 7) Tj +ET +endstream +endobj +64 0 obj +<< /Length 46 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 8) Tj +ET +endstream +endobj +65 0 obj +<< /Length 46 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 9) Tj +ET +endstream +endobj +66 0 obj +<< /Length 47 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 10) Tj +ET +endstream +endobj +67 0 obj +<< /Length 47 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 14) Tj +ET +endstream +endobj +68 0 obj +<< /Length 47 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 16) Tj +ET +endstream +endobj +69 0 obj +<< /Length 47 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 17) Tj +ET +endstream +endobj +70 0 obj +<< /Length 47 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 20) Tj +ET +endstream +endobj +71 0 obj +<< /Length 47 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 21) Tj +ET +endstream +endobj +72 0 obj +<< /Length 47 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 23) Tj +ET +endstream +endobj +73 0 obj +<< /Length 47 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 24) Tj +ET +endstream +endobj +74 0 obj +<< /Length 47 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 25) Tj +ET +endstream +endobj +75 0 obj +<< /Length 47 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 26) Tj +ET +endstream +endobj +76 0 obj +<< /Length 47 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 27) Tj +ET +endstream +endobj +77 0 obj +<< /Length 47 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 28) Tj +ET +endstream +endobj +78 0 obj +<< /Length 47 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 29) Tj +ET +endstream +endobj +79 0 obj +<< /Type /XRef /Length 320 /W [ 1 2 1 ] /Root 1 0 R /Size 80 /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] >> +stream +{  +  Ü å +y  ¡ 5 É ] ñ…­AÕiý‘%¹Máu 1ÅYí©= (‰êK¬ nÏ/ï O ¯!!o!Ï"/""ñ#R#³$$u$Ö%7%˜%ù&Z&»' +endstream +endobj +startxref +10012 +%%EOF diff --git a/qpdf/qtest/qpdf/c-write-damaged.out b/qpdf/qtest/qpdf/c-write-damaged.out new file mode 100644 index 0000000..16c4390 --- /dev/null +++ b/qpdf/qtest/qpdf/c-write-damaged.out @@ -0,0 +1,15 @@ +warning: append-page-content-damaged.pdf: file is damaged + code: 5 + file: append-page-content-damaged.pdf + pos : 0 + text: file is damaged +warning: append-page-content-damaged.pdf: can't find startxref + code: 5 + file: append-page-content-damaged.pdf + pos : 0 + text: can't find startxref +warning: append-page-content-damaged.pdf: Attempting to reconstruct cross-reference table + code: 5 + file: append-page-content-damaged.pdf + pos : 0 + text: Attempting to reconstruct cross-reference table diff --git a/qpdf/qtest/qpdf/c-write-errors.out b/qpdf/qtest/qpdf/c-write-errors.out new file mode 100644 index 0000000..211cfdf --- /dev/null +++ b/qpdf/qtest/qpdf/c-write-errors.out @@ -0,0 +1,5 @@ +error: bad30.pdf (file position 629): stream filter type is not name or array + code: 5 + file: bad30.pdf + pos : 629 + text: stream filter type is not name or array diff --git a/qpdf/qtest/qpdf/c-write-warnings-and-errors.out b/qpdf/qtest/qpdf/c-write-warnings-and-errors.out new file mode 100644 index 0000000..d486d59 --- /dev/null +++ b/qpdf/qtest/qpdf/c-write-warnings-and-errors.out @@ -0,0 +1,20 @@ +warning: bad33.pdf: file is damaged + code: 5 + file: bad33.pdf + pos : 0 + text: file is damaged +warning: bad33.pdf (file position 1771): xref not found + code: 5 + file: bad33.pdf + pos : 1771 + text: xref not found +warning: bad33.pdf: Attempting to reconstruct cross-reference table + code: 5 + file: bad33.pdf + pos : 0 + text: Attempting to reconstruct cross-reference table +error: bad33.pdf (file position 629): stream filter type is not name or array + code: 5 + file: bad33.pdf + pos : 629 + text: stream filter type is not name or array diff --git a/qpdf/qtest/qpdf/check-ID.pl b/qpdf/qtest/qpdf/check-ID.pl new file mode 100644 index 0000000..963b48f --- /dev/null +++ b/qpdf/qtest/qpdf/check-ID.pl @@ -0,0 +1,20 @@ +use strict; +$^W=1; + +my $okay = 0; +my $id = '31415926535897932384626433832795'; +while (<>) +{ + if ((m,/ID ?\[<([[:xdigit:]]{32})><$id>\],) && ($1 ne $id)) + { + $okay = 1; + } +} +if ($okay) +{ + print "ID okay\n"; +} +else +{ + print "ID bad\n"; +} diff --git a/qpdf/qtest/qpdf/compressed-metadata.pdf b/qpdf/qtest/qpdf/compressed-metadata.pdf new file mode 100644 index 0000000..1d93bb3 Binary files /dev/null and b/qpdf/qtest/qpdf/compressed-metadata.pdf differ diff --git a/qpdf/qtest/qpdf/copied-encryption.out b/qpdf/qtest/qpdf/copied-encryption.out new file mode 100644 index 0000000..cbec230 --- /dev/null +++ b/qpdf/qtest/qpdf/copied-encryption.out @@ -0,0 +1,15 @@ +R = 4 +P = -20 +User password = user +extract for accessibility: allowed +extract for any purpose: not allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +stream encryption method: AESv2 +string encryption method: AESv2 +file encryption method: AESv2 diff --git a/qpdf/qtest/qpdf/copy-foreign-objects-errors.out b/qpdf/qtest/qpdf/copy-foreign-objects-errors.out new file mode 100644 index 0000000..2660a96 --- /dev/null +++ b/qpdf/qtest/qpdf/copy-foreign-objects-errors.out @@ -0,0 +1,3 @@ +logic error: QPDF::copyForeign called with object from this QPDF +logic error: QPDF::copyForeign called with direct object handle +test 28 done diff --git a/qpdf/qtest/qpdf/copy-foreign-objects-in.pdf b/qpdf/qtest/qpdf/copy-foreign-objects-in.pdf new file mode 100644 index 0000000..caa4d8f --- /dev/null +++ b/qpdf/qtest/qpdf/copy-foreign-objects-in.pdf @@ -0,0 +1,335 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +% This test file is specifically crafted for testing copyForeignObject +% and also for testing addPage when called with a page from another +% file. + +% The /QTest key in trailer has pointers to several indirect objects: +% O1, O2, O3 where O1 is an array that contains a dictionary that has +% a key that points to O2, O2 is a dictionary that contains an array +% that points to O1, and O3 is a page object that inherits some +% resource from its parent /Pages and also points to some other page. +% O1 also points to a stream whose dictionary has a key that points to +% another stream whose dictionary points back to the first stream. + +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /Count 5 + /Kids [ + 3 0 R + 4 0 R + 5 0 R + 6 0 R + 7 0 R + ] + /Rotate 180 + /Type /Pages +>> +endobj + +%% Page 1 +3 0 obj +<< + /Contents 8 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 10 0 R + >> + /ProcSet [ + /PDF + /Text + ] + >> + /Type /Page +>> +endobj + +%% Page 2 +4 0 obj +<< + /Contents 11 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 10 0 R + >> + /ProcSet [ + /PDF + /Text + ] + >> + /Type /Page +>> +endobj + +%% Page 3, object O3 +5 0 obj +<< + /This-is-O3 true + /Contents 13 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 10 0 R + >> + /ProcSet [ + /PDF + /Text + ] + >> + /OtherPage 6 0 R + /Type /Page +>> +endobj + +%% Page 4 +6 0 obj +<< + /This-is-O3-other-page true + /Contents 15 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 10 0 R + >> + /ProcSet [ + /PDF + /Text + ] + >> + /Type /Page +>> +endobj + +%% Page 5 +7 0 obj +<< + /Contents 17 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 10 0 R + >> + /ProcSet [ + /PDF + /Text + ] + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +8 0 obj +<< + /Length 9 0 R +>> +stream +BT /F1 15 Tf 72 720 Td (Original page 0) Tj ET +endstream +endobj + +9 0 obj +47 +endobj + +10 0 obj +<< + /BaseFont /Times-Roman + /Encoding /WinAnsiEncoding + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Contents for page 2 +11 0 obj +<< + /Length 12 0 R +>> +stream +BT /F1 15 Tf 72 720 Td (Original page 1) Tj ET +endstream +endobj + +12 0 obj +47 +endobj + +%% Contents for page 3 +13 0 obj +<< + /Length 14 0 R +>> +stream +BT /F1 15 Tf 72 720 Td (Original page 2) Tj ET +endstream +endobj + +14 0 obj +47 +endobj + +%% Contents for page 4 +15 0 obj +<< + /Length 16 0 R +>> +stream +BT /F1 15 Tf 72 720 Td (Original page 3) Tj ET +endstream +endobj + +16 0 obj +47 +endobj + +%% Contents for page 5 +17 0 obj +<< + /Length 18 0 R +>> +stream +BT /F1 15 Tf 72 720 Td (Original page 4) Tj ET +endstream +endobj + +18 0 obj +47 +endobj + +% O1 +19 0 obj +[ + /This-is-O1 + /potato + << /O2 [3.14159 << /O2 20 0 R >> 2.17828 ] >> + /salad + /O2 20 0 R + /Stream1 21 0 R +] +endobj + +% O2 +20 0 obj +<< + /This-is-O2 true + /K1 [2.236 /O1 19 0 R 1.732] + /O1 19 0 R +>> +endobj + +% stream1 +21 0 obj +<< + /This-is-Stream1 true + /Length 22 0 R + /Stream2 23 0 R +>> +stream +This is stream 1. +endstream +endobj + +22 0 obj +18 +endobj + +% stream2 +23 0 obj +<< + /This-is-Stream2 true + /Length 24 0 R + /Stream1 21 0 R +>> +stream +This is stream 2. +endstream +endobj + +24 0 obj +18 +endobj + +% QTest +25 0 obj +<< /This-is-QTest true /O1 19 0 R /O2 20 0 R /O3 5 0 R >> +endobj + +xref +0 26 +0000000000 65535 f +0000000655 00000 n +0000000709 00000 n +0000000845 00000 n +0000001073 00000 n +0000001313 00000 n +0000001580 00000 n +0000001839 00000 n +0000002081 00000 n +0000002183 00000 n +0000002202 00000 n +0000002334 00000 n +0000002438 00000 n +0000002481 00000 n +0000002585 00000 n +0000002628 00000 n +0000002732 00000 n +0000002775 00000 n +0000002879 00000 n +0000002904 00000 n +0000003042 00000 n +0000003138 00000 n +0000003255 00000 n +0000003285 00000 n +0000003402 00000 n +0000003430 00000 n +trailer << + /Root 1 0 R + /Size 26 + /QTest 25 0 R + /ID [<9adb6b2fdb22e857340f7103917b16e4>] +>> +startxref +3505 +%%EOF diff --git a/qpdf/qtest/qpdf/copy-foreign-objects-out1.pdf b/qpdf/qtest/qpdf/copy-foreign-objects-out1.pdf new file mode 100644 index 0000000..49de3cd --- /dev/null +++ b/qpdf/qtest/qpdf/copy-foreign-objects-out1.pdf @@ -0,0 +1,66 @@ +%PDF-1.3 +%¿÷¢þ +1 0 obj +<< /Pages 3 0 R /Type /Catalog >> +endobj +2 0 obj +<< /O1 4 0 R /O2 5 0 R /This-is-QTest true >> +endobj +3 0 obj +<< /Count 1 /Kids [ 6 0 R ] /Type /Pages >> +endobj +4 0 obj +[ /This-is-O1 /potato << /O2 [ 3.14159 << /O2 5 0 R >> 2.17828 ] >> /salad /O2 5 0 R /Stream1 7 0 R ] +endobj +5 0 obj +<< /K1 [ 2.236 /O1 4 0 R 1.732 ] /O1 4 0 R /This-is-O2 true >> +endobj +6 0 obj +<< /Contents 8 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 9 0 R >> /ProcSet 10 0 R >> /Type /Page >> +endobj +7 0 obj +<< /Stream2 11 0 R /This-is-Stream1 true /Length 18 >> +stream +This is stream 1. +endstream +endobj +8 0 obj +<< /Length 44 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj +9 0 obj +<< /BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font >> +endobj +10 0 obj +[ /PDF /Text ] +endobj +11 0 obj +<< /Stream1 7 0 R /This-is-Stream2 true /Length 18 >> +stream +This is stream 2. +endstream +endobj +xref +0 12 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000125 00000 n +0000000184 00000 n +0000000301 00000 n +0000000379 00000 n +0000000523 00000 n +0000000628 00000 n +0000000721 00000 n +0000000828 00000 n +0000000859 00000 n +trailer << /QTest 2 0 R /Root 1 0 R /Size 12 /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] >> +startxref +964 +%%EOF diff --git a/qpdf/qtest/qpdf/copy-foreign-objects-out2.pdf b/qpdf/qtest/qpdf/copy-foreign-objects-out2.pdf new file mode 100644 index 0000000..76529aa --- /dev/null +++ b/qpdf/qtest/qpdf/copy-foreign-objects-out2.pdf @@ -0,0 +1,81 @@ +%PDF-1.3 +%¿÷¢þ +1 0 obj +<< /Pages 3 0 R /Type /Catalog >> +endobj +2 0 obj +<< /O1 4 0 R /O2 5 0 R /O3 6 0 R /This-is-QTest true >> +endobj +3 0 obj +<< /Count 2 /Kids [ 7 0 R 6 0 R ] /Type /Pages >> +endobj +4 0 obj +[ /This-is-O1 /potato << /O2 [ 3.14159 << /O2 5 0 R >> 2.17828 ] >> /salad /O2 5 0 R /Stream1 8 0 R ] +endobj +5 0 obj +<< /K1 [ 2.236 /O1 4 0 R 1.732 ] /O1 4 0 R /This-is-O2 true >> +endobj +6 0 obj +<< /Contents 9 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 10 0 R >> /ProcSet [ /PDF /Text ] >> /Rotate 180 /This-is-O3 true /Type /Page >> +endobj +7 0 obj +<< /Contents 11 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 12 0 R >> /ProcSet 13 0 R >> /Type /Page >> +endobj +8 0 obj +<< /Stream2 14 0 R /This-is-Stream1 true /Length 18 >> +stream +This is stream 1. +endstream +endobj +9 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 2) Tj ET +endstream +endobj +10 0 obj +<< /BaseFont /Times-Roman /Encoding /WinAnsiEncoding /Subtype /Type1 /Type /Font >> +endobj +11 0 obj +<< /Length 44 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj +12 0 obj +<< /BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font >> +endobj +13 0 obj +[ /PDF /Text ] +endobj +14 0 obj +<< /Stream1 8 0 R /This-is-Stream2 true /Length 18 >> +stream +This is stream 2. +endstream +endobj +xref +0 15 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000135 00000 n +0000000200 00000 n +0000000317 00000 n +0000000395 00000 n +0000000577 00000 n +0000000723 00000 n +0000000828 00000 n +0000000924 00000 n +0000001024 00000 n +0000001118 00000 n +0000001226 00000 n +0000001257 00000 n +trailer << /QTest 2 0 R /Root 1 0 R /Size 15 /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] >> +startxref +1362 +%%EOF diff --git a/qpdf/qtest/qpdf/copy-foreign-objects-out3.pdf b/qpdf/qtest/qpdf/copy-foreign-objects-out3.pdf new file mode 100644 index 0000000..f2911a2 --- /dev/null +++ b/qpdf/qtest/qpdf/copy-foreign-objects-out3.pdf @@ -0,0 +1,92 @@ +%PDF-1.3 +%¿÷¢þ +1 0 obj +<< /Pages 3 0 R /Type /Catalog >> +endobj +2 0 obj +<< /O1 4 0 R /O2 5 0 R /O3 6 0 R /This-is-QTest true >> +endobj +3 0 obj +<< /Count 3 /Kids [ 7 0 R 8 0 R 6 0 R ] /Type /Pages >> +endobj +4 0 obj +[ /This-is-O1 /potato << /O2 [ 3.14159 << /O2 5 0 R >> 2.17828 ] >> /salad /O2 5 0 R /Stream1 9 0 R ] +endobj +5 0 obj +<< /K1 [ 2.236 /O1 4 0 R 1.732 ] /O1 4 0 R /This-is-O2 true >> +endobj +6 0 obj +<< /Contents 10 0 R /MediaBox [ 0 0 612 792 ] /OtherPage 8 0 R /Parent 3 0 R /Resources << /Font << /F1 11 0 R >> /ProcSet [ /PDF /Text ] >> /Rotate 180 /This-is-O3 true /Type /Page >> +endobj +7 0 obj +<< /Contents 12 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 13 0 R >> /ProcSet 14 0 R >> /Type /Page >> +endobj +8 0 obj +<< /Contents 15 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 11 0 R >> /ProcSet [ /PDF /Text ] >> /Rotate 180 /This-is-O3-other-page true /Type /Page >> +endobj +9 0 obj +<< /Stream2 16 0 R /This-is-Stream1 true /Length 18 >> +stream +This is stream 1. +endstream +endobj +10 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 2) Tj ET +endstream +endobj +11 0 obj +<< /BaseFont /Times-Roman /Encoding /WinAnsiEncoding /Subtype /Type1 /Type /Font >> +endobj +12 0 obj +<< /Length 44 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj +13 0 obj +<< /BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font >> +endobj +14 0 obj +[ /PDF /Text ] +endobj +15 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 3) Tj ET +endstream +endobj +16 0 obj +<< /Stream1 9 0 R /This-is-Stream2 true /Length 18 >> +stream +This is stream 2. +endstream +endobj +xref +0 17 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000135 00000 n +0000000206 00000 n +0000000323 00000 n +0000000401 00000 n +0000000601 00000 n +0000000747 00000 n +0000000941 00000 n +0000001046 00000 n +0000001143 00000 n +0000001243 00000 n +0000001337 00000 n +0000001445 00000 n +0000001476 00000 n +0000001573 00000 n +trailer << /QTest 2 0 R /Root 1 0 R /Size 17 /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] >> +startxref +1678 +%%EOF diff --git a/qpdf/qtest/qpdf/damaged-stream-c-check.out b/qpdf/qtest/qpdf/damaged-stream-c-check.out new file mode 100644 index 0000000..b172362 --- /dev/null +++ b/qpdf/qtest/qpdf/damaged-stream-c-check.out @@ -0,0 +1 @@ +warning: damaged-stream.pdf: offset 426: error decoding stream data for object 5 0: LZWDecoder: bad code received diff --git a/qpdf/qtest/qpdf/damaged-stream.out b/qpdf/qtest/qpdf/damaged-stream.out new file mode 100644 index 0000000..39e7260 --- /dev/null +++ b/qpdf/qtest/qpdf/damaged-stream.out @@ -0,0 +1,5 @@ +checking damaged-stream.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +WARNING: damaged-stream.pdf (file position 426): error decoding stream data for object 5 0: LZWDecoder: bad code received diff --git a/qpdf/qtest/qpdf/damaged-stream.pdf b/qpdf/qtest/qpdf/damaged-stream.pdf new file mode 100644 index 0000000..32e7713 Binary files /dev/null and b/qpdf/qtest/qpdf/damaged-stream.pdf differ diff --git a/qpdf/qtest/qpdf/decrypted-crypt-filter.pdf b/qpdf/qtest/qpdf/decrypted-crypt-filter.pdf new file mode 100644 index 0000000..75e7f78 Binary files /dev/null and b/qpdf/qtest/qpdf/decrypted-crypt-filter.pdf differ diff --git a/qpdf/qtest/qpdf/delete-and-reuse.pdf b/qpdf/qtest/qpdf/delete-and-reuse.pdf new file mode 100644 index 0000000..53a89ae --- /dev/null +++ b/qpdf/qtest/qpdf/delete-and-reuse.pdf @@ -0,0 +1,1573 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /PageLabels 107 0 R + /Pages 2 0 R + /Type /Catalog + /PageMode /UseOutlines + /Outlines 95 0 R +>> +endobj + +2 0 obj +<< + /Count 30 + /Kids [ + 3 0 R + 4 0 R + 5 0 R + 6 0 R + 7 0 R + 8 0 R + 9 0 R + 10 0 R + 11 0 R + 12 0 R + 13 0 R + 14 0 R + 15 0 R + 16 0 R + 17 0 R + 18 0 R + 19 0 R + 20 0 R + 21 0 R + 22 0 R + 23 0 R + 24 0 R + 25 0 R + 26 0 R + 27 0 R + 28 0 R + 29 0 R + 30 0 R + 31 0 R + 32 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +3 0 obj +<< + /Contents 33 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 2 +4 0 obj +<< + /Contents 37 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 3 +5 0 obj +<< + /Contents 39 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 4 +6 0 obj +<< + /Contents 41 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 5 +7 0 obj +<< + /Contents 43 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 6 +8 0 obj +<< + /Contents 45 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 7 +9 0 obj +<< + /Contents 47 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 8 +10 0 obj +<< + /Contents 49 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 9 +11 0 obj +<< + /Contents 51 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 10 +12 0 obj +<< + /Contents 53 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 11 +13 0 obj +<< + /Contents 55 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 12 +14 0 obj +<< + /Contents 57 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 13 +15 0 obj +<< + /Contents 59 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 14 +16 0 obj +<< + /Contents 61 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 15 +17 0 obj +<< + /Contents 63 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 16 +18 0 obj +<< + /Contents 65 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 17 +19 0 obj +<< + /Contents 67 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 18 +20 0 obj +<< + /Contents 69 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 19 +21 0 obj +<< + /Contents 71 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 20 +22 0 obj +<< + /Contents 73 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 21 +23 0 obj +<< + /Contents 75 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 22 +24 0 obj +<< + /Contents 77 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 23 +25 0 obj +<< + /Contents 79 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 24 +26 0 obj +<< + /Contents 81 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 25 +27 0 obj +<< + /Contents 83 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 26 +28 0 obj +<< + /Contents 85 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 27 +29 0 obj +<< + /Contents 87 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 28 +30 0 obj +<< + /Contents 89 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 29 +31 0 obj +<< + /Contents 91 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 30 +32 0 obj +<< + /Contents 93 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +33 0 obj +<< + /Length 34 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 0) Tj +ET +endstream +endobj + +34 0 obj +46 +endobj + +35 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +36 0 obj +[ + /PDF + /Text +] +endobj + +%% Contents for page 2 +37 0 obj +<< + /Length 38 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 1) Tj +ET +endstream +endobj + +38 0 obj +46 +endobj + +%% Contents for page 3 +39 0 obj +<< + /Length 40 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 2) Tj +ET +endstream +endobj + +40 0 obj +46 +endobj + +%% Contents for page 4 +41 0 obj +<< + /Length 42 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 3) Tj +ET +endstream +endobj + +42 0 obj +46 +endobj + +%% Contents for page 5 +43 0 obj +<< + /Length 44 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 4) Tj +ET +endstream +endobj + +44 0 obj +46 +endobj + +%% Contents for page 6 +45 0 obj +<< + /Length 46 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 5) Tj +ET +endstream +endobj + +46 0 obj +46 +endobj + +%% Contents for page 7 +47 0 obj +<< + /Length 48 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 6) Tj +ET +endstream +endobj + +48 0 obj +46 +endobj + +%% Contents for page 8 +49 0 obj +<< + /Length 50 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 7) Tj +ET +endstream +endobj + +50 0 obj +46 +endobj + +%% Contents for page 9 +51 0 obj +<< + /Length 52 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 8) Tj +ET +endstream +endobj + +52 0 obj +46 +endobj + +%% Contents for page 10 +53 0 obj +<< + /Length 54 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 9) Tj +ET +endstream +endobj + +54 0 obj +46 +endobj + +%% Contents for page 11 +55 0 obj +<< + /Length 56 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 10) Tj +ET +endstream +endobj + +56 0 obj +47 +endobj + +%% Contents for page 12 +57 0 obj +<< + /Length 58 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 11) Tj +ET +endstream +endobj + +58 0 obj +47 +endobj + +%% Contents for page 13 +59 0 obj +<< + /Length 60 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 12) Tj +ET +endstream +endobj + +60 0 obj +47 +endobj + +%% Contents for page 14 +61 0 obj +<< + /Length 62 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 13) Tj +ET +endstream +endobj + +62 0 obj +47 +endobj + +%% Contents for page 15 +63 0 obj +<< + /Length 64 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 14) Tj +ET +endstream +endobj + +64 0 obj +47 +endobj + +%% Contents for page 16 +65 0 obj +<< + /Length 66 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 15) Tj +ET +endstream +endobj + +66 0 obj +47 +endobj + +%% Contents for page 17 +67 0 obj +<< + /Length 68 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 16) Tj +ET +endstream +endobj + +68 0 obj +47 +endobj + +%% Contents for page 18 +69 0 obj +<< + /Length 70 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 17) Tj +ET +endstream +endobj + +70 0 obj +47 +endobj + +%% Contents for page 19 +71 0 obj +<< + /Length 72 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 18) Tj +ET +endstream +endobj + +72 0 obj +47 +endobj + +%% Contents for page 20 +73 0 obj +<< + /Length 74 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 19) Tj +ET +endstream +endobj + +74 0 obj +47 +endobj + +%% Contents for page 21 +75 0 obj +<< + /Length 76 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 20) Tj +ET +endstream +endobj + +76 0 obj +47 +endobj + +%% Contents for page 22 +77 0 obj +<< + /Length 78 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 21) Tj +ET +endstream +endobj + +78 0 obj +47 +endobj + +%% Contents for page 23 +79 0 obj +<< + /Length 80 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 22) Tj +ET +endstream +endobj + +80 0 obj +47 +endobj + +%% Contents for page 24 +81 0 obj +<< + /Length 82 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 23) Tj +ET +endstream +endobj + +82 0 obj +47 +endobj + +%% Contents for page 25 +83 0 obj +<< + /Length 84 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 24) Tj +ET +endstream +endobj + +84 0 obj +47 +endobj + +%% Contents for page 26 +85 0 obj +<< + /Length 86 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 25) Tj +ET +endstream +endobj + +86 0 obj +47 +endobj + +%% Contents for page 27 +87 0 obj +<< + /Length 88 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 26) Tj +ET +endstream +endobj + +88 0 obj +47 +endobj + +%% Contents for page 28 +89 0 obj +<< + /Length 90 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 27) Tj +ET +endstream +endobj + +90 0 obj +47 +endobj + +%% Contents for page 29 +91 0 obj +<< + /Length 92 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 28) Tj +ET +endstream +endobj + +92 0 obj +47 +endobj + +%% Contents for page 30 +93 0 obj +<< + /Length 94 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 29) Tj +ET +endstream +endobj + +94 0 obj +47 +endobj + +95 0 obj +<< + /Type /Outlines + /First 96 0 R + /Last 97 0 R + /Count 6 +>> +endobj + +96 0 obj +<< + /Type /Outline + /Title (Isís 1 -> 5: /XYZ null null null) + /Parent 95 0 R + /Count 4 + /Next 97 0 R + /First 98 0 R + /Last 99 0 R + /Dest [ 8 0 R /XYZ null null null ] +>> +endobj + +97 0 obj +<< + /Type /Outline + /Title (Trepak 2 -> 15: /XYZ 66 756 3) + /Parent 95 0 R + /Prev 96 0 R + /Dest [ 18 0 R /XYZ 66 756 3 ] +>> +endobj + +98 0 obj +<< + /Type /Outline + /Title (Amanda 1.1 -> 11: /Fit) + /Parent 96 0 R + /Next 99 0 R + /First 100 0 R + /Last 101 0 R + /Count -3 + /Dest [ 14 0 R /Fit ] +>> +endobj + +99 0 obj +<< + /Type /Outline + % /Title (Sandy (Sandy [Greek]) 1.2 -> 13: /FitH 792) + /Title + /Parent 96 0 R + /Prev 98 0 R + /First 105 0 R + /Last 106 0 R + /Count 2 + /Dest [ 16 0 R /FitH 792 ] +>> +endobj + +100 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.1 -> 12: /FitV 100) + /Parent 98 0 R + /Next 101 0 R + /First 102 0 R + /Last 103 0 R + /Count -2 + /Dest [ 15 0 R /FitV 100 ] +>> +endobj + +101 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.2 -> 12: /XYZ null null null) + /Parent 98 0 R + /Prev 100 0 R + /First 104 0 R + /Last 104 0 R + /Count 1 + /Dest [ 15 0 R /XYZ null null null ] +>> +endobj + +102 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.1.1 -> 18: /XYZ null null null) + /Parent 100 0 R + /Next 103 0 R + /Dest [ 21 0 R /XYZ null null null ] +>> +endobj + +103 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.1.2 -> 19: /XYZ null null null) + /Parent 100 0 R + /Prev 102 0 R + /Dest [ 22 0 R /XYZ null null null ] +>> +endobj + +104 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.2.1 -> 22: /XYZ null null null) + /Parent 101 0 R + /Dest [ 25 0 R /XYZ null null null ] +>> +endobj + +105 0 obj +<< + /Type /Outline + /Title (Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770) + /Parent 99 0 R + /Next 106 0 R + /Dest [ 4 0 R /FitR 66 714 180 770 ] +>> +endobj + +106 0 obj +<< + /Type /Outline + /Title (Trepsicle 1.2.2 -> 0: /XYZ null null null) + /Parent 99 0 R + /Prev 105 0 R + /Dest [ 3 0 R /XYZ null null null ] +>> +endobj + +107 0 obj + << /Nums [ + 0 << /P () >> + 2 << /S /r /St 1 >> + 7 << /P () >> + 9 << /S /r /St 6 >> + 11 << /P () >> + 12 << /S /D /St 2 >> + 15 << /S /D /St 6 >> + 19 << /P () >> + 20 << /S /D /St 12 >> + 22 << /S /D /St 16059 >> + 23 << /S /r /St 50 >> + 29 << /S /r /St 54 >> + ] >> +endobj + +xref +0 108 +0000000000 65535 f +0000000025 00000 n +0000000145 00000 n +0000000541 00000 n +0000000746 00000 n +0000000951 00000 n +0000001156 00000 n +0000001361 00000 n +0000001566 00000 n +0000001771 00000 n +0000001976 00000 n +0000002182 00000 n +0000002389 00000 n +0000002596 00000 n +0000002803 00000 n +0000003010 00000 n +0000003217 00000 n +0000003424 00000 n +0000003631 00000 n +0000003838 00000 n +0000004045 00000 n +0000004252 00000 n +0000004459 00000 n +0000004666 00000 n +0000004873 00000 n +0000005080 00000 n +0000005287 00000 n +0000005494 00000 n +0000005701 00000 n +0000005908 00000 n +0000006115 00000 n +0000006322 00000 n +0000006529 00000 n +0000006748 00000 n +0000006851 00000 n +0000006871 00000 n +0000006990 00000 n +0000007049 00000 n +0000007152 00000 n +0000007195 00000 n +0000007298 00000 n +0000007341 00000 n +0000007444 00000 n +0000007487 00000 n +0000007590 00000 n +0000007633 00000 n +0000007736 00000 n +0000007779 00000 n +0000007882 00000 n +0000007925 00000 n +0000008028 00000 n +0000008071 00000 n +0000008174 00000 n +0000008218 00000 n +0000008321 00000 n +0000008365 00000 n +0000008469 00000 n +0000008513 00000 n +0000008617 00000 n +0000008661 00000 n +0000008765 00000 n +0000008809 00000 n +0000008913 00000 n +0000008957 00000 n +0000009061 00000 n +0000009105 00000 n +0000009209 00000 n +0000009253 00000 n +0000009357 00000 n +0000009401 00000 n +0000009505 00000 n +0000009549 00000 n +0000009653 00000 n +0000009697 00000 n +0000009801 00000 n +0000009845 00000 n +0000009949 00000 n +0000009993 00000 n +0000010097 00000 n +0000010141 00000 n +0000010245 00000 n +0000010289 00000 n +0000010393 00000 n +0000010437 00000 n +0000010541 00000 n +0000010585 00000 n +0000010689 00000 n +0000010733 00000 n +0000010837 00000 n +0000010881 00000 n +0000010985 00000 n +0000011029 00000 n +0000011133 00000 n +0000011177 00000 n +0000011281 00000 n +0000011301 00000 n +0000011388 00000 n +0000011584 00000 n +0000011730 00000 n +0000011905 00000 n +0000012258 00000 n +0000012449 00000 n +0000012659 00000 n +0000012828 00000 n +0000012997 00000 n +0000013150 00000 n +0000013319 00000 n +0000013484 00000 n +trailer << + /Root 1 0 R + /Size 108 +>> +startxref +13801 +%%EOF + +% 1. Delete page labels +xref +0 1 +0000000107 65535 f +107 1 +0000000000 00001 f +trailer << /Root 1 0 R /Size 108 /Prev 13801 >> +startxref +16059 +%%EOF + +% 2. Delete outlines, reuse page labels. + +107 1 obj + << /Nums [ + 0 << /P () >> + 2 << /S /D /St 1 >> + 7 << /P () >> + 9 << /S /R /St 6 >> + 11 << /P () >> + 12 << /S /r /St 2 >> + 15 << /S /r /St 6 >> + 19 << /P () >> + 20 << /S /R /St 12 >> + 22 << /S /D /St 16059 >> + 23 << /S /r /St 50 >> + 29 << /S /r /St 54 >> + ] >> +endobj + +% Reuse object 1 with the same generation number. Leave outlines +% there pointing to a deleted object. +1 0 obj +<< + /PageLabels 107 1 R + /Pages 2 0 R + /Type /Catalog + /PageMode /UseOutlines + /Outlines 95 0 R +>> +endobj + +xref +0 2 +0000000095 65535 f +0000016648 00000 n +95 13 +0000000096 00001 f +0000000097 00001 f +0000000098 00001 f +0000000099 00001 f +0000000100 00001 f +0000000101 00001 f +0000000102 00001 f +0000000103 00001 f +0000000104 00001 f +0000000105 00001 f +0000000106 00001 f +0000000000 00001 f +0000016227 00001 n +trailer << /Size 108 /Prev 16059 /Root 1 0 R >> +startxref +16768 +%%EOF diff --git a/qpdf/qtest/qpdf/delete-and-reuse.qdf b/qpdf/qtest/qpdf/delete-and-reuse.qdf new file mode 100644 index 0000000..14fbbdb --- /dev/null +++ b/qpdf/qtest/qpdf/delete-and-reuse.qdf @@ -0,0 +1,1408 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /PageLabels 2 0 R + /PageMode /UseOutlines + /Pages 3 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /Nums [ + 0 + << + /P () + >> + 2 + << + /S /D + /St 1 + >> + 7 + << + /P () + >> + 9 + << + /S /R + /St 6 + >> + 11 + << + /P () + >> + 12 + << + /S /r + /St 2 + >> + 15 + << + /S /r + /St 6 + >> + 19 + << + /P () + >> + 20 + << + /S /R + /St 12 + >> + 22 + << + /S /D + /St 16059 + >> + 23 + << + /S /r + /St 50 + >> + 29 + << + /S /r + /St 54 + >> + ] +>> +endobj + +3 0 obj +<< + /Count 30 + /Kids [ + 4 0 R + 5 0 R + 6 0 R + 7 0 R + 8 0 R + 9 0 R + 10 0 R + 11 0 R + 12 0 R + 13 0 R + 14 0 R + 15 0 R + 16 0 R + 17 0 R + 18 0 R + 19 0 R + 20 0 R + 21 0 R + 22 0 R + 23 0 R + 24 0 R + 25 0 R + 26 0 R + 27 0 R + 28 0 R + 29 0 R + 30 0 R + 31 0 R + 32 0 R + 33 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +4 0 obj +<< + /Contents 34 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 2 +5 0 obj +<< + /Contents 38 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 3 +6 0 obj +<< + /Contents 40 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 4 +7 0 obj +<< + /Contents 42 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 5 +8 0 obj +<< + /Contents 44 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 6 +9 0 obj +<< + /Contents 46 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 7 +10 0 obj +<< + /Contents 48 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 8 +11 0 obj +<< + /Contents 50 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 9 +12 0 obj +<< + /Contents 52 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 10 +13 0 obj +<< + /Contents 54 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 11 +14 0 obj +<< + /Contents 56 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 12 +15 0 obj +<< + /Contents 58 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 13 +16 0 obj +<< + /Contents 60 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 14 +17 0 obj +<< + /Contents 62 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 15 +18 0 obj +<< + /Contents 64 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 16 +19 0 obj +<< + /Contents 66 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 17 +20 0 obj +<< + /Contents 68 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 18 +21 0 obj +<< + /Contents 70 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 19 +22 0 obj +<< + /Contents 72 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 20 +23 0 obj +<< + /Contents 74 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 21 +24 0 obj +<< + /Contents 76 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 22 +25 0 obj +<< + /Contents 78 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 23 +26 0 obj +<< + /Contents 80 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 24 +27 0 obj +<< + /Contents 82 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 25 +28 0 obj +<< + /Contents 84 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 26 +29 0 obj +<< + /Contents 86 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 27 +30 0 obj +<< + /Contents 88 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 28 +31 0 obj +<< + /Contents 90 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 29 +32 0 obj +<< + /Contents 92 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Page 30 +33 0 obj +<< + /Contents 94 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 36 0 R + >> + /ProcSet 37 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +34 0 obj +<< + /Length 35 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 0) Tj +ET +endstream +endobj + +35 0 obj +46 +endobj + +36 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +37 0 obj +[ + /PDF + /Text +] +endobj + +%% Contents for page 2 +38 0 obj +<< + /Length 39 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 1) Tj +ET +endstream +endobj + +39 0 obj +46 +endobj + +%% Contents for page 3 +40 0 obj +<< + /Length 41 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 2) Tj +ET +endstream +endobj + +41 0 obj +46 +endobj + +%% Contents for page 4 +42 0 obj +<< + /Length 43 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 3) Tj +ET +endstream +endobj + +43 0 obj +46 +endobj + +%% Contents for page 5 +44 0 obj +<< + /Length 45 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 4) Tj +ET +endstream +endobj + +45 0 obj +46 +endobj + +%% Contents for page 6 +46 0 obj +<< + /Length 47 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 5) Tj +ET +endstream +endobj + +47 0 obj +46 +endobj + +%% Contents for page 7 +48 0 obj +<< + /Length 49 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 6) Tj +ET +endstream +endobj + +49 0 obj +46 +endobj + +%% Contents for page 8 +50 0 obj +<< + /Length 51 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 7) Tj +ET +endstream +endobj + +51 0 obj +46 +endobj + +%% Contents for page 9 +52 0 obj +<< + /Length 53 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 8) Tj +ET +endstream +endobj + +53 0 obj +46 +endobj + +%% Contents for page 10 +54 0 obj +<< + /Length 55 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 9) Tj +ET +endstream +endobj + +55 0 obj +46 +endobj + +%% Contents for page 11 +56 0 obj +<< + /Length 57 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 10) Tj +ET +endstream +endobj + +57 0 obj +47 +endobj + +%% Contents for page 12 +58 0 obj +<< + /Length 59 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 11) Tj +ET +endstream +endobj + +59 0 obj +47 +endobj + +%% Contents for page 13 +60 0 obj +<< + /Length 61 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 12) Tj +ET +endstream +endobj + +61 0 obj +47 +endobj + +%% Contents for page 14 +62 0 obj +<< + /Length 63 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 13) Tj +ET +endstream +endobj + +63 0 obj +47 +endobj + +%% Contents for page 15 +64 0 obj +<< + /Length 65 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 14) Tj +ET +endstream +endobj + +65 0 obj +47 +endobj + +%% Contents for page 16 +66 0 obj +<< + /Length 67 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 15) Tj +ET +endstream +endobj + +67 0 obj +47 +endobj + +%% Contents for page 17 +68 0 obj +<< + /Length 69 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 16) Tj +ET +endstream +endobj + +69 0 obj +47 +endobj + +%% Contents for page 18 +70 0 obj +<< + /Length 71 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 17) Tj +ET +endstream +endobj + +71 0 obj +47 +endobj + +%% Contents for page 19 +72 0 obj +<< + /Length 73 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 18) Tj +ET +endstream +endobj + +73 0 obj +47 +endobj + +%% Contents for page 20 +74 0 obj +<< + /Length 75 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 19) Tj +ET +endstream +endobj + +75 0 obj +47 +endobj + +%% Contents for page 21 +76 0 obj +<< + /Length 77 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 20) Tj +ET +endstream +endobj + +77 0 obj +47 +endobj + +%% Contents for page 22 +78 0 obj +<< + /Length 79 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 21) Tj +ET +endstream +endobj + +79 0 obj +47 +endobj + +%% Contents for page 23 +80 0 obj +<< + /Length 81 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 22) Tj +ET +endstream +endobj + +81 0 obj +47 +endobj + +%% Contents for page 24 +82 0 obj +<< + /Length 83 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 23) Tj +ET +endstream +endobj + +83 0 obj +47 +endobj + +%% Contents for page 25 +84 0 obj +<< + /Length 85 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 24) Tj +ET +endstream +endobj + +85 0 obj +47 +endobj + +%% Contents for page 26 +86 0 obj +<< + /Length 87 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 25) Tj +ET +endstream +endobj + +87 0 obj +47 +endobj + +%% Contents for page 27 +88 0 obj +<< + /Length 89 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 26) Tj +ET +endstream +endobj + +89 0 obj +47 +endobj + +%% Contents for page 28 +90 0 obj +<< + /Length 91 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 27) Tj +ET +endstream +endobj + +91 0 obj +47 +endobj + +%% Contents for page 29 +92 0 obj +<< + /Length 93 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 28) Tj +ET +endstream +endobj + +93 0 obj +47 +endobj + +%% Contents for page 30 +94 0 obj +<< + /Length 95 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 29) Tj +ET +endstream +endobj + +95 0 obj +47 +endobj + +xref +0 96 +0000000000 65535 f +0000000025 00000 n +0000000124 00000 n +0000000655 00000 n +0000001052 00000 n +0000001257 00000 n +0000001462 00000 n +0000001667 00000 n +0000001872 00000 n +0000002077 00000 n +0000002282 00000 n +0000002488 00000 n +0000002694 00000 n +0000002901 00000 n +0000003108 00000 n +0000003315 00000 n +0000003522 00000 n +0000003729 00000 n +0000003936 00000 n +0000004143 00000 n +0000004350 00000 n +0000004557 00000 n +0000004764 00000 n +0000004971 00000 n +0000005178 00000 n +0000005385 00000 n +0000005592 00000 n +0000005799 00000 n +0000006006 00000 n +0000006213 00000 n +0000006420 00000 n +0000006627 00000 n +0000006834 00000 n +0000007041 00000 n +0000007260 00000 n +0000007363 00000 n +0000007383 00000 n +0000007502 00000 n +0000007561 00000 n +0000007664 00000 n +0000007707 00000 n +0000007810 00000 n +0000007853 00000 n +0000007956 00000 n +0000007999 00000 n +0000008102 00000 n +0000008145 00000 n +0000008248 00000 n +0000008291 00000 n +0000008394 00000 n +0000008437 00000 n +0000008540 00000 n +0000008583 00000 n +0000008686 00000 n +0000008730 00000 n +0000008833 00000 n +0000008877 00000 n +0000008981 00000 n +0000009025 00000 n +0000009129 00000 n +0000009173 00000 n +0000009277 00000 n +0000009321 00000 n +0000009425 00000 n +0000009469 00000 n +0000009573 00000 n +0000009617 00000 n +0000009721 00000 n +0000009765 00000 n +0000009869 00000 n +0000009913 00000 n +0000010017 00000 n +0000010061 00000 n +0000010165 00000 n +0000010209 00000 n +0000010313 00000 n +0000010357 00000 n +0000010461 00000 n +0000010505 00000 n +0000010609 00000 n +0000010653 00000 n +0000010757 00000 n +0000010801 00000 n +0000010905 00000 n +0000010949 00000 n +0000011053 00000 n +0000011097 00000 n +0000011201 00000 n +0000011245 00000 n +0000011349 00000 n +0000011393 00000 n +0000011497 00000 n +0000011541 00000 n +0000011645 00000 n +0000011689 00000 n +0000011793 00000 n +trailer << + /Root 1 0 R + /Size 96 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +startxref +11813 +%%EOF diff --git a/qpdf/qtest/qpdf/diff-encrypted b/qpdf/qtest/qpdf/diff-encrypted new file mode 100755 index 0000000..a68822e --- /dev/null +++ b/qpdf/qtest/qpdf/diff-encrypted @@ -0,0 +1,7 @@ +#!/bin/sh +lines=$(expr + $(diff $1 $2 | egrep '^[<>]' | egrep -v 'Date' | wc -l)) +if [ "$lines" = "0" ]; then + echo okay +else + diff -a -U 0 $1 $2 +fi diff --git a/qpdf/qtest/qpdf/diff-ignore-ID-version b/qpdf/qtest/qpdf/diff-ignore-ID-version new file mode 100755 index 0000000..e6b3347 --- /dev/null +++ b/qpdf/qtest/qpdf/diff-ignore-ID-version @@ -0,0 +1,8 @@ +#!/bin/sh +lines=$(expr + $(diff $1 $2 | egrep '^[<>]' | \ + egrep -v '/ID' | egrep -v '%PDF-' | wc -l)) +if [ "$lines" = "0" ]; then + echo okay +else + diff -a -U 0 $1 $2 +fi diff --git a/qpdf/qtest/qpdf/empty-object.out b/qpdf/qtest/qpdf/empty-object.out new file mode 100644 index 0000000..78274f8 --- /dev/null +++ b/qpdf/qtest/qpdf/empty-object.out @@ -0,0 +1,3 @@ +WARNING: empty-object.pdf (object 7 0, file position 575): empty object treated as null +null +qpdf: operation succeeded with warnings; resulting file may have some problems diff --git a/qpdf/qtest/qpdf/empty-object.pdf b/qpdf/qtest/qpdf/empty-object.pdf new file mode 100644 index 0000000..55eef2a --- /dev/null +++ b/qpdf/qtest/qpdf/empty-object.pdf @@ -0,0 +1,84 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R + /X 7 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +7 0 obj +endobj + +xref +0 8 +0000000000 65535 f +0000000009 00000 n +0000000074 00000 n +0000000146 00000 n +0000000318 00000 n +0000000414 00000 n +0000000449 00000 n +0000000567 00000 n +trailer << + /Size 8 + /Root 1 0 R +>> +startxref +583 +%%EOF diff --git a/qpdf/qtest/qpdf/enc-R2,V1,O=master.pdf b/qpdf/qtest/qpdf/enc-R2,V1,O=master.pdf new file mode 100644 index 0000000..bac7eae Binary files /dev/null and b/qpdf/qtest/qpdf/enc-R2,V1,O=master.pdf differ diff --git a/qpdf/qtest/qpdf/enc-R2,V1,U=view,O=master.pdf b/qpdf/qtest/qpdf/enc-R2,V1,U=view,O=master.pdf new file mode 100644 index 0000000..d549213 Binary files /dev/null and b/qpdf/qtest/qpdf/enc-R2,V1,U=view,O=master.pdf differ diff --git a/qpdf/qtest/qpdf/enc-R2,V1,U=view.pdf b/qpdf/qtest/qpdf/enc-R2,V1,U=view.pdf new file mode 100644 index 0000000..d99bf6f Binary files /dev/null and b/qpdf/qtest/qpdf/enc-R2,V1,U=view.pdf differ diff --git a/qpdf/qtest/qpdf/enc-R2,V1.pdf b/qpdf/qtest/qpdf/enc-R2,V1.pdf new file mode 100644 index 0000000..dec9e6d Binary files /dev/null and b/qpdf/qtest/qpdf/enc-R2,V1.pdf differ diff --git a/qpdf/qtest/qpdf/enc-R3,V2,O=master.pdf b/qpdf/qtest/qpdf/enc-R3,V2,O=master.pdf new file mode 100644 index 0000000..8858566 Binary files /dev/null and b/qpdf/qtest/qpdf/enc-R3,V2,O=master.pdf differ diff --git a/qpdf/qtest/qpdf/enc-R3,V2,U=view,O=master.pdf b/qpdf/qtest/qpdf/enc-R3,V2,U=view,O=master.pdf new file mode 100644 index 0000000..9b95ae3 Binary files /dev/null and b/qpdf/qtest/qpdf/enc-R3,V2,U=view,O=master.pdf differ diff --git a/qpdf/qtest/qpdf/enc-R3,V2,U=view.pdf b/qpdf/qtest/qpdf/enc-R3,V2,U=view.pdf new file mode 100644 index 0000000..a4efba7 Binary files /dev/null and b/qpdf/qtest/qpdf/enc-R3,V2,U=view.pdf differ diff --git a/qpdf/qtest/qpdf/enc-R3,V2.pdf b/qpdf/qtest/qpdf/enc-R3,V2.pdf new file mode 100644 index 0000000..8072788 Binary files /dev/null and b/qpdf/qtest/qpdf/enc-R3,V2.pdf differ diff --git a/qpdf/qtest/qpdf/enc-base.pdf b/qpdf/qtest/qpdf/enc-base.pdf new file mode 100644 index 0000000..bac5130 Binary files /dev/null and b/qpdf/qtest/qpdf/enc-base.pdf differ diff --git a/qpdf/qtest/qpdf/enc-long-password.pdf b/qpdf/qtest/qpdf/enc-long-password.pdf new file mode 100644 index 0000000..ef064fe Binary files /dev/null and b/qpdf/qtest/qpdf/enc-long-password.pdf differ diff --git a/qpdf/qtest/qpdf/encrypted-with-images.pdf b/qpdf/qtest/qpdf/encrypted-with-images.pdf new file mode 100644 index 0000000..dbceb44 Binary files /dev/null and b/qpdf/qtest/qpdf/encrypted-with-images.pdf differ diff --git a/qpdf/qtest/qpdf/encrypted1.out b/qpdf/qtest/qpdf/encrypted1.out new file mode 100644 index 0000000..99102b9 --- /dev/null +++ b/qpdf/qtest/qpdf/encrypted1.out @@ -0,0 +1,578 @@ +D:20000914005716 +Acrobat Distiller 4.05 for Windows +<68735ba82e3c37b5b8228510ba7e3ff6a57adff9901483de2357988c0a42aa48> + +1 g +/GS1 gs +1 i +178.226 60.781 344.491 -11.279 re +f +BT +/F4 1 Tf +9.999 0 0 9.999 178.2259 51.9016 Tm +0 g +0.003 Tc +0 Tw +[(T)7(h)-1(e)-249(U)5(ni)5(code)-249(St)5(andar)8(d)-253(3)-1(.0,)-251(C)10(opyr)8(i)5(ght)-247(©)-221(1991-2000,)-251(U)5(n)-1(i)5(c)3(ode,)-251(I)0(nc.)-251(A)2(l)5(l)-247(r)8(i)5(ght)5(s)-244(r)8(es)8(er)8(ved)]TJ +ET +1 g +72.035 60.781 15.119 -11.279 re +f +BT +9.999 0 0 9.999 72.0347 51.9016 Tm +0 g +0.004 Tc +(542)Tj +ET +1 g +490.8 769.802 31.197 -15.959 re +f +BT +/F5 1 Tf +13.9985 0 0 13.9985 490.7998 756.9629 Tm +0 g +0.0057 Tc +[(25F)8.1(F)]TJ +ET +1 g +242.541 769.802 108.831 -15.959 re +f +BT +13.9985 0 0 13.9985 242.5405 756.9629 Tm +0 g +0.0027 Tc +[(Geom)12.8(etric)-247.6(Shapes)]TJ +ET +1 g +72.035 769.802 31.317 -15.959 re +f +BT +13.9985 0 0 13.9985 72.0347 756.9629 Tm +0 g +0.0057 Tc +[(25A)7.7(0)]TJ +ET +0 G +2 J 1 j 1.49 w 10 M []0 d +202.104 727.685 m +202.104 79.259 l +391.928 727.685 m +391.928 79.259 l +202.104 712.807 m +391.928 712.807 l +202.104 79.259 m +391.928 79.259 l +S +BT +/F6 1 Tf +9.999 0 0 9.999 209.0633 719.286 Tm +-0.004 Tc +[(25A)-1389(25B)-1377(25C)-1346(25D)-1370(25E)-1413(25F)]TJ +ET +1 g +360.371 396.033 31.557 -39.597 re +f +/Cs9 cs 0 /P1 scn +360.371 396.033 31.557 -39.597 re +f +1 g +360.371 356.436 31.557 -39.597 re +f +/Cs9 cs 0 /P1 scn +360.371 356.436 31.557 -39.597 re +f +1 g +360.371 316.84 31.557 -39.597 re +f +/Cs9 cs 0 /P1 scn +360.371 316.84 31.557 -39.597 re +f +1 g +360.371 277.243 31.557 -39.597 re +f +/Cs9 cs 0 /P1 scn +360.371 277.243 31.557 -39.597 re +f +1 g +360.371 237.646 31.557 -39.597 re +f +/Cs9 cs 0 /P1 scn +360.371 237.646 31.557 -39.597 re +f +1 g +360.371 198.049 31.557 -39.597 re +f +/Cs9 cs 0 /P1 scn +360.371 198.049 31.557 -39.597 re +f +1 g +360.371 158.453 31.557 -39.597 re +f +/Cs9 cs 0 /P1 scn +360.371 158.453 31.557 -39.597 re +f +1 g +360.371 118.856 31.557 -39.597 re +f +/Cs9 cs 0 /P1 scn +360.371 118.856 31.557 -39.597 re +f +0.248 w +202.104 712.807 m +202.104 79.259 l +233.781 712.807 m +233.781 79.259 l +265.339 712.807 m +265.339 79.259 l +297.016 712.807 m +297.016 79.259 l +328.693 712.807 m +328.693 79.259 l +360.371 712.807 m +360.371 79.259 l +391.928 712.807 m +391.928 79.259 l +202.104 712.807 m +391.928 712.807 l +202.104 673.21 m +391.928 673.21 l +202.104 633.613 m +391.928 633.613 l +202.104 594.016 m +391.928 594.016 l +202.104 554.42 m +391.928 554.42 l +202.104 514.823 m +391.928 514.823 l +202.104 475.226 m +391.928 475.226 l +202.104 435.63 m +391.928 435.63 l +202.104 396.033 m +391.928 396.033 l +202.104 356.436 m +391.928 356.436 l +202.104 316.84 m +391.928 316.84 l +202.104 277.243 m +391.928 277.243 l +202.104 237.646 m +391.928 237.646 l +202.104 198.049 m +391.928 198.049 l +202.104 158.453 m +391.928 158.453 l +202.104 118.856 m +391.928 118.856 l +202.104 79.259 m +391.928 79.259 l +S +BT +/F7 1 Tf +21.998 0 0 21.998 209.6633 687.6086 Tm +0 g +0 Tc +()Tj +0 -1.8 TD +()Tj +T* +()Tj +T* +()Tj +T* +()Tj +T* +()Tj +T* +()Tj +T* +()Tj +T* +( )Tj +T* +(\012)Tj +/F9 1 Tf +0.2673 -1.8 TD +()Tj +T* +()Tj +/F7 1 Tf +-0.3436 -1.8 TD +( )Tj +T* +( )Tj +0.2018 -1.8 TD +(\015)Tj +T* +()Tj +1.2491 27.0002 TD +()Tj +0 -1.8 TD +()Tj +0.06 -1.8 TD +()Tj +T* +()Tj +0.2127 -1.8 TD +()Tj +T* +()Tj +-0.1636 -1.8 TD +()Tj +T* +()Tj +0.1855 -1.8 TD +()Tj +T* +()Tj +-0.1418 -1.8 TD +()Tj +T* +()Tj +-0.0927 -1.8 TD +()Tj +T* +()Tj +0.2127 -1.8 TD +()Tj +T* +()Tj +1.2764 27.0002 TD +()Tj +0 -1.8 TD +( )Tj +0.1855 -1.8 TD +(!)Tj +T* +(")Tj +-0.1418 -1.8 TD +(#)Tj +T* +($)Tj +-0.0927 -1.8 TD +(%)Tj +T* +(&)Tj +T* +(')Tj +T* +(\()Tj +0.0927 -1.8 TD +(\))Tj +-0.0927 -1.8 TD +(*)Tj +T* +(+)Tj +T* +(,)Tj +T* +(-)Tj +T* +(.)Tj +1.44 27.0002 TD +(/)Tj +0 -1.8 TD +(0)Tj +T* +(1)Tj +T* +(2)Tj +T* +(3)Tj +T* +(4)Tj +T* +(5)Tj +T* +(6)Tj +0.2018 -1.8 TD +(7)Tj +-0.2018 -1.8 TD +(8)Tj +T* +(9)Tj +T* +(:)Tj +T* +(;)Tj +T* +(<)Tj +T* +(=)Tj +T* +(>)Tj +1.44 27.0002 TD +(?)Tj +0 -1.8 TD +(@)Tj +T* +(A)Tj +T* +(B)Tj +T* +(C)Tj +T* +(D)Tj +0.2018 -1.8 TD +(E)Tj +-0.2018 -1.8 TD +(F)Tj +T* +(G)Tj +T* +(H)Tj +T* +(I)Tj +T* +(J)Tj +T* +(K)Tj +T* +(L)Tj +T* +(M)Tj +T* +(N)Tj +1.4346 27.0002 TD +(O)Tj +0 -1.8 TD +(P)Tj +T* +(Q)Tj +T* +(R)Tj +T* +(S)Tj +T* +(T)Tj +T* +(U)Tj +T* +(V)Tj +/F11 1 Tf +5.9995 0 0 5.9995 212.183 675.2496 Tm +0.004 Tc +[(25A)11(0)]TJ +0 -6.6 TD +[(25A)11(1)]TJ +T* +[(25A)11(2)]TJ +T* +[(25A)11(3)]TJ +T* +[(25A)11(4)]TJ +T* +[(25A)11(5)]TJ +T* +[(25A)11(6)]TJ +T* +[(25A)11(7)]TJ +T* +[(25A)11(8)]TJ +T* +[(25A)11(9)]TJ +-0.04 -6.6 TD +[(25A)11(A)]TJ +T* +[(25A)11(B)]TJ +-0.04 -6.6 TD +[(25A)11(C)]TJ +T* +[(25A)11(D)]TJ +0.04 -6.6 TD +[(25A)11(E)]TJ +0.02 -6.6 TD +[(25A)11(F)]TJ +5.28 99 TD +[(25B)11(0)]TJ +0 -6.6 TD +[(25B)11(1)]TJ +T* +[(25B)11(2)]TJ +T* +[(25B)11(3)]TJ +T* +[(25B)11(4)]TJ +T* +[(25B)11(5)]TJ +T* +[(25B)11(6)]TJ +T* +[(25B)11(7)]TJ +T* +[(25B)11(8)]TJ +T* +[(25B)11(9)]TJ +-0.04 -6.6 TD +[(25B)11(A)]TJ +T* +[(25B)11(B)]TJ +-0.04 -6.6 TD +[(25B)11(C)]TJ +T* +[(25B)11(D)]TJ +0.04 -6.6 TD +[(25B)11(E)]TJ +0.02 -6.6 TD +[(25B)11(F)]TJ +5.26 99 TD +0.0053 Tc +(25C0)Tj +0 -6.6 TD +(25C1)Tj +T* +(25C2)Tj +T* +(25C3)Tj +T* +(25C4)Tj +T* +(25C5)Tj +T* +(25C6)Tj +T* +(25C7)Tj +T* +(25C8)Tj +T* +(25C9)Tj +-0.04 -6.6 TD +(25CA)Tj +T* +(25CB)Tj +-0.02 -6.6 TD +(25CC)Tj +T* +(25CD)Tj +0.02 -6.6 TD +(25CE)Tj +0.02 -6.6 TD +(25CF)Tj +5.3 99 TD +(25D0)Tj +0 -6.6 TD +(25D1)Tj +T* +(25D2)Tj +T* +(25D3)Tj +T* +(25D4)Tj +T* +(25D5)Tj +T* +(25D6)Tj +T* +(25D7)Tj +T* +(25D8)Tj +T* +(25D9)Tj +-0.04 -6.6 TD +(25DA)Tj +T* +(25DB)Tj +-0.02 -6.6 TD +(25DC)Tj +T* +(25DD)Tj +0.02 -6.6 TD +(25DE)Tj +0.02 -6.6 TD +(25DF)Tj +5.34 99 TD +0.004 Tc +[(25E)11(0)]TJ +0 -6.6 TD +[(25E)11(1)]TJ +T* +[(25E)11(2)]TJ +T* +[(25E)11(3)]TJ +T* +[(25E)11(4)]TJ +T* +[(25E)11(5)]TJ +T* +[(25E)11(6)]TJ +T* +[(25E)11(7)]TJ +T* +[(25E)11(8)]TJ +T* +[(25E)11(9)]TJ +-0.04 -6.6 TD +[(25E)11(A)]TJ +T* +[(25E)11(B)]TJ +-0.04 -6.6 TD +[(25E)11(C)]TJ +T* +[(25E)11(D)]TJ +0.04 -6.6 TD +[(25E)11(E)]TJ +0.02 -6.6 TD +[(25E)11(F)]TJ +5.3 99 TD +0.0023 Tc +(25F0)Tj +0 -6.6 TD +(25F1)Tj +T* +(25F2)Tj +T* +(25F3)Tj +T* +(25F4)Tj +T* +(25F5)Tj +T* +(25F6)Tj +T* +(25F7)Tj +/F6 1 Tf +9.999 0 0 9.999 191.4248 687.6086 Tm +0 Tc +(0)Tj +0 -3.9601 TD +(1)Tj +T* +(2)Tj +T* +(3)Tj +T* +(4)Tj +T* +(5)Tj +T* +(6)Tj +T* +(7)Tj +T* +(8)Tj +T* +(9)Tj +-0.06 -3.9601 TD +(A)Tj +T* +(B)Tj +-0.024 -3.9601 TD +(C)Tj +T* +(D)Tj +0.024 -3.9601 TD +(E)Tj +0.024 -3.9601 TD +(F)Tj +ET +1.49 w +202.104 727.685 m +202.104 79.259 l +391.928 727.685 m +391.928 79.259 l +202.104 712.807 m +391.928 712.807 l +202.104 79.259 m +391.928 79.259 l +S +test 2 done diff --git a/qpdf/qtest/qpdf/eof-reading-token.out b/qpdf/qtest/qpdf/eof-reading-token.out new file mode 100644 index 0000000..58e5b09 --- /dev/null +++ b/qpdf/qtest/qpdf/eof-reading-token.out @@ -0,0 +1,5 @@ +checking eof-reading-token.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +object stream 12 (file position 5): EOF while reading token diff --git a/qpdf/qtest/qpdf/eof-reading-token.pdf b/qpdf/qtest/qpdf/eof-reading-token.pdf new file mode 100644 index 0000000..080bb50 Binary files /dev/null and b/qpdf/qtest/qpdf/eof-reading-token.pdf differ diff --git a/qpdf/qtest/qpdf/eof-terminates-literal.out b/qpdf/qtest/qpdf/eof-terminates-literal.out new file mode 100644 index 0000000..2feaefd --- /dev/null +++ b/qpdf/qtest/qpdf/eof-terminates-literal.out @@ -0,0 +1,6 @@ +checking eof-terminates-literal.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/eof-terminates-literal.pdf b/qpdf/qtest/qpdf/eof-terminates-literal.pdf new file mode 100644 index 0000000..e695ec5 Binary files /dev/null and b/qpdf/qtest/qpdf/eof-terminates-literal.pdf differ diff --git a/qpdf/qtest/qpdf/extra-header-lin-newline.pdf b/qpdf/qtest/qpdf/extra-header-lin-newline.pdf new file mode 100644 index 0000000..7a5ff3e Binary files /dev/null and b/qpdf/qtest/qpdf/extra-header-lin-newline.pdf differ diff --git a/qpdf/qtest/qpdf/extra-header-lin-no-newline.pdf b/qpdf/qtest/qpdf/extra-header-lin-no-newline.pdf new file mode 100644 index 0000000..e115c46 Binary files /dev/null and b/qpdf/qtest/qpdf/extra-header-lin-no-newline.pdf differ diff --git a/qpdf/qtest/qpdf/extra-header-newline.pdf b/qpdf/qtest/qpdf/extra-header-newline.pdf new file mode 100644 index 0000000..427623a Binary files /dev/null and b/qpdf/qtest/qpdf/extra-header-newline.pdf differ diff --git a/qpdf/qtest/qpdf/extra-header-no-newline.pdf b/qpdf/qtest/qpdf/extra-header-no-newline.pdf new file mode 100644 index 0000000..1df11d3 Binary files /dev/null and b/qpdf/qtest/qpdf/extra-header-no-newline.pdf differ diff --git a/qpdf/qtest/qpdf/fax-decode-parms.out b/qpdf/qtest/qpdf/fax-decode-parms.out new file mode 100644 index 0000000..17f4ce3 --- /dev/null +++ b/qpdf/qtest/qpdf/fax-decode-parms.out @@ -0,0 +1,6 @@ +checking fax-decode-parms.pdf +PDF Version: 1.4 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/fax-decode-parms.pdf b/qpdf/qtest/qpdf/fax-decode-parms.pdf new file mode 100644 index 0000000..2d8c336 Binary files /dev/null and b/qpdf/qtest/qpdf/fax-decode-parms.pdf differ diff --git a/qpdf/qtest/qpdf/filter-abbreviation.out b/qpdf/qtest/qpdf/filter-abbreviation.out new file mode 100644 index 0000000..aa9bf28 Binary files /dev/null and b/qpdf/qtest/qpdf/filter-abbreviation.out differ diff --git a/qpdf/qtest/qpdf/filter-abbreviation.pdf b/qpdf/qtest/qpdf/filter-abbreviation.pdf new file mode 100644 index 0000000..cdf39ac Binary files /dev/null and b/qpdf/qtest/qpdf/filter-abbreviation.pdf differ diff --git a/qpdf/qtest/qpdf/fix1.qdf b/qpdf/qtest/qpdf/fix1.qdf new file mode 100644 index 0000000..091372f --- /dev/null +++ b/qpdf/qtest/qpdf/fix1.qdf @@ -0,0 +1,111 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +3 0 obj +<< + /Contents [ 4 0 R 8 0 R ] + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 6 0 R + >> + /ProcSet 7 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +4 0 obj +<< + /Length 5 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato Soup) Tj +ET +endstream +endobj + +5 0 obj +44 +endobj + +6 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +7 0 obj +[ + /PDF + /Text +] +endobj + +8 0 obj +<< + /Length 9 0 R +>> +stream +BT + /F1 24 Tf + 72 648 Td + (and Salad) Tj +ET +endstream +endobj + +9 0 obj +0 +endobj + +xref +0 8 +0000000000 65535 f +0000000025 00000 n +0000000079 00000 n +0000000161 00000 n +0000000376 00000 n +0000000475 00000 n +0000000494 00000 n +0000000612 00000 n +trailer << + /Root 1 0 R + /Size 8 +>> +startxref +647 +%%EOF diff --git a/qpdf/qtest/qpdf/fix1.qdf.out b/qpdf/qtest/qpdf/fix1.qdf.out new file mode 100644 index 0000000..d436bce --- /dev/null +++ b/qpdf/qtest/qpdf/fix1.qdf.out @@ -0,0 +1,113 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +3 0 obj +<< + /Contents [ 4 0 R 8 0 R ] + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 6 0 R + >> + /ProcSet 7 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +4 0 obj +<< + /Length 5 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato Soup) Tj +ET +endstream +endobj + +5 0 obj +49 +endobj + +6 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +7 0 obj +[ + /PDF + /Text +] +endobj + +8 0 obj +<< + /Length 9 0 R +>> +stream +BT + /F1 24 Tf + 72 648 Td + (and Salad) Tj +ET +endstream +endobj + +9 0 obj +47 +endobj + +xref +0 10 +0000000000 65535 f +0000000025 00000 n +0000000079 00000 n +0000000161 00000 n +0000000386 00000 n +0000000490 00000 n +0000000509 00000 n +0000000627 00000 n +0000000662 00000 n +0000000764 00000 n +trailer << + /Root 1 0 R + /Size 10 +>> +startxref +783 +%%EOF diff --git a/qpdf/qtest/qpdf/fix2.qdf b/qpdf/qtest/qpdf/fix2.qdf new file mode 100644 index 0000000..c368523 Binary files /dev/null and b/qpdf/qtest/qpdf/fix2.qdf differ diff --git a/qpdf/qtest/qpdf/fix2.qdf.out b/qpdf/qtest/qpdf/fix2.qdf.out new file mode 100644 index 0000000..962adf6 Binary files /dev/null and b/qpdf/qtest/qpdf/fix2.qdf.out differ diff --git a/qpdf/qtest/qpdf/forced-version.out b/qpdf/qtest/qpdf/forced-version.out new file mode 100644 index 0000000..a7f3445 --- /dev/null +++ b/qpdf/qtest/qpdf/forced-version.out @@ -0,0 +1,6 @@ +checking b.pdf +PDF Version: 1.4 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/foreign-in-write.out b/qpdf/qtest/qpdf/foreign-in-write.out new file mode 100644 index 0000000..14293aa --- /dev/null +++ b/qpdf/qtest/qpdf/foreign-in-write.out @@ -0,0 +1,2 @@ +logic error: QPDFObjectHandle from different QPDF found while writing. Use QPDF::copyForeignObject to add objects from another file. +test 29 done diff --git a/qpdf/qtest/qpdf/from-scratch-0.pdf b/qpdf/qtest/qpdf/from-scratch-0.pdf new file mode 100644 index 0000000..5750ec0 --- /dev/null +++ b/qpdf/qtest/qpdf/from-scratch-0.pdf @@ -0,0 +1,36 @@ +%PDF-1.3 +%¿÷¢þ +1 0 obj +<< /Pages 2 0 R /Type /Catalog >> +endobj +2 0 obj +<< /Count 1 /Kids [ 3 0 R ] /Type /Pages >> +endobj +3 0 obj +<< /Contents 4 0 R /MediaBox [ 0 0 612 792 ] /Parent 2 0 R /Resources << /Font << /F1 5 0 R >> /ProcSet 6 0 R >> /Type /Page >> +endobj +4 0 obj +<< /Length 42 >> +stream +BT /F1 15 Tf 72 720 Td (First Page) Tj ET +endstream +endobj +5 0 obj +<< /BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font >> +endobj +6 0 obj +[ /PDF /Text ] +endobj +xref +0 7 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000123 00000 n +0000000266 00000 n +0000000357 00000 n +0000000464 00000 n +trailer << /Root 1 0 R /Size 7 /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] >> +startxref +494 +%%EOF diff --git a/qpdf/qtest/qpdf/good1.out b/qpdf/qtest/qpdf/good1.out new file mode 100644 index 0000000..1d31025 --- /dev/null +++ b/qpdf/qtest/qpdf/good1.out @@ -0,0 +1,6 @@ +/QTest is implicit +/QTest is direct +/QTest is null +unparse: null +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/good1.pdf b/qpdf/qtest/qpdf/good1.pdf new file mode 100644 index 0000000..55b7a76 Binary files /dev/null and b/qpdf/qtest/qpdf/good1.pdf differ diff --git a/qpdf/qtest/qpdf/good1.qdf b/qpdf/qtest/qpdf/good1.qdf new file mode 100644 index 0000000..7b33f19 --- /dev/null +++ b/qpdf/qtest/qpdf/good1.qdf @@ -0,0 +1,101 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +%% Original object ID: 2 0 +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +%% Original object ID: 3 0 +3 0 obj +<< + /Contents 4 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 6 0 R + >> + /ProcSet 7 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +%% Original object ID: 4 0 +4 0 obj +<< + /Length 5 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +44 +endobj + +%% Original object ID: 6 0 +6 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 5 0 +7 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 8 +0000000000 65535 f +0000000052 00000 n +0000000133 00000 n +0000000242 00000 n +0000000484 00000 n +0000000583 00000 n +0000000629 00000 n +0000000774 00000 n +trailer << + /Root 1 0 R + /Size 8 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +startxref +809 +%%EOF diff --git a/qpdf/qtest/qpdf/good10.out b/qpdf/qtest/qpdf/good10.out new file mode 100644 index 0000000..3c0bed9 --- /dev/null +++ b/qpdf/qtest/qpdf/good10.out @@ -0,0 +1,8 @@ +/QTest is direct +/QTest is an array with 3 items + item 0 is direct + item 1 is direct + item 2 is indirect +unparse: [ 1 (2) 8 0 R ] +unparseResolved: [ 1 (2) 8 0 R ] +test 1 done diff --git a/qpdf/qtest/qpdf/good10.pdf b/qpdf/qtest/qpdf/good10.pdf new file mode 100644 index 0000000..13a8810 --- /dev/null +++ b/qpdf/qtest/qpdf/good10.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /QTest [1 (2) 8 0 R] +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/good10.qdf b/qpdf/qtest/qpdf/good10.qdf new file mode 100644 index 0000000..0835c51 --- /dev/null +++ b/qpdf/qtest/qpdf/good10.qdf @@ -0,0 +1,106 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +%% Original object ID: 2 0 +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +%% Original object ID: 3 0 +3 0 obj +<< + /Contents 4 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 6 0 R + >> + /ProcSet 7 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +%% Original object ID: 4 0 +4 0 obj +<< + /Length 5 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +44 +endobj + +%% Original object ID: 6 0 +6 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 5 0 +7 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 8 +0000000000 65535 f +0000000052 00000 n +0000000133 00000 n +0000000242 00000 n +0000000484 00000 n +0000000583 00000 n +0000000629 00000 n +0000000774 00000 n +trailer << + /QTest [ + 1 + (2) + null + ] + /Root 1 0 R + /Size 8 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +startxref +809 +%%EOF diff --git a/qpdf/qtest/qpdf/good11.out b/qpdf/qtest/qpdf/good11.out new file mode 100644 index 0000000..676a034 --- /dev/null +++ b/qpdf/qtest/qpdf/good11.out @@ -0,0 +1,6 @@ +/QTest is direct +/QTest is a dictionary + /a is direct +unparse: << /a (a) /b 8 0 R >> +unparseResolved: << /a (a) /b 8 0 R >> +test 1 done diff --git a/qpdf/qtest/qpdf/good11.pdf b/qpdf/qtest/qpdf/good11.pdf new file mode 100644 index 0000000..4e18be7 --- /dev/null +++ b/qpdf/qtest/qpdf/good11.pdf @@ -0,0 +1,81 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /QTest << /a(a) + /b 8 0 R >> +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/good11.qdf b/qpdf/qtest/qpdf/good11.qdf new file mode 100644 index 0000000..e92d6da --- /dev/null +++ b/qpdf/qtest/qpdf/good11.qdf @@ -0,0 +1,104 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +%% Original object ID: 2 0 +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +%% Original object ID: 3 0 +3 0 obj +<< + /Contents 4 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 6 0 R + >> + /ProcSet 7 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +%% Original object ID: 4 0 +4 0 obj +<< + /Length 5 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +44 +endobj + +%% Original object ID: 6 0 +6 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 5 0 +7 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 8 +0000000000 65535 f +0000000052 00000 n +0000000133 00000 n +0000000242 00000 n +0000000484 00000 n +0000000583 00000 n +0000000629 00000 n +0000000774 00000 n +trailer << + /QTest << + /a (a) + >> + /Root 1 0 R + /Size 8 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +startxref +809 +%%EOF diff --git a/qpdf/qtest/qpdf/good12.out b/qpdf/qtest/qpdf/good12.out new file mode 100644 index 0000000..b75d27b --- /dev/null +++ b/qpdf/qtest/qpdf/good12.out @@ -0,0 +1,13 @@ +/QTest is indirect +/QTest is a stream. Dictionary: << /Filter /FlateDecode /Length 123 >> +Raw stream data: +xœ%11 û¼b;tà4| wXIDì Øå÷8G·«Í>rQ¨uŠ OÒ êEŒ:©IWìÃPlíµII)Ãr´p4~;§ÎAs/òÒ…jcúú¾÷Žs§åözû»žT.?®uŽæ§<Ž¼…Ð*6ä +Uncompressed stream data: +This stream is not very interesting, but it is long enough that +compressing shrinks it somewhat. Or maybe not. But it doesn't really +matter that much. + +End of stream data +unparse: 7 0 R +unparseResolved: 7 0 R +test 1 done diff --git a/qpdf/qtest/qpdf/good12.pdf b/qpdf/qtest/qpdf/good12.pdf new file mode 100644 index 0000000..8d91aef --- /dev/null +++ b/qpdf/qtest/qpdf/good12.pdf @@ -0,0 +1,93 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +7 0 obj +<< + % Comment + /Length + 123 + /Filter /FlateDecode +>> +stream +xœ%11 û¼b;tà4| wXIDì Øå÷8G·«Í>rQ¨uŠ OÒ êEŒ:©IWìÃPlíµII)Ãr´p4~;§ÎAs/òÒ…jcúú¾÷Žs§åözû»žT.?®uŽæ§<Ž¼…Ð*6ä +endstream +endobj + +xref +0 8 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +0000000556 00000 n +trailer << + /Size 8 + /Root 1 0 R + /QTest 7 0 R +>> +startxref +770 +%%EOF diff --git a/qpdf/qtest/qpdf/good12.qdf b/qpdf/qtest/qpdf/good12.qdf new file mode 100644 index 0000000..542d79b --- /dev/null +++ b/qpdf/qtest/qpdf/good12.qdf @@ -0,0 +1,120 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /Pages 4 0 R + /Type /Catalog +>> +endobj + +%% Original object ID: 7 0 +2 0 obj +<< + /Length 3 0 R +>> +stream +This stream is not very interesting, but it is long enough that +compressing shrinks it somewhat. Or maybe not. But it doesn't really +matter that much. +endstream +endobj + +3 0 obj +153 +endobj + +%% Original object ID: 2 0 +4 0 obj +<< + /Count 1 + /Kids [ + 5 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +%% Original object ID: 3 0 +5 0 obj +<< + /Contents 6 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 8 0 R + >> + /ProcSet 9 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +%% Original object ID: 4 0 +6 0 obj +<< + /Length 7 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +7 0 obj +44 +endobj + +%% Original object ID: 6 0 +8 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 5 0 +9 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 10 +0000000000 65535 f +0000000052 00000 n +0000000133 00000 n +0000000341 00000 n +0000000388 00000 n +0000000497 00000 n +0000000739 00000 n +0000000838 00000 n +0000000884 00000 n +0000001029 00000 n +trailer << + /QTest 2 0 R + /Root 1 0 R + /Size 10 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +startxref +1064 +%%EOF diff --git a/qpdf/qtest/qpdf/good13.out b/qpdf/qtest/qpdf/good13.out new file mode 100644 index 0000000..a50358c --- /dev/null +++ b/qpdf/qtest/qpdf/good13.out @@ -0,0 +1,9 @@ +/QTest is indirect +/QTest is a dictionary + /hex strings is direct + /indirect is indirect + /nesting is direct + /strings is direct +unparse: 7 0 R +unparseResolved: << /hex#20strings [ (Potato) <01020300040560> (AB) ] /indirect 8 0 R /nesting << /a [ 1 2 << /x (y) >> [ (z) ] ] /b << / (legal) /a [ 1 2 ] >> >> /strings [ (one) <24a2> () (\(\)) (\() (\)) (a\f\b\t\r\nb) <410042> (a\nb) (a b) ] >> +test 1 done diff --git a/qpdf/qtest/qpdf/good13.pdf b/qpdf/qtest/qpdf/good13.pdf new file mode 100644 index 0000000..516774c --- /dev/null +++ b/qpdf/qtest/qpdf/good13.pdf @@ -0,0 +1,101 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +7 0 obj +<< + /strings [(one) ($\242) () (()) (\() (\)) (a\f\b\t\r\nb) (A\000B) (a +b) (a \ +b)] + /hex#20strings [<506F7461746f> <010 203 0004056> <41 +42>] + /indirect 8 0 R + /n#65sting << + /a [1 2 << /x (y) >> [(z)]] + /b <> + >> +>> +endobj + +8 0 obj +(hello) +endobj + +xref +0 9 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +0000000556 00000 n +0000000822 00000 n +trailer << + /Size 9 + /Root 1 0 R + /QTest 7 0 R +>> +startxref +846 +%%EOF diff --git a/qpdf/qtest/qpdf/good13.qdf b/qpdf/qtest/qpdf/good13.qdf new file mode 100644 index 0000000..f8993a8 --- /dev/null +++ b/qpdf/qtest/qpdf/good13.qdf @@ -0,0 +1,146 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /Pages 3 0 R + /Type /Catalog +>> +endobj + +%% Original object ID: 7 0 +2 0 obj +<< + /hex#20strings [ + (Potato) + <01020300040560> + (AB) + ] + /indirect (hello) + /nesting << + /a [ + 1 + 2 + << + /x (y) + >> + [ + (z) + ] + ] + /b << + / (legal) + /a [ + 1 + 2 + ] + >> + >> + /strings [ + (one) + <24a2> + () + (\(\)) + (\() + (\)) + (a\f\b\t\r\nb) + <410042> + (a\nb) + (a b) + ] +>> +endobj + +%% Original object ID: 2 0 +3 0 obj +<< + /Count 1 + /Kids [ + 4 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +%% Original object ID: 3 0 +4 0 obj +<< + /Contents 5 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 7 0 R + >> + /ProcSet 8 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +%% Original object ID: 4 0 +5 0 obj +<< + /Length 6 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +6 0 obj +44 +endobj + +%% Original object ID: 6 0 +7 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 5 0 +8 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 9 +0000000000 65535 f +0000000052 00000 n +0000000133 00000 n +0000000578 00000 n +0000000687 00000 n +0000000929 00000 n +0000001028 00000 n +0000001074 00000 n +0000001219 00000 n +trailer << + /QTest 2 0 R + /Root 1 0 R + /Size 9 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +startxref +1254 +%%EOF diff --git a/qpdf/qtest/qpdf/good14.out b/qpdf/qtest/qpdf/good14.out new file mode 100644 index 0000000..d0b2b78 --- /dev/null +++ b/qpdf/qtest/qpdf/good14.out @@ -0,0 +1,39 @@ +-- stream 0 -- +A %here is a comment +B % here is another with CR +A B + +one +two +three lines +(string with \r\nCRNL) + and another + indentation +(\001B%DEF)<01> +<8a8b> +(ab) +<8c>
) > +<610062> (MOO) +-- stream 1 -- +This stream does end with a newline. +// tests: +// bad tokens preserved +// comments +// indentation +// CR/NL inside string literal -- changed to \r or \n, newline follows +// whitespace in hexstring (removed) +// strings normalized +// newlines normalized +// names normalized +// trailing space (preserved) +// final newline added + +/bad#name + +/good name +/bad#00name +-- stream 2 -- +(This stream ends with a \001 bad token +-- stream 3 -- +> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +7 0 obj +<< /Length 9 0 R >> +stream +A %here is a comment +B % here is another with CR +A B +one two three lines +(string with +CRNL) and another + indentation +(B%DEF)() +<8A +8B><61 62><8c>
) > +(a\000b) <4D4F4F>endstream endobj + +8 0 obj +<< /Length 385 >> +stream +This stream does end with a newline. +// tests: +// bad tokens preserved +// comments +// indentation +// CR/NL inside string literal -- changed to \r or \n, newline follows +// whitespace in hexstring (removed) +// strings normalized +// newlines normalized +// names normalized +// trailing space (preserved) +// final newline added + +/bad#name + +/g#6f#6Fd name +/bad#00name +endstream +endobj + +9 0 obj +181 +endobj + +10 0 obj +<< /Length 40 >> +stream +(This stream ends with a \001 bad token +endstream +endobj + +11 0 obj +<< /Length 5 >> +stream +> +startxref +1430 +%%EOF diff --git a/qpdf/qtest/qpdf/good14.qdf b/qpdf/qtest/qpdf/good14.qdf new file mode 100644 index 0000000..4ae4253 --- /dev/null +++ b/qpdf/qtest/qpdf/good14.qdf @@ -0,0 +1,199 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /Pages 10 0 R + /Type /Catalog +>> +endobj + +%% Original object ID: 7 0 +2 0 obj +<< + /Length 3 0 R +>> +stream +A %here is a comment +B % here is another with CR +A B +one two three lines +(string with +CRNL) and another + indentation +(B%DEF)() +<8A +8B><61 62><8c>
) > +(a\000b) <4D4F4F> +endstream +endobj + +%QDF: ignore_newline +3 0 obj +181 +endobj + +%% Original object ID: 8 0 +4 0 obj +<< + /Length 5 0 R +>> +stream +This stream does end with a newline. +// tests: +// bad tokens preserved +// comments +// indentation +// CR/NL inside string literal -- changed to \r or \n, newline follows +// whitespace in hexstring (removed) +// strings normalized +// newlines normalized +// names normalized +// trailing space (preserved) +// final newline added + +/bad#name + +/g#6f#6Fd name +/bad#00name +endstream +endobj + +5 0 obj +385 +endobj + +%% Original object ID: 10 0 +6 0 obj +<< + /Length 7 0 R +>> +stream +(This stream ends with a \001 bad token +endstream +endobj + +7 0 obj +40 +endobj + +%% Original object ID: 11 0 +8 0 obj +<< + /Length 9 0 R +>> +stream +> +endobj + +%% Page 1 +%% Original object ID: 3 0 +11 0 obj +<< + /Contents 12 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 10 0 R + /Resources << + /Font << + /F1 14 0 R + >> + /ProcSet 15 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +%% Original object ID: 4 0 +12 0 obj +<< + /Length 13 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +13 0 obj +44 +endobj + +%% Original object ID: 6 0 +14 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 5 0 +15 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 16 +0000000000 65535 f +0000000052 00000 n +0000000134 00000 n +0000000392 00000 n +0000000439 00000 n +0000000879 00000 n +0000000927 00000 n +0000001022 00000 n +0000001069 00000 n +0000001151 00000 n +0000001196 00000 n +0000001307 00000 n +0000001554 00000 n +0000001655 00000 n +0000001702 00000 n +0000001848 00000 n +trailer << + /QStreams [ + 2 0 R + 4 0 R + 6 0 R + 8 0 R + ] + /Root 1 0 R + /Size 16 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +startxref +1884 +%%EOF diff --git a/qpdf/qtest/qpdf/good15.out b/qpdf/qtest/qpdf/good15.out new file mode 100644 index 0000000..884ea6e --- /dev/null +++ b/qpdf/qtest/qpdf/good15.out @@ -0,0 +1,5 @@ +/QTest is direct +/QTest is a name with value /oink +unparse: /oink +unparseResolved: /oink +test 1 done diff --git a/qpdf/qtest/qpdf/good15.pdf b/qpdf/qtest/qpdf/good15.pdf new file mode 100644 index 0000000..5981765 --- /dev/null +++ b/qpdf/qtest/qpdf/good15.pdf @@ -0,0 +1,79 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream + +BT +/F1 24 Tf 72 720 Td + (Potato) Tj ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /QTest /oink +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/good15.qdf b/qpdf/qtest/qpdf/good15.qdf new file mode 100644 index 0000000..d57850c --- /dev/null +++ b/qpdf/qtest/qpdf/good15.qdf @@ -0,0 +1,103 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +%% Original object ID: 2 0 +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +%% Original object ID: 3 0 +3 0 obj +<< + /Contents 4 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 6 0 R + >> + /ProcSet 7 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +%% Original object ID: 4 0 +4 0 obj +<< + /Length 5 0 R +>> +stream + +BT +/F1 24 Tf +72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +43 +endobj + +%% Original object ID: 6 0 +6 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 5 0 +7 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 8 +0000000000 65535 f +0000000052 00000 n +0000000133 00000 n +0000000242 00000 n +0000000484 00000 n +0000000582 00000 n +0000000628 00000 n +0000000773 00000 n +trailer << + /QTest /oink + /Root 1 0 R + /Size 8 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +startxref +808 +%%EOF diff --git a/qpdf/qtest/qpdf/good16.out b/qpdf/qtest/qpdf/good16.out new file mode 100644 index 0000000..1d31025 --- /dev/null +++ b/qpdf/qtest/qpdf/good16.out @@ -0,0 +1,6 @@ +/QTest is implicit +/QTest is direct +/QTest is null +unparse: null +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/good16.pdf b/qpdf/qtest/qpdf/good16.pdf new file mode 100644 index 0000000..1a46820 Binary files /dev/null and b/qpdf/qtest/qpdf/good16.pdf differ diff --git a/qpdf/qtest/qpdf/good16.qdf b/qpdf/qtest/qpdf/good16.qdf new file mode 100644 index 0000000..d6b78a0 Binary files /dev/null and b/qpdf/qtest/qpdf/good16.qdf differ diff --git a/qpdf/qtest/qpdf/good17-not-qdf.pdf b/qpdf/qtest/qpdf/good17-not-qdf.pdf new file mode 100644 index 0000000..53eadd7 Binary files /dev/null and b/qpdf/qtest/qpdf/good17-not-qdf.pdf differ diff --git a/qpdf/qtest/qpdf/good17-not-recompressed.pdf b/qpdf/qtest/qpdf/good17-not-recompressed.pdf new file mode 100644 index 0000000..b6e3a53 Binary files /dev/null and b/qpdf/qtest/qpdf/good17-not-recompressed.pdf differ diff --git a/qpdf/qtest/qpdf/good17.out b/qpdf/qtest/qpdf/good17.out new file mode 100644 index 0000000..1d31025 --- /dev/null +++ b/qpdf/qtest/qpdf/good17.out @@ -0,0 +1,6 @@ +/QTest is implicit +/QTest is direct +/QTest is null +unparse: null +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/good17.pdf b/qpdf/qtest/qpdf/good17.pdf new file mode 100644 index 0000000..f0c66b3 --- /dev/null +++ b/qpdf/qtest/qpdf/good17.pdf @@ -0,0 +1,1550 @@ +%PDF-1.5 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /PageLabels 107 0 R + /Pages 2 0 R + /Type /Catalog + /PageMode /UseOutlines + /Outlines 95 0 R +>> +endobj + +2 0 obj +<< + /Count 30 + /Kids [ + 3 0 R + 4 0 R + 5 0 R + 6 0 R + 7 0 R + 8 0 R + 9 0 R + 10 0 R + 11 0 R + 12 0 R + 13 0 R + 14 0 R + 15 0 R + 16 0 R + 17 0 R + 18 0 R + 19 0 R + 20 0 R + 21 0 R + 22 0 R + 23 0 R + 24 0 R + 25 0 R + 26 0 R + 27 0 R + 28 0 R + 29 0 R + 30 0 R + 31 0 R + 32 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +3 0 obj +<< + /Contents 33 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 2 +4 0 obj +<< + /Contents 37 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 3 +5 0 obj +<< + /Contents 39 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 4 +6 0 obj +<< + /Contents 41 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 5 +7 0 obj +<< + /Contents 43 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 6 +8 0 obj +<< + /Contents 45 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 7 +9 0 obj +<< + /Contents 47 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 8 +10 0 obj +<< + /Contents 49 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 9 +11 0 obj +<< + /Contents 51 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 10 +12 0 obj +<< + /Contents 53 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 11 +13 0 obj +<< + /Contents 55 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 12 +14 0 obj +<< + /Contents 57 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 13 +15 0 obj +<< + /Contents 59 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 14 +16 0 obj +<< + /Contents 61 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 15 +17 0 obj +<< + /Contents 63 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 16 +18 0 obj +<< + /Contents 65 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 17 +19 0 obj +<< + /Contents 67 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 18 +20 0 obj +<< + /Contents 69 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 19 +21 0 obj +<< + /Contents 71 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 20 +22 0 obj +<< + /Contents 73 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 21 +23 0 obj +<< + /Contents 75 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 22 +24 0 obj +<< + /Contents 77 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 23 +25 0 obj +<< + /Contents 79 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 24 +26 0 obj +<< + /Contents 81 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 25 +27 0 obj +<< + /Contents 83 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 26 +28 0 obj +<< + /Contents 85 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 27 +29 0 obj +<< + /Contents 87 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 28 +30 0 obj +<< + /Contents 89 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 29 +31 0 obj +<< + /Contents 91 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 30 +32 0 obj +<< + /Contents 93 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +33 0 obj +<< + /Length 34 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 0) Tj +ET +endstream +endobj + +34 0 obj +46 +endobj + +35 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +36 0 obj +[ + /PDF + /Text +] +endobj + +%% Contents for page 2 +37 0 obj +<< + /Length 38 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 1) Tj +ET +endstream +endobj + +38 0 obj +46 +endobj + +%% Contents for page 3 +39 0 obj +<< + /Length 40 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 2) Tj +ET +endstream +endobj + +40 0 obj +46 +endobj + +%% Contents for page 4 +41 0 obj +<< + /Length 42 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 3) Tj +ET +endstream +endobj + +42 0 obj +46 +endobj + +%% Contents for page 5 +43 0 obj +<< + /Length 44 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 4) Tj +ET +endstream +endobj + +44 0 obj +46 +endobj + +%% Contents for page 6 +45 0 obj +<< + /Length 46 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 5) Tj +ET +endstream +endobj + +46 0 obj +46 +endobj + +%% Contents for page 7 +47 0 obj +<< + /Length 48 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 6) Tj +ET +endstream +endobj + +48 0 obj +46 +endobj + +%% Contents for page 8 +49 0 obj +<< + /Length 50 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 7) Tj +ET +endstream +endobj + +50 0 obj +46 +endobj + +%% Contents for page 9 +51 0 obj +<< + /Length 52 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 8) Tj +ET +endstream +endobj + +52 0 obj +46 +endobj + +%% Contents for page 10 +53 0 obj +<< + /Length 54 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 9) Tj +ET +endstream +endobj + +54 0 obj +46 +endobj + +%% Contents for page 11 +55 0 obj +<< + /Length 56 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 10) Tj +ET +endstream +endobj + +56 0 obj +47 +endobj + +%% Contents for page 12 +57 0 obj +<< + /Length 58 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 11) Tj +ET +endstream +endobj + +58 0 obj +47 +endobj + +%% Contents for page 13 +59 0 obj +<< + /Length 60 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 12) Tj +ET +endstream +endobj + +60 0 obj +47 +endobj + +%% Contents for page 14 +61 0 obj +<< + /Length 62 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 13) Tj +ET +endstream +endobj + +62 0 obj +47 +endobj + +%% Contents for page 15 +63 0 obj +<< + /Length 64 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 14) Tj +ET +endstream +endobj + +64 0 obj +47 +endobj + +%% Contents for page 16 +65 0 obj +<< + /Length 66 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 15) Tj +ET +endstream +endobj + +66 0 obj +47 +endobj + +%% Contents for page 17 +67 0 obj +<< + /Length 68 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 16) Tj +ET +endstream +endobj + +68 0 obj +47 +endobj + +%% Contents for page 18 +69 0 obj +<< + /Length 70 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 17) Tj +ET +endstream +endobj + +70 0 obj +47 +endobj + +%% Contents for page 19 +71 0 obj +<< + /Length 72 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 18) Tj +ET +endstream +endobj + +72 0 obj +47 +endobj + +%% Contents for page 20 +73 0 obj +<< + /Length 74 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 19) Tj +ET +endstream +endobj + +74 0 obj +47 +endobj + +%% Contents for page 21 +75 0 obj +<< + /Length 76 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 20) Tj +ET +endstream +endobj + +76 0 obj +47 +endobj + +%% Contents for page 22 +77 0 obj +<< + /Length 78 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 21) Tj +ET +endstream +endobj + +78 0 obj +47 +endobj + +%% Contents for page 23 +79 0 obj +<< + /Length 80 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 22) Tj +ET +endstream +endobj + +80 0 obj +47 +endobj + +%% Contents for page 24 +81 0 obj +<< + /Length 82 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 23) Tj +ET +endstream +endobj + +82 0 obj +47 +endobj + +%% Contents for page 25 +83 0 obj +<< + /Length 84 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 24) Tj +ET +endstream +endobj + +84 0 obj +47 +endobj + +%% Contents for page 26 +85 0 obj +<< + /Length 86 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 25) Tj +ET +endstream +endobj + +86 0 obj +47 +endobj + +%% Contents for page 27 +87 0 obj +<< + /Length 88 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 26) Tj +ET +endstream +endobj + +88 0 obj +47 +endobj + +%% Contents for page 28 +89 0 obj +<< + /Length 90 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 27) Tj +ET +endstream +endobj + +90 0 obj +47 +endobj + +%% Contents for page 29 +91 0 obj +<< + /Length 92 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 28) Tj +ET +endstream +endobj + +92 0 obj +47 +endobj + +%% Contents for page 30 +93 0 obj +<< + /Length 94 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 29) Tj +ET +endstream +endobj + +94 0 obj +47 +endobj + +xref +0 111 +0000000095 65535 f +0000000025 00000 n +0000000145 00000 n +0000000541 00000 n +0000000746 00000 n +0000000951 00000 n +0000001156 00000 n +0000001361 00000 n +0000001566 00000 n +0000001771 00000 n +0000001976 00000 n +0000002182 00000 n +0000002389 00000 n +0000002596 00000 n +0000002803 00000 n +0000003010 00000 n +0000003217 00000 n +0000003424 00000 n +0000003631 00000 n +0000003838 00000 n +0000004045 00000 n +0000004252 00000 n +0000004459 00000 n +0000004666 00000 n +0000004873 00000 n +0000005080 00000 n +0000005287 00000 n +0000005494 00000 n +0000005701 00000 n +0000005908 00000 n +0000006115 00000 n +0000006322 00000 n +0000006529 00000 n +0000006748 00000 n +0000006851 00000 n +0000006871 00000 n +0000006990 00000 n +0000007049 00000 n +0000007152 00000 n +0000007195 00000 n +0000007298 00000 n +0000007341 00000 n +0000007444 00000 n +0000007487 00000 n +0000007590 00000 n +0000007633 00000 n +0000007736 00000 n +0000007779 00000 n +0000007882 00000 n +0000007925 00000 n +0000008028 00000 n +0000008071 00000 n +0000008174 00000 n +0000008218 00000 n +0000008321 00000 n +0000008365 00000 n +0000008469 00000 n +0000008513 00000 n +0000008617 00000 n +0000008661 00000 n +0000008765 00000 n +0000008809 00000 n +0000008913 00000 n +0000008957 00000 n +0000009061 00000 n +0000009105 00000 n +0000009209 00000 n +0000009253 00000 n +0000009357 00000 n +0000009401 00000 n +0000009505 00000 n +0000009549 00000 n +0000009653 00000 n +0000009697 00000 n +0000009801 00000 n +0000009845 00000 n +0000009949 00000 n +0000009993 00000 n +0000010097 00000 n +0000010141 00000 n +0000010245 00000 n +0000010289 00000 n +0000010393 00000 n +0000010437 00000 n +0000010541 00000 n +0000010585 00000 n +0000010689 00000 n +0000010733 00000 n +0000010837 00000 n +0000010881 00000 n +0000010985 00000 n +0000011029 00000 n +0000011133 00000 n +0000011177 00000 n +0000011281 00000 n +0000000096 65535 f +0000000097 65535 f +0000000098 65535 f +0000000099 65535 f +0000000100 65535 f +0000000101 65535 f +0000000102 65535 f +0000000103 65535 f +0000000104 65535 f +0000000105 65535 f +0000000106 65535 f +0000000107 65535 f +0000000108 65535 f +0000000109 65535 f +0000000110 65535 f +0000000000 65535 f +trailer << + /Root 1 0 R + /Size 111 +>> +startxref +11301 +%%EOF + +108 0 obj +<< + /Type /ObjStm + /N 10 + /First 81 + /Length 1806 +>> +stream +95 0 +96 75 +97 260 +98 394 +99 557 +100 899 +101 1078 +102 1276 +103 1433 +104 1590 +% 95 +<< + /Type /Outlines + /First 96 0 R + /Last 97 0 R + /Count 6 +>> +% 96 +<< + /Type /Outline + /Title (Isís 1 -> 5: /XYZ null null null) + /Parent 95 0 R + /Count 4 + /Next 97 0 R + /First 98 0 R + /Last 99 0 R + /Dest [ 8 0 R /XYZ null null null ] +>> +% 97 +<< + /Type /Outline + /Title (Trepak 2 -> 15: /XYZ 66 756 3) + /Parent 95 0 R + /Prev 96 0 R + /Dest [ 18 0 R /XYZ 66 756 3 ] +>> +% 98 +<< + /Type /Outline + /Title (Amanda 1.1 -> 11: /Fit) + /Parent 96 0 R + /Next 99 0 R + /First 100 0 R + /Last 101 0 R + /Count -3 + /Dest [ 14 0 R /Fit ] +>> +% 99 +<< + /Type /Outline + % /Title (Sandy (Sandy [Greek]) 1.2 -> 13: /FitH 792) + /Title + /Parent 96 0 R + /Prev 98 0 R + /First 105 0 R + /Last 106 0 R + /Count 2 + /Dest [ 16 0 R /FitH 792 ] +>> +% 100 +<< + /Type /Outline + /Title (Isosicle 1.1.1 -> 12: /FitV 100) + /Parent 98 0 R + /Next 101 0 R + /First 102 0 R + /Last 103 0 R + /Count -2 + /Dest [ 15 0 R /FitV 100 ] +>> +% 101 +<< + /Type /Outline + /Title (Isosicle 1.1.2 -> 12: /XYZ null null null) + /Parent 98 0 R + /Prev 100 0 R + /First 104 0 R + /Last 104 0 R + /Count 1 + /Dest [ 15 0 R /XYZ null null null ] +>> +% 102 +<< + /Type /Outline + /Title (Isosicle 1.1.1.1 -> 18: /XYZ null null null) + /Parent 100 0 R + /Next 103 0 R + /Dest [ 21 0 R /XYZ null null null ] +>> +% 103 +<< + /Type /Outline + /Title (Isosicle 1.1.1.2 -> 19: /XYZ null null null) + /Parent 100 0 R + /Prev 102 0 R + /Dest [ 22 0 R /XYZ null null null ] +>> +% 104 +<< + /Type /Outline + /Title (Isosicle 1.1.2.1 -> 22: /XYZ null null null) + /Parent 101 0 R + /Dest [ 25 0 R /XYZ null null null ] +>> +endstream +endobj + +110 0 obj +<< + /Type /ObjStm + /N 3 + /First 28 + /Length 636 + /Extends 108 0 R +>> +stream +105 0 +106 157 +107 310 +% 105 +<< + /Type /Outline + /Title (Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770) + /Parent 99 0 R + /Next 106 0 R + /Dest [ 4 0 R /FitR 66 714 180 770 ] +>> +% 106 +<< + /Type /Outline + /Title (Trepsicle 1.2.2 -> 0: /XYZ null null null) + /Parent 99 0 R + /Prev 105 0 R + /Dest [ 3 0 R /XYZ null null null ] +>> +% 107 + << /Nums [ + 0 << /P () >> + 2 << /S /r /St 1 >> + 7 << /P () >> + 9 << /S /r /St 6 >> + 11 << /P () >> + 12 << /S /D /St 2 >> + 15 << /S /D /St 6 >> + 19 << /P () >> + 20 << /S /D /St 12 >> + 22 << /S /D /St 16059 >> + 23 << /S /r /St 50 >> + 29 << /S /r /St 54 >> + ] >> +endstream +endobj + +109 0 obj +<< + /Type /XRef + /Size 111 + /Index [0 111] + /W [1 2 1] + /Length 444 + /Root 1 0 R +>> +stream +‘ê·„Q븆 U +$ +ó  ‘ `/þÍœk: اvEã²\Ã×N‰ð‚­?¦Ñ8cÊõ\‡î   ­!!A!©!Õ"="i"Ñ"ý#e#‘#ù$%$$¹%!%M%µ%á&I&u&Ý' 'q'((1(™(Å)-)Y)Á)í*U**é++}+©,llllllllll nnn5?n<… +endstream +endobj + +xref +0 0 +trailer << + /Size 111 + /Root 1 0 R + /Prev 11301 + /XRefStm 16238 +>> + +startxref +16808 +%%EOF diff --git a/qpdf/qtest/qpdf/good17.qdf b/qpdf/qtest/qpdf/good17.qdf new file mode 100644 index 0000000..747f329 --- /dev/null +++ b/qpdf/qtest/qpdf/good17.qdf @@ -0,0 +1,1588 @@ +%PDF-1.5 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /Outlines 3 0 R + /PageLabels 16 0 R + /PageMode /UseOutlines + /Pages 17 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /Type /ObjStm + /Length 2424 + /N 10 + /First 126 +>> +stream +3 0 +4 124 +5 383 +6 592 +7 814 +8 1165 +9 1408 +10 1679 +11 1911 +12 2143 +%% Object stream: object 3, index 0; original object ID: 95 +<< + /Count 6 + /First 4 0 R + /Last 5 0 R + /Type /Outlines +>> +%% Object stream: object 4, index 1; original object ID: 96 +<< + /Count 4 + /Dest [ + 18 0 R + /XYZ + null + null + null + ] + /First 6 0 R + /Last 7 0 R + /Next 5 0 R + /Parent 3 0 R + /Title (Isís 1 -> 5: /XYZ null null null) + /Type /Outline +>> +%% Object stream: object 5, index 2; original object ID: 97 +<< + /Dest [ + 19 0 R + /XYZ + 66 + 756 + 3 + ] + /Parent 3 0 R + /Prev 4 0 R + /Title (Trepak 2 -> 15: /XYZ 66 756 3) + /Type /Outline +>> +%% Object stream: object 6, index 3; original object ID: 98 +<< + /Count -3 + /Dest [ + 20 0 R + /Fit + ] + /First 8 0 R + /Last 9 0 R + /Next 7 0 R + /Parent 4 0 R + /Title (Amanda 1.1 -> 11: /Fit) + /Type /Outline +>> +%% Object stream: object 7, index 4; original object ID: 99 +<< + /Count 2 + /Dest [ + 21 0 R + /FitH + 792 + ] + /First 14 0 R + /Last 15 0 R + /Parent 4 0 R + /Prev 6 0 R + /Title + /Type /Outline +>> +%% Object stream: object 8, index 5; original object ID: 100 +<< + /Count -2 + /Dest [ + 22 0 R + /FitV + 100 + ] + /First 10 0 R + /Last 11 0 R + /Next 9 0 R + /Parent 6 0 R + /Title (Isosicle 1.1.1 -> 12: /FitV 100) + /Type /Outline +>> +%% Object stream: object 9, index 6; original object ID: 101 +<< + /Count 1 + /Dest [ + 22 0 R + /XYZ + null + null + null + ] + /First 12 0 R + /Last 12 0 R + /Parent 6 0 R + /Prev 8 0 R + /Title (Isosicle 1.1.2 -> 12: /XYZ null null null) + /Type /Outline +>> +%% Object stream: object 10, index 7; original object ID: 102 +<< + /Dest [ + 23 0 R + /XYZ + null + null + null + ] + /Next 11 0 R + /Parent 8 0 R + /Title (Isosicle 1.1.1.1 -> 18: /XYZ null null null) + /Type /Outline +>> +%% Object stream: object 11, index 8; original object ID: 103 +<< + /Dest [ + 24 0 R + /XYZ + null + null + null + ] + /Parent 8 0 R + /Prev 10 0 R + /Title (Isosicle 1.1.1.2 -> 19: /XYZ null null null) + /Type /Outline +>> +%% Object stream: object 12, index 9; original object ID: 104 +<< + /Dest [ + 25 0 R + /XYZ + null + null + null + ] + /Parent 9 0 R + /Title (Isosicle 1.1.2.1 -> 22: /XYZ null null null) + /Type /Outline +>> +endstream +endobj + +13 0 obj +<< + /Type /ObjStm + /Length 1064 + /N 3 + /First 81 + /Extends 2 0 R +>> +stream +14 0 +15 238 +16 468 +%% Object stream: object 14, index 0; original object ID: 105 +<< + /Dest [ + 26 0 R + /FitR + 66 + 714 + 180 + 770 + ] + /Next 15 0 R + /Parent 7 0 R + /Title (Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770) + /Type /Outline +>> +%% Object stream: object 15, index 1; original object ID: 106 +<< + /Dest [ + 27 0 R + /XYZ + null + null + null + ] + /Parent 7 0 R + /Prev 14 0 R + /Title (Trepsicle 1.2.2 -> 0: /XYZ null null null) + /Type /Outline +>> +%% Object stream: object 16, index 2; original object ID: 107 +<< + /Nums [ + 0 + << + /P () + >> + 2 + << + /S /r + /St 1 + >> + 7 + << + /P () + >> + 9 + << + /S /r + /St 6 + >> + 11 + << + /P () + >> + 12 + << + /S /D + /St 2 + >> + 15 + << + /S /D + /St 6 + >> + 19 + << + /P () + >> + 20 + << + /S /D + /St 12 + >> + 22 + << + /S /D + /St 16059 + >> + 23 + << + /S /r + /St 50 + >> + 29 + << + /S /r + /St 54 + >> + ] +>> +endstream +endobj + +%% Original object ID: 2 0 +17 0 obj +<< + /Count 30 + /Kids [ + 27 0 R + 26 0 R + 28 0 R + 29 0 R + 30 0 R + 18 0 R + 31 0 R + 32 0 R + 33 0 R + 34 0 R + 35 0 R + 20 0 R + 22 0 R + 21 0 R + 36 0 R + 19 0 R + 37 0 R + 38 0 R + 23 0 R + 24 0 R + 39 0 R + 40 0 R + 25 0 R + 41 0 R + 42 0 R + 43 0 R + 44 0 R + 45 0 R + 46 0 R + 47 0 R + ] + /Type /Pages +>> +endobj + +%% Page 6 +%% Original object ID: 8 0 +18 0 obj +<< + /Contents 48 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 16 +%% Original object ID: 18 0 +19 0 obj +<< + /Contents 52 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 12 +%% Original object ID: 14 0 +20 0 obj +<< + /Contents 54 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 14 +%% Original object ID: 16 0 +21 0 obj +<< + /Contents 56 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 13 +%% Original object ID: 15 0 +22 0 obj +<< + /Contents 58 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 19 +%% Original object ID: 21 0 +23 0 obj +<< + /Contents 60 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 20 +%% Original object ID: 22 0 +24 0 obj +<< + /Contents 62 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 23 +%% Original object ID: 25 0 +25 0 obj +<< + /Contents 64 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 2 +%% Original object ID: 4 0 +26 0 obj +<< + /Contents 66 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 1 +%% Original object ID: 3 0 +27 0 obj +<< + /Contents 68 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 3 +%% Original object ID: 5 0 +28 0 obj +<< + /Contents 70 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 4 +%% Original object ID: 6 0 +29 0 obj +<< + /Contents 72 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 5 +%% Original object ID: 7 0 +30 0 obj +<< + /Contents 74 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 7 +%% Original object ID: 9 0 +31 0 obj +<< + /Contents 76 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 8 +%% Original object ID: 10 0 +32 0 obj +<< + /Contents 78 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 9 +%% Original object ID: 11 0 +33 0 obj +<< + /Contents 80 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 10 +%% Original object ID: 12 0 +34 0 obj +<< + /Contents 82 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 11 +%% Original object ID: 13 0 +35 0 obj +<< + /Contents 84 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 15 +%% Original object ID: 17 0 +36 0 obj +<< + /Contents 86 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 17 +%% Original object ID: 19 0 +37 0 obj +<< + /Contents 88 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 18 +%% Original object ID: 20 0 +38 0 obj +<< + /Contents 90 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 21 +%% Original object ID: 23 0 +39 0 obj +<< + /Contents 92 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 22 +%% Original object ID: 24 0 +40 0 obj +<< + /Contents 94 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 24 +%% Original object ID: 26 0 +41 0 obj +<< + /Contents 96 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 25 +%% Original object ID: 27 0 +42 0 obj +<< + /Contents 98 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 26 +%% Original object ID: 28 0 +43 0 obj +<< + /Contents 100 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 27 +%% Original object ID: 29 0 +44 0 obj +<< + /Contents 102 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 28 +%% Original object ID: 30 0 +45 0 obj +<< + /Contents 104 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 29 +%% Original object ID: 31 0 +46 0 obj +<< + /Contents 106 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Page 30 +%% Original object ID: 32 0 +47 0 obj +<< + /Contents 108 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 17 0 R + /Resources << + /Font << + /F1 50 0 R + >> + /ProcSet 51 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 6 +%% Original object ID: 45 0 +48 0 obj +<< + /Length 49 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 5) Tj +ET +endstream +endobj + +49 0 obj +46 +endobj + +%% Original object ID: 35 0 +50 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 36 0 +51 0 obj +[ + /PDF + /Text +] +endobj + +%% Contents for page 16 +%% Original object ID: 65 0 +52 0 obj +<< + /Length 53 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 15) Tj +ET +endstream +endobj + +53 0 obj +47 +endobj + +%% Contents for page 12 +%% Original object ID: 57 0 +54 0 obj +<< + /Length 55 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 11) Tj +ET +endstream +endobj + +55 0 obj +47 +endobj + +%% Contents for page 14 +%% Original object ID: 61 0 +56 0 obj +<< + /Length 57 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 13) Tj +ET +endstream +endobj + +57 0 obj +47 +endobj + +%% Contents for page 13 +%% Original object ID: 59 0 +58 0 obj +<< + /Length 59 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 12) Tj +ET +endstream +endobj + +59 0 obj +47 +endobj + +%% Contents for page 19 +%% Original object ID: 71 0 +60 0 obj +<< + /Length 61 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 18) Tj +ET +endstream +endobj + +61 0 obj +47 +endobj + +%% Contents for page 20 +%% Original object ID: 73 0 +62 0 obj +<< + /Length 63 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 19) Tj +ET +endstream +endobj + +63 0 obj +47 +endobj + +%% Contents for page 23 +%% Original object ID: 79 0 +64 0 obj +<< + /Length 65 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 22) Tj +ET +endstream +endobj + +65 0 obj +47 +endobj + +%% Contents for page 2 +%% Original object ID: 37 0 +66 0 obj +<< + /Length 67 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 1) Tj +ET +endstream +endobj + +67 0 obj +46 +endobj + +%% Contents for page 1 +%% Original object ID: 33 0 +68 0 obj +<< + /Length 69 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 0) Tj +ET +endstream +endobj + +69 0 obj +46 +endobj + +%% Contents for page 3 +%% Original object ID: 39 0 +70 0 obj +<< + /Length 71 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 2) Tj +ET +endstream +endobj + +71 0 obj +46 +endobj + +%% Contents for page 4 +%% Original object ID: 41 0 +72 0 obj +<< + /Length 73 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 3) Tj +ET +endstream +endobj + +73 0 obj +46 +endobj + +%% Contents for page 5 +%% Original object ID: 43 0 +74 0 obj +<< + /Length 75 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 4) Tj +ET +endstream +endobj + +75 0 obj +46 +endobj + +%% Contents for page 7 +%% Original object ID: 47 0 +76 0 obj +<< + /Length 77 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 6) Tj +ET +endstream +endobj + +77 0 obj +46 +endobj + +%% Contents for page 8 +%% Original object ID: 49 0 +78 0 obj +<< + /Length 79 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 7) Tj +ET +endstream +endobj + +79 0 obj +46 +endobj + +%% Contents for page 9 +%% Original object ID: 51 0 +80 0 obj +<< + /Length 81 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 8) Tj +ET +endstream +endobj + +81 0 obj +46 +endobj + +%% Contents for page 10 +%% Original object ID: 53 0 +82 0 obj +<< + /Length 83 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 9) Tj +ET +endstream +endobj + +83 0 obj +46 +endobj + +%% Contents for page 11 +%% Original object ID: 55 0 +84 0 obj +<< + /Length 85 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 10) Tj +ET +endstream +endobj + +85 0 obj +47 +endobj + +%% Contents for page 15 +%% Original object ID: 63 0 +86 0 obj +<< + /Length 87 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 14) Tj +ET +endstream +endobj + +87 0 obj +47 +endobj + +%% Contents for page 17 +%% Original object ID: 67 0 +88 0 obj +<< + /Length 89 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 16) Tj +ET +endstream +endobj + +89 0 obj +47 +endobj + +%% Contents for page 18 +%% Original object ID: 69 0 +90 0 obj +<< + /Length 91 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 17) Tj +ET +endstream +endobj + +91 0 obj +47 +endobj + +%% Contents for page 21 +%% Original object ID: 75 0 +92 0 obj +<< + /Length 93 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 20) Tj +ET +endstream +endobj + +93 0 obj +47 +endobj + +%% Contents for page 22 +%% Original object ID: 77 0 +94 0 obj +<< + /Length 95 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 21) Tj +ET +endstream +endobj + +95 0 obj +47 +endobj + +%% Contents for page 24 +%% Original object ID: 81 0 +96 0 obj +<< + /Length 97 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 23) Tj +ET +endstream +endobj + +97 0 obj +47 +endobj + +%% Contents for page 25 +%% Original object ID: 83 0 +98 0 obj +<< + /Length 99 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 24) Tj +ET +endstream +endobj + +99 0 obj +47 +endobj + +%% Contents for page 26 +%% Original object ID: 85 0 +100 0 obj +<< + /Length 101 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 25) Tj +ET +endstream +endobj + +101 0 obj +47 +endobj + +%% Contents for page 27 +%% Original object ID: 87 0 +102 0 obj +<< + /Length 103 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 26) Tj +ET +endstream +endobj + +103 0 obj +47 +endobj + +%% Contents for page 28 +%% Original object ID: 89 0 +104 0 obj +<< + /Length 105 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 27) Tj +ET +endstream +endobj + +105 0 obj +47 +endobj + +%% Contents for page 29 +%% Original object ID: 91 0 +106 0 obj +<< + /Length 107 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 28) Tj +ET +endstream +endobj + +107 0 obj +47 +endobj + +%% Contents for page 30 +%% Original object ID: 93 0 +108 0 obj +<< + /Length 109 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 29) Tj +ET +endstream +endobj + +109 0 obj +47 +endobj + +110 0 obj +<< + /Type /XRef + /Length 444 + /W [ 1 2 1 ] + /Root 1 0 R + /Size 111 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +stream +4«  +~   ,ÛdzŸ‹wcO9# ÷á˶¡ y!e"Q#=$)%&&í'Ù(Æ)³* +,†,í--°..p.¸/ /h/Ð00€0È101x1à2(22×3>3…3ì434š4á5H55ö6=6¤6ë7R7™88H8¯8÷9_9§::W:¿;;o;·</>w>á?*?”?Ý@G@@úACA­A +endstream +endobj + +startxref +16834 +%%EOF diff --git a/qpdf/qtest/qpdf/good18.out b/qpdf/qtest/qpdf/good18.out new file mode 100644 index 0000000..1d31025 --- /dev/null +++ b/qpdf/qtest/qpdf/good18.out @@ -0,0 +1,6 @@ +/QTest is implicit +/QTest is direct +/QTest is null +unparse: null +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/good18.pdf b/qpdf/qtest/qpdf/good18.pdf new file mode 100644 index 0000000..7563574 --- /dev/null +++ b/qpdf/qtest/qpdf/good18.pdf @@ -0,0 +1,1538 @@ +%PDF-1.5 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /PageLabels 107 0 R + /Pages 2 0 R + /Type /Catalog + /PageMode /UseOutlines + /Outlines 95 0 R +>> +endobj + +2 0 obj +<< + /Count 30 + /Kids [ + 3 0 R + 4 0 R + 5 0 R + 6 0 R + 7 0 R + 8 0 R + 9 0 R + 10 0 R + 11 0 R + 12 0 R + 13 0 R + 14 0 R + 15 0 R + 16 0 R + 17 0 R + 18 0 R + 19 0 R + 20 0 R + 21 0 R + 22 0 R + 23 0 R + 24 0 R + 25 0 R + 26 0 R + 27 0 R + 28 0 R + 29 0 R + 30 0 R + 31 0 R + 32 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +3 0 obj +<< + /Contents 33 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 2 +4 0 obj +<< + /Contents 37 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 3 +5 0 obj +<< + /Contents 39 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 4 +6 0 obj +<< + /Contents 41 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 5 +7 0 obj +<< + /Contents 43 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 6 +8 0 obj +<< + /Contents 45 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 7 +9 0 obj +<< + /Contents 47 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 8 +10 0 obj +<< + /Contents 49 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 9 +11 0 obj +<< + /Contents 51 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 10 +12 0 obj +<< + /Contents 53 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 11 +13 0 obj +<< + /Contents 55 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 12 +14 0 obj +<< + /Contents 57 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 13 +15 0 obj +<< + /Contents 59 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 14 +16 0 obj +<< + /Contents 61 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 15 +17 0 obj +<< + /Contents 63 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 16 +18 0 obj +<< + /Contents 65 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 17 +19 0 obj +<< + /Contents 67 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 18 +20 0 obj +<< + /Contents 69 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 19 +21 0 obj +<< + /Contents 71 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 20 +22 0 obj +<< + /Contents 73 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 21 +23 0 obj +<< + /Contents 75 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 22 +24 0 obj +<< + /Contents 77 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 23 +25 0 obj +<< + /Contents 79 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 24 +26 0 obj +<< + /Contents 81 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 25 +27 0 obj +<< + /Contents 83 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 26 +28 0 obj +<< + /Contents 85 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 27 +29 0 obj +<< + /Contents 87 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 28 +30 0 obj +<< + /Contents 89 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 29 +31 0 obj +<< + /Contents 91 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 30 +32 0 obj +<< + /Contents 93 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +33 0 obj +<< + /Length 34 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 0) Tj +ET +endstream +endobj + +34 0 obj +46 +endobj + +35 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +36 0 obj +[ + /PDF + /Text +] +endobj + +%% Contents for page 2 +37 0 obj +<< + /Length 38 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 1) Tj +ET +endstream +endobj + +38 0 obj +46 +endobj + +%% Contents for page 3 +39 0 obj +<< + /Length 40 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 2) Tj +ET +endstream +endobj + +40 0 obj +46 +endobj + +%% Contents for page 4 +41 0 obj +<< + /Length 42 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 3) Tj +ET +endstream +endobj + +42 0 obj +46 +endobj + +%% Contents for page 5 +43 0 obj +<< + /Length 44 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 4) Tj +ET +endstream +endobj + +44 0 obj +46 +endobj + +%% Contents for page 6 +45 0 obj +<< + /Length 46 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 5) Tj +ET +endstream +endobj + +46 0 obj +46 +endobj + +%% Contents for page 7 +47 0 obj +<< + /Length 48 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 6) Tj +ET +endstream +endobj + +48 0 obj +46 +endobj + +%% Contents for page 8 +49 0 obj +<< + /Length 50 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 7) Tj +ET +endstream +endobj + +50 0 obj +46 +endobj + +%% Contents for page 9 +51 0 obj +<< + /Length 52 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 8) Tj +ET +endstream +endobj + +52 0 obj +46 +endobj + +%% Contents for page 10 +53 0 obj +<< + /Length 54 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 9) Tj +ET +endstream +endobj + +54 0 obj +46 +endobj + +%% Contents for page 11 +55 0 obj +<< + /Length 56 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 10) Tj +ET +endstream +endobj + +56 0 obj +47 +endobj + +%% Contents for page 12 +57 0 obj +<< + /Length 58 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 11) Tj +ET +endstream +endobj + +58 0 obj +47 +endobj + +%% Contents for page 13 +59 0 obj +<< + /Length 60 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 12) Tj +ET +endstream +endobj + +60 0 obj +47 +endobj + +%% Contents for page 14 +61 0 obj +<< + /Length 62 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 13) Tj +ET +endstream +endobj + +62 0 obj +47 +endobj + +%% Contents for page 15 +63 0 obj +<< + /Length 64 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 14) Tj +ET +endstream +endobj + +64 0 obj +47 +endobj + +%% Contents for page 16 +65 0 obj +<< + /Length 66 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 15) Tj +ET +endstream +endobj + +66 0 obj +47 +endobj + +%% Contents for page 17 +67 0 obj +<< + /Length 68 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 16) Tj +ET +endstream +endobj + +68 0 obj +47 +endobj + +%% Contents for page 18 +69 0 obj +<< + /Length 70 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 17) Tj +ET +endstream +endobj + +70 0 obj +47 +endobj + +%% Contents for page 19 +71 0 obj +<< + /Length 72 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 18) Tj +ET +endstream +endobj + +72 0 obj +47 +endobj + +%% Contents for page 20 +73 0 obj +<< + /Length 74 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 19) Tj +ET +endstream +endobj + +74 0 obj +47 +endobj + +%% Contents for page 21 +75 0 obj +<< + /Length 76 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 20) Tj +ET +endstream +endobj + +76 0 obj +47 +endobj + +%% Contents for page 22 +77 0 obj +<< + /Length 78 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 21) Tj +ET +endstream +endobj + +78 0 obj +47 +endobj + +%% Contents for page 23 +79 0 obj +<< + /Length 80 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 22) Tj +ET +endstream +endobj + +80 0 obj +47 +endobj + +%% Contents for page 24 +81 0 obj +<< + /Length 82 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 23) Tj +ET +endstream +endobj + +82 0 obj +47 +endobj + +%% Contents for page 25 +83 0 obj +<< + /Length 84 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 24) Tj +ET +endstream +endobj + +84 0 obj +47 +endobj + +%% Contents for page 26 +85 0 obj +<< + /Length 86 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 25) Tj +ET +endstream +endobj + +86 0 obj +47 +endobj + +%% Contents for page 27 +87 0 obj +<< + /Length 88 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 26) Tj +ET +endstream +endobj + +88 0 obj +47 +endobj + +%% Contents for page 28 +89 0 obj +<< + /Length 90 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 27) Tj +ET +endstream +endobj + +90 0 obj +47 +endobj + +%% Contents for page 29 +91 0 obj +<< + /Length 92 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 28) Tj +ET +endstream +endobj + +92 0 obj +47 +endobj + +%% Contents for page 30 +93 0 obj +<< + /Length 94 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 29) Tj +ET +endstream +endobj + +94 0 obj +47 +endobj + +xref +0 110 +0000000095 65535 f +0000000025 00000 n +0000000145 00000 n +0000000541 00000 n +0000000746 00000 n +0000000951 00000 n +0000001156 00000 n +0000001361 00000 n +0000001566 00000 n +0000001771 00000 n +0000001976 00000 n +0000002182 00000 n +0000002389 00000 n +0000002596 00000 n +0000002803 00000 n +0000003010 00000 n +0000003217 00000 n +0000003424 00000 n +0000003631 00000 n +0000003838 00000 n +0000004045 00000 n +0000004252 00000 n +0000004459 00000 n +0000004666 00000 n +0000004873 00000 n +0000005080 00000 n +0000005287 00000 n +0000005494 00000 n +0000005701 00000 n +0000005908 00000 n +0000006115 00000 n +0000006322 00000 n +0000006529 00000 n +0000006748 00000 n +0000006851 00000 n +0000006871 00000 n +0000006990 00000 n +0000007049 00000 n +0000007152 00000 n +0000007195 00000 n +0000007298 00000 n +0000007341 00000 n +0000007444 00000 n +0000007487 00000 n +0000007590 00000 n +0000007633 00000 n +0000007736 00000 n +0000007779 00000 n +0000007882 00000 n +0000007925 00000 n +0000008028 00000 n +0000008071 00000 n +0000008174 00000 n +0000008218 00000 n +0000008321 00000 n +0000008365 00000 n +0000008469 00000 n +0000008513 00000 n +0000008617 00000 n +0000008661 00000 n +0000008765 00000 n +0000008809 00000 n +0000008913 00000 n +0000008957 00000 n +0000009061 00000 n +0000009105 00000 n +0000009209 00000 n +0000009253 00000 n +0000009357 00000 n +0000009401 00000 n +0000009505 00000 n +0000009549 00000 n +0000009653 00000 n +0000009697 00000 n +0000009801 00000 n +0000009845 00000 n +0000009949 00000 n +0000009993 00000 n +0000010097 00000 n +0000010141 00000 n +0000010245 00000 n +0000010289 00000 n +0000010393 00000 n +0000010437 00000 n +0000010541 00000 n +0000010585 00000 n +0000010689 00000 n +0000010733 00000 n +0000010837 00000 n +0000010881 00000 n +0000010985 00000 n +0000011029 00000 n +0000011133 00000 n +0000011177 00000 n +0000011281 00000 n +0000000096 65535 f +0000000097 65535 f +0000000098 65535 f +0000000099 65535 f +0000000100 65535 f +0000000101 65535 f +0000000102 65535 f +0000000103 65535 f +0000000104 65535 f +0000000105 65535 f +0000000106 65535 f +0000000107 65535 f +0000000108 65535 f +0000000109 65535 f +0000000000 65535 f +trailer << + /Root 1 0 R + /Size 110 +>> +startxref +11301 +%%EOF + +108 0 obj +<< + /Type /ObjStm + /N 13 + /First 107 + /Length 2445 +>> +stream +95 0 +96 74 +97 259 +98 393 +99 556 +100 898 +101 1077 +102 1275 +103 1432 +104 1589 +105 1730 +106 1887 +107 2040 +%95 +<< + /Type /Outlines + /First 96 0 R + /Last 97 0 R + /Count 6 +>> +%96 +<< + /Type /Outline + /Title (Isís 1 -> 5: /XYZ null null null) + /Parent 95 0 R + /Count 4 + /Next 97 0 R + /First 98 0 R + /Last 99 0 R + /Dest [ 8 0 R /XYZ null null null ] +>> +% 97 +<< + /Type /Outline + /Title (Trepak 2 -> 15: /XYZ 66 756 3) + /Parent 95 0 R + /Prev 96 0 R + /Dest [ 18 0 R /XYZ 66 756 3 ] +>> +% 98 +<< + /Type /Outline + /Title (Amanda 1.1 -> 11: /Fit) + /Parent 96 0 R + /Next 99 0 R + /First 100 0 R + /Last 101 0 R + /Count -3 + /Dest [ 14 0 R /Fit ] +>> +% 99 +<< + /Type /Outline + % /Title (Sandy (Sandy [Greek]) 1.2 -> 13: /FitH 792) + /Title + /Parent 96 0 R + /Prev 98 0 R + /First 105 0 R + /Last 106 0 R + /Count 2 + /Dest [ 16 0 R /FitH 792 ] +>> +% 100 +<< + /Type /Outline + /Title (Isosicle 1.1.1 -> 12: /FitV 100) + /Parent 98 0 R + /Next 101 0 R + /First 102 0 R + /Last 103 0 R + /Count -2 + /Dest [ 15 0 R /FitV 100 ] +>> +% 101 +<< + /Type /Outline + /Title (Isosicle 1.1.2 -> 12: /XYZ null null null) + /Parent 98 0 R + /Prev 100 0 R + /First 104 0 R + /Last 104 0 R + /Count 1 + /Dest [ 15 0 R /XYZ null null null ] +>> +% 102 +<< + /Type /Outline + /Title (Isosicle 1.1.1.1 -> 18: /XYZ null null null) + /Parent 100 0 R + /Next 103 0 R + /Dest [ 21 0 R /XYZ null null null ] +>> +% 103 +<< + /Type /Outline + /Title (Isosicle 1.1.1.2 -> 19: /XYZ null null null) + /Parent 100 0 R + /Prev 102 0 R + /Dest [ 22 0 R /XYZ null null null ] +>> +% 104 +<< + /Type /Outline + /Title (Isosicle 1.1.2.1 -> 22: /XYZ null null null) + /Parent 101 0 R + /Dest [ 25 0 R /XYZ null null null ] +>> +% 105 +<< + /Type /Outline + /Title (Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770) + /Parent 99 0 R + /Next 106 0 R + /Dest [ 4 0 R /FitR 66 714 180 770 ] +>> +% 106 +<< + /Type /Outline + /Title (Trepsicle 1.2.2 -> 0: /XYZ null null null) + /Parent 99 0 R + /Prev 105 0 R + /Dest [ 3 0 R /XYZ null null null ] +>> +% 107 + << /Nums [ + 0 << /P () >> + 2 << /S /r /St 1 >> + 7 << /P () >> + 9 << /S /r /St 6 >> + 11 << /P () >> + 12 << /S /D /St 2 >> + 15 << /S /D /St 6 >> + 19 << /P () >> + 20 << /S /D /St 12 >> + 22 << /S /D /St 16059 >> + 23 << /S /r /St 50 >> + 29 << /S /r /St 54 >> + ] >> +endstream +endobj + +109 0 obj +<< + /Type /XRef + /Size 110 + /Index [0 110] + /W [1 2 1] + /Length 110 + /Root 1 0 R + /Filter /FlateDecode + /DecodeParms << /Columns 4 /Predictor 12 >> +>> +stream +xœcb&FI&† + ÁÔbŒX$‰s â<Œ`8Â%B‚4m·Abé BÄ-±¬abŒÚpY‹Î"IŒQ. b1fÀX $ˆ1ÒA‘¦0^‰qÉ%þ›ÎþÂÄÀùŠ«È1 +endstream +endobj + +xref +0 0 +trailer << + /Size 110 + /Root 1 0 R + /Prev 11301 + /XRefStm 16113 +>> + +startxref +16418 +%%EOF diff --git a/qpdf/qtest/qpdf/good18.qdf b/qpdf/qtest/qpdf/good18.qdf new file mode 100644 index 0000000..b60b43a --- /dev/null +++ b/qpdf/qtest/qpdf/good18.qdf @@ -0,0 +1,1407 @@ +%PDF-1.5 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /PageMode /UseOutlines + /Pages 2 0 R + /Type /Catalog +>> +endobj + +%% Original object ID: 2 0 +2 0 obj +<< + /Count 30 + /Kids [ + 3 0 R + 4 0 R + 5 0 R + 6 0 R + 7 0 R + 8 0 R + 9 0 R + 10 0 R + 11 0 R + 12 0 R + 13 0 R + 14 0 R + 15 0 R + 16 0 R + 17 0 R + 18 0 R + 19 0 R + 20 0 R + 21 0 R + 22 0 R + 23 0 R + 24 0 R + 25 0 R + 26 0 R + 27 0 R + 28 0 R + 29 0 R + 30 0 R + 31 0 R + 32 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +%% Original object ID: 3 0 +3 0 obj +<< + /Contents 33 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 2 +%% Original object ID: 4 0 +4 0 obj +<< + /Contents 37 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 3 +%% Original object ID: 5 0 +5 0 obj +<< + /Contents 39 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 4 +%% Original object ID: 6 0 +6 0 obj +<< + /Contents 41 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 5 +%% Original object ID: 7 0 +7 0 obj +<< + /Contents 43 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 6 +%% Original object ID: 8 0 +8 0 obj +<< + /Contents 45 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 7 +%% Original object ID: 9 0 +9 0 obj +<< + /Contents 47 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 8 +%% Original object ID: 10 0 +10 0 obj +<< + /Contents 49 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 9 +%% Original object ID: 11 0 +11 0 obj +<< + /Contents 51 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 10 +%% Original object ID: 12 0 +12 0 obj +<< + /Contents 53 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 11 +%% Original object ID: 13 0 +13 0 obj +<< + /Contents 55 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 12 +%% Original object ID: 14 0 +14 0 obj +<< + /Contents 57 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 13 +%% Original object ID: 15 0 +15 0 obj +<< + /Contents 59 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 14 +%% Original object ID: 16 0 +16 0 obj +<< + /Contents 61 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 15 +%% Original object ID: 17 0 +17 0 obj +<< + /Contents 63 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 16 +%% Original object ID: 18 0 +18 0 obj +<< + /Contents 65 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 17 +%% Original object ID: 19 0 +19 0 obj +<< + /Contents 67 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 18 +%% Original object ID: 20 0 +20 0 obj +<< + /Contents 69 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 19 +%% Original object ID: 21 0 +21 0 obj +<< + /Contents 71 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 20 +%% Original object ID: 22 0 +22 0 obj +<< + /Contents 73 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 21 +%% Original object ID: 23 0 +23 0 obj +<< + /Contents 75 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 22 +%% Original object ID: 24 0 +24 0 obj +<< + /Contents 77 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 23 +%% Original object ID: 25 0 +25 0 obj +<< + /Contents 79 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 24 +%% Original object ID: 26 0 +26 0 obj +<< + /Contents 81 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 25 +%% Original object ID: 27 0 +27 0 obj +<< + /Contents 83 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 26 +%% Original object ID: 28 0 +28 0 obj +<< + /Contents 85 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 27 +%% Original object ID: 29 0 +29 0 obj +<< + /Contents 87 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 28 +%% Original object ID: 30 0 +30 0 obj +<< + /Contents 89 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 29 +%% Original object ID: 31 0 +31 0 obj +<< + /Contents 91 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 30 +%% Original object ID: 32 0 +32 0 obj +<< + /Contents 93 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +%% Original object ID: 33 0 +33 0 obj +<< + /Length 34 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 0) Tj +ET +endstream +endobj + +34 0 obj +46 +endobj + +%% Original object ID: 35 0 +35 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 36 0 +36 0 obj +[ + /PDF + /Text +] +endobj + +%% Contents for page 2 +%% Original object ID: 37 0 +37 0 obj +<< + /Length 38 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 1) Tj +ET +endstream +endobj + +38 0 obj +46 +endobj + +%% Contents for page 3 +%% Original object ID: 39 0 +39 0 obj +<< + /Length 40 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 2) Tj +ET +endstream +endobj + +40 0 obj +46 +endobj + +%% Contents for page 4 +%% Original object ID: 41 0 +41 0 obj +<< + /Length 42 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 3) Tj +ET +endstream +endobj + +42 0 obj +46 +endobj + +%% Contents for page 5 +%% Original object ID: 43 0 +43 0 obj +<< + /Length 44 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 4) Tj +ET +endstream +endobj + +44 0 obj +46 +endobj + +%% Contents for page 6 +%% Original object ID: 45 0 +45 0 obj +<< + /Length 46 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 5) Tj +ET +endstream +endobj + +46 0 obj +46 +endobj + +%% Contents for page 7 +%% Original object ID: 47 0 +47 0 obj +<< + /Length 48 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 6) Tj +ET +endstream +endobj + +48 0 obj +46 +endobj + +%% Contents for page 8 +%% Original object ID: 49 0 +49 0 obj +<< + /Length 50 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 7) Tj +ET +endstream +endobj + +50 0 obj +46 +endobj + +%% Contents for page 9 +%% Original object ID: 51 0 +51 0 obj +<< + /Length 52 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 8) Tj +ET +endstream +endobj + +52 0 obj +46 +endobj + +%% Contents for page 10 +%% Original object ID: 53 0 +53 0 obj +<< + /Length 54 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 9) Tj +ET +endstream +endobj + +54 0 obj +46 +endobj + +%% Contents for page 11 +%% Original object ID: 55 0 +55 0 obj +<< + /Length 56 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 10) Tj +ET +endstream +endobj + +56 0 obj +47 +endobj + +%% Contents for page 12 +%% Original object ID: 57 0 +57 0 obj +<< + /Length 58 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 11) Tj +ET +endstream +endobj + +58 0 obj +47 +endobj + +%% Contents for page 13 +%% Original object ID: 59 0 +59 0 obj +<< + /Length 60 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 12) Tj +ET +endstream +endobj + +60 0 obj +47 +endobj + +%% Contents for page 14 +%% Original object ID: 61 0 +61 0 obj +<< + /Length 62 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 13) Tj +ET +endstream +endobj + +62 0 obj +47 +endobj + +%% Contents for page 15 +%% Original object ID: 63 0 +63 0 obj +<< + /Length 64 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 14) Tj +ET +endstream +endobj + +64 0 obj +47 +endobj + +%% Contents for page 16 +%% Original object ID: 65 0 +65 0 obj +<< + /Length 66 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 15) Tj +ET +endstream +endobj + +66 0 obj +47 +endobj + +%% Contents for page 17 +%% Original object ID: 67 0 +67 0 obj +<< + /Length 68 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 16) Tj +ET +endstream +endobj + +68 0 obj +47 +endobj + +%% Contents for page 18 +%% Original object ID: 69 0 +69 0 obj +<< + /Length 70 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 17) Tj +ET +endstream +endobj + +70 0 obj +47 +endobj + +%% Contents for page 19 +%% Original object ID: 71 0 +71 0 obj +<< + /Length 72 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 18) Tj +ET +endstream +endobj + +72 0 obj +47 +endobj + +%% Contents for page 20 +%% Original object ID: 73 0 +73 0 obj +<< + /Length 74 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 19) Tj +ET +endstream +endobj + +74 0 obj +47 +endobj + +%% Contents for page 21 +%% Original object ID: 75 0 +75 0 obj +<< + /Length 76 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 20) Tj +ET +endstream +endobj + +76 0 obj +47 +endobj + +%% Contents for page 22 +%% Original object ID: 77 0 +77 0 obj +<< + /Length 78 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 21) Tj +ET +endstream +endobj + +78 0 obj +47 +endobj + +%% Contents for page 23 +%% Original object ID: 79 0 +79 0 obj +<< + /Length 80 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 22) Tj +ET +endstream +endobj + +80 0 obj +47 +endobj + +%% Contents for page 24 +%% Original object ID: 81 0 +81 0 obj +<< + /Length 82 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 23) Tj +ET +endstream +endobj + +82 0 obj +47 +endobj + +%% Contents for page 25 +%% Original object ID: 83 0 +83 0 obj +<< + /Length 84 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 24) Tj +ET +endstream +endobj + +84 0 obj +47 +endobj + +%% Contents for page 26 +%% Original object ID: 85 0 +85 0 obj +<< + /Length 86 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 25) Tj +ET +endstream +endobj + +86 0 obj +47 +endobj + +%% Contents for page 27 +%% Original object ID: 87 0 +87 0 obj +<< + /Length 88 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 26) Tj +ET +endstream +endobj + +88 0 obj +47 +endobj + +%% Contents for page 28 +%% Original object ID: 89 0 +89 0 obj +<< + /Length 90 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 27) Tj +ET +endstream +endobj + +90 0 obj +47 +endobj + +%% Contents for page 29 +%% Original object ID: 91 0 +91 0 obj +<< + /Length 92 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 28) Tj +ET +endstream +endobj + +92 0 obj +47 +endobj + +%% Contents for page 30 +%% Original object ID: 93 0 +93 0 obj +<< + /Length 94 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 29) Tj +ET +endstream +endobj + +94 0 obj +47 +endobj + +xref +0 95 +0000000000 65535 f +0000000052 00000 n +0000000158 00000 n +0000000581 00000 n +0000000813 00000 n +0000001045 00000 n +0000001277 00000 n +0000001509 00000 n +0000001741 00000 n +0000001973 00000 n +0000002206 00000 n +0000002440 00000 n +0000002675 00000 n +0000002910 00000 n +0000003145 00000 n +0000003380 00000 n +0000003615 00000 n +0000003850 00000 n +0000004085 00000 n +0000004320 00000 n +0000004555 00000 n +0000004790 00000 n +0000005025 00000 n +0000005260 00000 n +0000005495 00000 n +0000005730 00000 n +0000005965 00000 n +0000006200 00000 n +0000006435 00000 n +0000006670 00000 n +0000006905 00000 n +0000007140 00000 n +0000007375 00000 n +0000007622 00000 n +0000007725 00000 n +0000007773 00000 n +0000007920 00000 n +0000008007 00000 n +0000008110 00000 n +0000008181 00000 n +0000008284 00000 n +0000008355 00000 n +0000008458 00000 n +0000008529 00000 n +0000008632 00000 n +0000008703 00000 n +0000008806 00000 n +0000008877 00000 n +0000008980 00000 n +0000009051 00000 n +0000009154 00000 n +0000009225 00000 n +0000009328 00000 n +0000009400 00000 n +0000009503 00000 n +0000009575 00000 n +0000009679 00000 n +0000009751 00000 n +0000009855 00000 n +0000009927 00000 n +0000010031 00000 n +0000010103 00000 n +0000010207 00000 n +0000010279 00000 n +0000010383 00000 n +0000010455 00000 n +0000010559 00000 n +0000010631 00000 n +0000010735 00000 n +0000010807 00000 n +0000010911 00000 n +0000010983 00000 n +0000011087 00000 n +0000011159 00000 n +0000011263 00000 n +0000011335 00000 n +0000011439 00000 n +0000011511 00000 n +0000011615 00000 n +0000011687 00000 n +0000011791 00000 n +0000011863 00000 n +0000011967 00000 n +0000012039 00000 n +0000012143 00000 n +0000012215 00000 n +0000012319 00000 n +0000012391 00000 n +0000012495 00000 n +0000012567 00000 n +0000012671 00000 n +0000012743 00000 n +0000012847 00000 n +0000012919 00000 n +0000013023 00000 n +trailer << + /Root 1 0 R + /Size 95 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +startxref +13043 +%%EOF diff --git a/qpdf/qtest/qpdf/good19.out b/qpdf/qtest/qpdf/good19.out new file mode 100644 index 0000000..1d31025 --- /dev/null +++ b/qpdf/qtest/qpdf/good19.out @@ -0,0 +1,6 @@ +/QTest is implicit +/QTest is direct +/QTest is null +unparse: null +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/good19.pdf b/qpdf/qtest/qpdf/good19.pdf new file mode 100644 index 0000000..3ffc2db Binary files /dev/null and b/qpdf/qtest/qpdf/good19.pdf differ diff --git a/qpdf/qtest/qpdf/good19.qdf b/qpdf/qtest/qpdf/good19.qdf new file mode 100644 index 0000000..4ffea06 Binary files /dev/null and b/qpdf/qtest/qpdf/good19.qdf differ diff --git a/qpdf/qtest/qpdf/good2.out b/qpdf/qtest/qpdf/good2.out new file mode 100644 index 0000000..1d31025 --- /dev/null +++ b/qpdf/qtest/qpdf/good2.out @@ -0,0 +1,6 @@ +/QTest is implicit +/QTest is direct +/QTest is null +unparse: null +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/good2.pdf b/qpdf/qtest/qpdf/good2.pdf new file mode 100644 index 0000000..535f369 --- /dev/null +++ b/qpdf/qtest/qpdf/good2.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /QTest null +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/good2.qdf b/qpdf/qtest/qpdf/good2.qdf new file mode 100644 index 0000000..7b33f19 --- /dev/null +++ b/qpdf/qtest/qpdf/good2.qdf @@ -0,0 +1,101 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +%% Original object ID: 2 0 +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +%% Original object ID: 3 0 +3 0 obj +<< + /Contents 4 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 6 0 R + >> + /ProcSet 7 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +%% Original object ID: 4 0 +4 0 obj +<< + /Length 5 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +44 +endobj + +%% Original object ID: 6 0 +6 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 5 0 +7 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 8 +0000000000 65535 f +0000000052 00000 n +0000000133 00000 n +0000000242 00000 n +0000000484 00000 n +0000000583 00000 n +0000000629 00000 n +0000000774 00000 n +trailer << + /Root 1 0 R + /Size 8 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +startxref +809 +%%EOF diff --git a/qpdf/qtest/qpdf/good20.out b/qpdf/qtest/qpdf/good20.out new file mode 100644 index 0000000..1d31025 --- /dev/null +++ b/qpdf/qtest/qpdf/good20.out @@ -0,0 +1,6 @@ +/QTest is implicit +/QTest is direct +/QTest is null +unparse: null +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/good20.pdf b/qpdf/qtest/qpdf/good20.pdf new file mode 100644 index 0000000..91c3f2b --- /dev/null +++ b/qpdf/qtest/qpdf/good20.pdf @@ -0,0 +1,901 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> + /OtherStuff [ + 7 0 R 8 0 R 9 0 R 10 0 R 11 0 R 12 0 R 13 0 R 14 0 R + 15 0 R 16 0 R 17 0 R 18 0 R 19 0 R 20 0 R 21 0 R 22 0 R + 23 0 R 24 0 R 25 0 R 26 0 R 27 0 R 28 0 R 29 0 R 30 0 R + 31 0 R 32 0 R 33 0 R 34 0 R 35 0 R 36 0 R 37 0 R 38 0 R + 39 0 R 40 0 R 41 0 R 42 0 R 43 0 R 44 0 R 45 0 R 46 0 R + 47 0 R 48 0 R 49 0 R 50 0 R 51 0 R 52 0 R 53 0 R 54 0 R + 55 0 R 56 0 R 57 0 R 58 0 R 59 0 R 60 0 R 61 0 R 62 0 R + 63 0 R 64 0 R 65 0 R 66 0 R 67 0 R 68 0 R 69 0 R 70 0 R + 71 0 R 72 0 R 73 0 R 74 0 R 75 0 R 76 0 R 77 0 R 78 0 R + 79 0 R 80 0 R 81 0 R 82 0 R 83 0 R 84 0 R 85 0 R 86 0 R + 87 0 R 88 0 R 89 0 R 90 0 R 91 0 R 92 0 R 93 0 R 94 0 R + 95 0 R 96 0 R 97 0 R 98 0 R 99 0 R 100 0 R 101 0 R 102 0 R + 103 0 R 104 0 R 105 0 R 106 0 R 107 0 R 108 0 R 109 0 R 110 0 R + 111 0 R 112 0 R 113 0 R 114 0 R 115 0 R 116 0 R 117 0 R 118 0 R + 119 0 R 120 0 R 121 0 R 122 0 R 123 0 R 124 0 R 125 0 R 126 0 R + 127 0 R 128 0 R 129 0 R 130 0 R 131 0 R 132 0 R 133 0 R 134 0 R + 135 0 R 136 0 R 137 0 R 138 0 R 139 0 R 140 0 R 141 0 R 142 0 R + 143 0 R 144 0 R 145 0 R 146 0 R 147 0 R 148 0 R 149 0 R 150 0 R + 151 0 R 152 0 R 153 0 R 154 0 R 155 0 R 156 0 R 157 0 R 158 0 R + 159 0 R 160 0 R 161 0 R 162 0 R 163 0 R 164 0 R 165 0 R 166 0 R + ] +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +7 0 obj +[/Object-7] +endobj + +8 0 obj +[/Object-8] +endobj + +9 0 obj +[/Object-9] +endobj + +10 0 obj +[/Object-10] +endobj + +11 0 obj +[/Object-11] +endobj + +12 0 obj +[/Object-12] +endobj + +13 0 obj +[/Object-13] +endobj + +14 0 obj +[/Object-14] +endobj + +15 0 obj +[/Object-15] +endobj + +16 0 obj +[/Object-16] +endobj + +17 0 obj +[/Object-17] +endobj + +18 0 obj +[/Object-18] +endobj + +19 0 obj +[/Object-19] +endobj + +20 0 obj +[/Object-20] +endobj + +21 0 obj +[/Object-21] +endobj + +22 0 obj +[/Object-22] +endobj + +23 0 obj +[/Object-23] +endobj + +24 0 obj +[/Object-24] +endobj + +25 0 obj +[/Object-25] +endobj + +26 0 obj +[/Object-26] +endobj + +27 0 obj +[/Object-27] +endobj + +28 0 obj +[/Object-28] +endobj + +29 0 obj +[/Object-29] +endobj + +30 0 obj +[/Object-30] +endobj + +31 0 obj +[/Object-31] +endobj + +32 0 obj +[/Object-32] +endobj + +33 0 obj +[/Object-33] +endobj + +34 0 obj +[/Object-34] +endobj + +35 0 obj +[/Object-35] +endobj + +36 0 obj +[/Object-36] +endobj + +37 0 obj +[/Object-37] +endobj + +38 0 obj +[/Object-38] +endobj + +39 0 obj +[/Object-39] +endobj + +40 0 obj +[/Object-40] +endobj + +41 0 obj +[/Object-41] +endobj + +42 0 obj +[/Object-42] +endobj + +43 0 obj +[/Object-43] +endobj + +44 0 obj +[/Object-44] +endobj + +45 0 obj +[/Object-45] +endobj + +46 0 obj +[/Object-46] +endobj + +47 0 obj +[/Object-47] +endobj + +48 0 obj +[/Object-48] +endobj + +49 0 obj +[/Object-49] +endobj + +50 0 obj +[/Object-50] +endobj + +51 0 obj +[/Object-51] +endobj + +52 0 obj +[/Object-52] +endobj + +53 0 obj +[/Object-53] +endobj + +54 0 obj +[/Object-54] +endobj + +55 0 obj +[/Object-55] +endobj + +56 0 obj +[/Object-56] +endobj + +57 0 obj +[/Object-57] +endobj + +58 0 obj +[/Object-58] +endobj + +59 0 obj +[/Object-59] +endobj + +60 0 obj +[/Object-60] +endobj + +61 0 obj +[/Object-61] +endobj + +62 0 obj +[/Object-62] +endobj + +63 0 obj +[/Object-63] +endobj + +64 0 obj +[/Object-64] +endobj + +65 0 obj +[/Object-65] +endobj + +66 0 obj +[/Object-66] +endobj + +67 0 obj +[/Object-67] +endobj + +68 0 obj +[/Object-68] +endobj + +69 0 obj +[/Object-69] +endobj + +70 0 obj +[/Object-70] +endobj + +71 0 obj +[/Object-71] +endobj + +72 0 obj +[/Object-72] +endobj + +73 0 obj +[/Object-73] +endobj + +74 0 obj +[/Object-74] +endobj + +75 0 obj +[/Object-75] +endobj + +76 0 obj +[/Object-76] +endobj + +77 0 obj +[/Object-77] +endobj + +78 0 obj +[/Object-78] +endobj + +79 0 obj +[/Object-79] +endobj + +80 0 obj +[/Object-80] +endobj + +81 0 obj +[/Object-81] +endobj + +82 0 obj +[/Object-82] +endobj + +83 0 obj +[/Object-83] +endobj + +84 0 obj +[/Object-84] +endobj + +85 0 obj +[/Object-85] +endobj + +86 0 obj +[/Object-86] +endobj + +87 0 obj +[/Object-87] +endobj + +88 0 obj +[/Object-88] +endobj + +89 0 obj +[/Object-89] +endobj + +90 0 obj +[/Object-90] +endobj + +91 0 obj +[/Object-91] +endobj + +92 0 obj +[/Object-92] +endobj + +93 0 obj +[/Object-93] +endobj + +94 0 obj +[/Object-94] +endobj + +95 0 obj +[/Object-95] +endobj + +96 0 obj +[/Object-96] +endobj + +97 0 obj +[/Object-97] +endobj + +98 0 obj +[/Object-98] +endobj + +99 0 obj +[/Object-99] +endobj + +100 0 obj +[/Object-100] +endobj + +101 0 obj +[/Object-101] +endobj + +102 0 obj +[/Object-102] +endobj + +103 0 obj +[/Object-103] +endobj + +104 0 obj +[/Object-104] +endobj + +105 0 obj +[/Object-105] +endobj + +106 0 obj +[/Object-106] +endobj + +107 0 obj +[/Object-107] +endobj + +108 0 obj +[/Object-108] +endobj + +109 0 obj +[/Object-109] +endobj + +110 0 obj +[/Object-110] +endobj + +111 0 obj +[/Object-111] +endobj + +112 0 obj +[/Object-112] +endobj + +113 0 obj +[/Object-113] +endobj + +114 0 obj +[/Object-114] +endobj + +115 0 obj +[/Object-115] +endobj + +116 0 obj +[/Object-116] +endobj + +117 0 obj +[/Object-117] +endobj + +118 0 obj +[/Object-118] +endobj + +119 0 obj +[/Object-119] +endobj + +120 0 obj +[/Object-120] +endobj + +121 0 obj +[/Object-121] +endobj + +122 0 obj +[/Object-122] +endobj + +123 0 obj +[/Object-123] +endobj + +124 0 obj +[/Object-124] +endobj + +125 0 obj +[/Object-125] +endobj + +126 0 obj +[/Object-126] +endobj + +127 0 obj +[/Object-127] +endobj + +128 0 obj +[/Object-128] +endobj + +129 0 obj +[/Object-129] +endobj + +130 0 obj +[/Object-130] +endobj + +131 0 obj +[/Object-131] +endobj + +132 0 obj +[/Object-132] +endobj + +133 0 obj +[/Object-133] +endobj + +134 0 obj +[/Object-134] +endobj + +135 0 obj +[/Object-135] +endobj + +136 0 obj +[/Object-136] +endobj + +137 0 obj +[/Object-137] +endobj + +138 0 obj +[/Object-138] +endobj + +139 0 obj +[/Object-139] +endobj + +140 0 obj +[/Object-140] +endobj + +141 0 obj +[/Object-141] +endobj + +142 0 obj +[/Object-142] +endobj + +143 0 obj +[/Object-143] +endobj + +144 0 obj +[/Object-144] +endobj + +145 0 obj +[/Object-145] +endobj + +146 0 obj +[/Object-146] +endobj + +147 0 obj +[/Object-147] +endobj + +148 0 obj +[/Object-148] +endobj + +149 0 obj +[/Object-149] +endobj + +150 0 obj +[/Object-150] +endobj + +151 0 obj +[/Object-151] +endobj + +152 0 obj +[/Object-152] +endobj + +153 0 obj +[/Object-153] +endobj + +154 0 obj +[/Object-154] +endobj + +155 0 obj +[/Object-155] +endobj + +156 0 obj +[/Object-156] +endobj + +157 0 obj +[/Object-157] +endobj + +158 0 obj +[/Object-158] +endobj + +159 0 obj +[/Object-159] +endobj + +160 0 obj +[/Object-160] +endobj + +161 0 obj +[/Object-161] +endobj + +162 0 obj +[/Object-162] +endobj + +163 0 obj +[/Object-163] +endobj + +164 0 obj +[/Object-164] +endobj + +165 0 obj +[/Object-165] +endobj + +166 0 obj +[/Object-166] +endobj + +xref +0 167 +0000006875 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000001687 00000 n +0000001783 00000 n +0000001818 00000 n +0000001936 00000 n +0000001964 00000 n +0000001992 00000 n +0000002020 00000 n +0000002050 00000 n +0000002080 00000 n +0000002110 00000 n +0000002140 00000 n +0000002170 00000 n +0000002200 00000 n +0000002230 00000 n +0000002260 00000 n +0000002290 00000 n +0000002320 00000 n +0000002350 00000 n +0000002380 00000 n +0000002410 00000 n +0000002440 00000 n +0000002470 00000 n +0000002500 00000 n +0000002530 00000 n +0000002560 00000 n +0000002590 00000 n +0000002620 00000 n +0000002650 00000 n +0000002680 00000 n +0000002710 00000 n +0000002740 00000 n +0000002770 00000 n +0000002800 00000 n +0000002830 00000 n +0000002860 00000 n +0000002890 00000 n +0000002920 00000 n +0000002950 00000 n +0000002980 00000 n +0000003010 00000 n +0000003040 00000 n +0000003070 00000 n +0000003100 00000 n +0000003130 00000 n +0000003160 00000 n +0000003190 00000 n +0000003220 00000 n +0000003250 00000 n +0000003280 00000 n +0000003310 00000 n +0000003340 00000 n +0000003370 00000 n +0000003400 00000 n +0000003430 00000 n +0000003460 00000 n +0000003490 00000 n +0000003520 00000 n +0000003550 00000 n +0000003580 00000 n +0000003610 00000 n +0000003640 00000 n +0000003670 00000 n +0000003700 00000 n +0000003730 00000 n +0000003760 00000 n +0000003790 00000 n +0000003820 00000 n +0000003850 00000 n +0000003880 00000 n +0000003910 00000 n +0000003940 00000 n +0000003970 00000 n +0000004000 00000 n +0000004030 00000 n +0000004060 00000 n +0000004090 00000 n +0000004120 00000 n +0000004150 00000 n +0000004180 00000 n +0000004210 00000 n +0000004240 00000 n +0000004270 00000 n +0000004300 00000 n +0000004330 00000 n +0000004360 00000 n +0000004390 00000 n +0000004420 00000 n +0000004450 00000 n +0000004480 00000 n +0000004510 00000 n +0000004540 00000 n +0000004570 00000 n +0000004600 00000 n +0000004630 00000 n +0000004660 00000 n +0000004690 00000 n +0000004720 00000 n +0000004752 00000 n +0000004784 00000 n +0000004816 00000 n +0000004848 00000 n +0000004880 00000 n +0000004912 00000 n +0000004944 00000 n +0000004976 00000 n +0000005008 00000 n +0000005040 00000 n +0000005072 00000 n +0000005104 00000 n +0000005136 00000 n +0000005168 00000 n +0000005200 00000 n +0000005232 00000 n +0000005264 00000 n +0000005296 00000 n +0000005328 00000 n +0000005360 00000 n +0000005392 00000 n +0000005424 00000 n +0000005456 00000 n +0000005488 00000 n +0000005520 00000 n +0000005552 00000 n +0000005584 00000 n +0000005616 00000 n +0000005648 00000 n +0000005680 00000 n +0000005712 00000 n +0000005744 00000 n +0000005776 00000 n +0000005808 00000 n +0000005840 00000 n +0000005872 00000 n +0000005904 00000 n +0000005936 00000 n +0000005968 00000 n +0000006000 00000 n +0000006032 00000 n +0000006064 00000 n +0000006096 00000 n +0000006128 00000 n +0000006160 00000 n +0000006192 00000 n +0000006224 00000 n +0000006256 00000 n +0000006288 00000 n +0000006320 00000 n +0000006352 00000 n +0000006384 00000 n +0000006416 00000 n +0000006448 00000 n +0000006480 00000 n +0000006512 00000 n +0000006544 00000 n +0000006576 00000 n +0000006608 00000 n +0000006640 00000 n +0000006672 00000 n +0000006704 00000 n +0000006736 00000 n +0000006768 00000 n +0000006800 00000 n +0000006832 00000 n +trailer << + /Size 167 + /Root 1 0 R +>> +startxref +6864 +%%EOF diff --git a/qpdf/qtest/qpdf/good20.qdf b/qpdf/qtest/qpdf/good20.qdf new file mode 100644 index 0000000..c30c75a --- /dev/null +++ b/qpdf/qtest/qpdf/good20.qdf @@ -0,0 +1,1076 @@ +%PDF-1.5 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /Type /ObjStm + /Length 9257 + /N 83 + /First 709 +>> +stream +2 0 +3 97 +4 212 +5 2305 +6 2380 +7 2455 +8 2531 +9 2608 +10 2686 +11 2764 +12 2843 +13 2922 +14 3001 +15 3080 +16 3159 +17 3238 +18 3317 +19 3396 +20 3475 +21 3554 +22 3633 +23 3712 +24 3791 +25 3870 +26 3949 +27 4028 +28 4107 +29 4186 +30 4265 +31 4344 +32 4423 +33 4502 +34 4581 +35 4660 +36 4739 +37 4818 +38 4897 +39 4976 +40 5055 +41 5134 +42 5213 +43 5292 +44 5371 +45 5450 +46 5529 +47 5608 +48 5687 +49 5766 +50 5845 +51 5924 +52 6003 +53 6082 +54 6161 +55 6240 +56 6319 +57 6398 +58 6477 +59 6556 +60 6635 +61 6714 +62 6793 +63 6872 +64 6951 +65 7030 +66 7109 +67 7188 +68 7267 +69 7346 +70 7425 +71 7504 +72 7583 +73 7662 +74 7741 +75 7820 +76 7899 +77 7978 +78 8057 +79 8136 +80 8215 +81 8294 +82 8373 +83 8452 +84 8531 +%% Object stream: object 2, index 0; original object ID: 1 +<< + /Pages 3 0 R + /Type /Catalog +>> +%% Object stream: object 3, index 1; original object ID: 2 +<< + /Count 1 + /Kids [ + 4 0 R + ] + /Type /Pages +>> +%% Object stream: object 4, index 2; original object ID: 3 +%% Page 1 +<< + /Contents 85 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /OtherStuff [ + 5 0 R + 6 0 R + 7 0 R + 8 0 R + 9 0 R + 10 0 R + 11 0 R + 12 0 R + 13 0 R + 14 0 R + 15 0 R + 16 0 R + 17 0 R + 18 0 R + 19 0 R + 20 0 R + 21 0 R + 22 0 R + 23 0 R + 24 0 R + 25 0 R + 26 0 R + 27 0 R + 28 0 R + 29 0 R + 30 0 R + 31 0 R + 32 0 R + 33 0 R + 34 0 R + 35 0 R + 36 0 R + 37 0 R + 38 0 R + 39 0 R + 40 0 R + 41 0 R + 42 0 R + 43 0 R + 44 0 R + 45 0 R + 46 0 R + 47 0 R + 48 0 R + 49 0 R + 50 0 R + 51 0 R + 52 0 R + 53 0 R + 54 0 R + 55 0 R + 56 0 R + 57 0 R + 58 0 R + 59 0 R + 60 0 R + 61 0 R + 62 0 R + 63 0 R + 64 0 R + 65 0 R + 66 0 R + 67 0 R + 68 0 R + 69 0 R + 70 0 R + 71 0 R + 72 0 R + 73 0 R + 74 0 R + 75 0 R + 76 0 R + 77 0 R + 78 0 R + 79 0 R + 80 0 R + 81 0 R + 82 0 R + 83 0 R + 84 0 R + 90 0 R + 91 0 R + 92 0 R + 93 0 R + 94 0 R + 95 0 R + 96 0 R + 97 0 R + 98 0 R + 99 0 R + 100 0 R + 101 0 R + 102 0 R + 103 0 R + 104 0 R + 105 0 R + 106 0 R + 107 0 R + 108 0 R + 109 0 R + 110 0 R + 111 0 R + 112 0 R + 113 0 R + 114 0 R + 115 0 R + 116 0 R + 117 0 R + 118 0 R + 119 0 R + 120 0 R + 121 0 R + 122 0 R + 123 0 R + 124 0 R + 125 0 R + 126 0 R + 127 0 R + 128 0 R + 129 0 R + 130 0 R + 131 0 R + 132 0 R + 133 0 R + 134 0 R + 135 0 R + 136 0 R + 137 0 R + 138 0 R + 139 0 R + 140 0 R + 141 0 R + 142 0 R + 143 0 R + 144 0 R + 145 0 R + 146 0 R + 147 0 R + 148 0 R + 149 0 R + 150 0 R + 151 0 R + 152 0 R + 153 0 R + 154 0 R + 155 0 R + 156 0 R + 157 0 R + 158 0 R + 159 0 R + 160 0 R + 161 0 R + 162 0 R + 163 0 R + 164 0 R + 165 0 R + 166 0 R + 167 0 R + 168 0 R + 169 0 R + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 89 0 R + >> + /ProcSet 88 0 R + >> + /Type /Page +>> +%% Object stream: object 5, index 3; original object ID: 7 +[ + /Object-7 +] +%% Object stream: object 6, index 4; original object ID: 8 +[ + /Object-8 +] +%% Object stream: object 7, index 5; original object ID: 9 +[ + /Object-9 +] +%% Object stream: object 8, index 6; original object ID: 10 +[ + /Object-10 +] +%% Object stream: object 9, index 7; original object ID: 11 +[ + /Object-11 +] +%% Object stream: object 10, index 8; original object ID: 12 +[ + /Object-12 +] +%% Object stream: object 11, index 9; original object ID: 13 +[ + /Object-13 +] +%% Object stream: object 12, index 10; original object ID: 14 +[ + /Object-14 +] +%% Object stream: object 13, index 11; original object ID: 15 +[ + /Object-15 +] +%% Object stream: object 14, index 12; original object ID: 16 +[ + /Object-16 +] +%% Object stream: object 15, index 13; original object ID: 17 +[ + /Object-17 +] +%% Object stream: object 16, index 14; original object ID: 18 +[ + /Object-18 +] +%% Object stream: object 17, index 15; original object ID: 19 +[ + /Object-19 +] +%% Object stream: object 18, index 16; original object ID: 20 +[ + /Object-20 +] +%% Object stream: object 19, index 17; original object ID: 21 +[ + /Object-21 +] +%% Object stream: object 20, index 18; original object ID: 22 +[ + /Object-22 +] +%% Object stream: object 21, index 19; original object ID: 23 +[ + /Object-23 +] +%% Object stream: object 22, index 20; original object ID: 24 +[ + /Object-24 +] +%% Object stream: object 23, index 21; original object ID: 25 +[ + /Object-25 +] +%% Object stream: object 24, index 22; original object ID: 26 +[ + /Object-26 +] +%% Object stream: object 25, index 23; original object ID: 27 +[ + /Object-27 +] +%% Object stream: object 26, index 24; original object ID: 28 +[ + /Object-28 +] +%% Object stream: object 27, index 25; original object ID: 29 +[ + /Object-29 +] +%% Object stream: object 28, index 26; original object ID: 30 +[ + /Object-30 +] +%% Object stream: object 29, index 27; original object ID: 31 +[ + /Object-31 +] +%% Object stream: object 30, index 28; original object ID: 32 +[ + /Object-32 +] +%% Object stream: object 31, index 29; original object ID: 33 +[ + /Object-33 +] +%% Object stream: object 32, index 30; original object ID: 34 +[ + /Object-34 +] +%% Object stream: object 33, index 31; original object ID: 35 +[ + /Object-35 +] +%% Object stream: object 34, index 32; original object ID: 36 +[ + /Object-36 +] +%% Object stream: object 35, index 33; original object ID: 37 +[ + /Object-37 +] +%% Object stream: object 36, index 34; original object ID: 38 +[ + /Object-38 +] +%% Object stream: object 37, index 35; original object ID: 39 +[ + /Object-39 +] +%% Object stream: object 38, index 36; original object ID: 40 +[ + /Object-40 +] +%% Object stream: object 39, index 37; original object ID: 41 +[ + /Object-41 +] +%% Object stream: object 40, index 38; original object ID: 42 +[ + /Object-42 +] +%% Object stream: object 41, index 39; original object ID: 43 +[ + /Object-43 +] +%% Object stream: object 42, index 40; original object ID: 44 +[ + /Object-44 +] +%% Object stream: object 43, index 41; original object ID: 45 +[ + /Object-45 +] +%% Object stream: object 44, index 42; original object ID: 46 +[ + /Object-46 +] +%% Object stream: object 45, index 43; original object ID: 47 +[ + /Object-47 +] +%% Object stream: object 46, index 44; original object ID: 48 +[ + /Object-48 +] +%% Object stream: object 47, index 45; original object ID: 49 +[ + /Object-49 +] +%% Object stream: object 48, index 46; original object ID: 50 +[ + /Object-50 +] +%% Object stream: object 49, index 47; original object ID: 51 +[ + /Object-51 +] +%% Object stream: object 50, index 48; original object ID: 52 +[ + /Object-52 +] +%% Object stream: object 51, index 49; original object ID: 53 +[ + /Object-53 +] +%% Object stream: object 52, index 50; original object ID: 54 +[ + /Object-54 +] +%% Object stream: object 53, index 51; original object ID: 55 +[ + /Object-55 +] +%% Object stream: object 54, index 52; original object ID: 56 +[ + /Object-56 +] +%% Object stream: object 55, index 53; original object ID: 57 +[ + /Object-57 +] +%% Object stream: object 56, index 54; original object ID: 58 +[ + /Object-58 +] +%% Object stream: object 57, index 55; original object ID: 59 +[ + /Object-59 +] +%% Object stream: object 58, index 56; original object ID: 60 +[ + /Object-60 +] +%% Object stream: object 59, index 57; original object ID: 61 +[ + /Object-61 +] +%% Object stream: object 60, index 58; original object ID: 62 +[ + /Object-62 +] +%% Object stream: object 61, index 59; original object ID: 63 +[ + /Object-63 +] +%% Object stream: object 62, index 60; original object ID: 64 +[ + /Object-64 +] +%% Object stream: object 63, index 61; original object ID: 65 +[ + /Object-65 +] +%% Object stream: object 64, index 62; original object ID: 66 +[ + /Object-66 +] +%% Object stream: object 65, index 63; original object ID: 67 +[ + /Object-67 +] +%% Object stream: object 66, index 64; original object ID: 68 +[ + /Object-68 +] +%% Object stream: object 67, index 65; original object ID: 69 +[ + /Object-69 +] +%% Object stream: object 68, index 66; original object ID: 70 +[ + /Object-70 +] +%% Object stream: object 69, index 67; original object ID: 71 +[ + /Object-71 +] +%% Object stream: object 70, index 68; original object ID: 72 +[ + /Object-72 +] +%% Object stream: object 71, index 69; original object ID: 73 +[ + /Object-73 +] +%% Object stream: object 72, index 70; original object ID: 74 +[ + /Object-74 +] +%% Object stream: object 73, index 71; original object ID: 75 +[ + /Object-75 +] +%% Object stream: object 74, index 72; original object ID: 76 +[ + /Object-76 +] +%% Object stream: object 75, index 73; original object ID: 77 +[ + /Object-77 +] +%% Object stream: object 76, index 74; original object ID: 78 +[ + /Object-78 +] +%% Object stream: object 77, index 75; original object ID: 79 +[ + /Object-79 +] +%% Object stream: object 78, index 76; original object ID: 80 +[ + /Object-80 +] +%% Object stream: object 79, index 77; original object ID: 81 +[ + /Object-81 +] +%% Object stream: object 80, index 78; original object ID: 82 +[ + /Object-82 +] +%% Object stream: object 81, index 79; original object ID: 83 +[ + /Object-83 +] +%% Object stream: object 82, index 80; original object ID: 84 +[ + /Object-84 +] +%% Object stream: object 83, index 81; original object ID: 85 +[ + /Object-85 +] +%% Object stream: object 84, index 82; original object ID: 86 +[ + /Object-86 +] +endstream +endobj + +%% Contents for page 1 +%% Original object ID: 4 0 +85 0 obj +<< + /Length 86 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +86 0 obj +44 +endobj + +87 0 obj +<< + /Type /ObjStm + /Length 7468 + /N 82 + /First 771 +>> +stream +88 0 +89 79 +90 242 +91 320 +92 398 +93 476 +94 554 +95 632 +96 710 +97 788 +98 867 +99 946 +100 1026 +101 1106 +102 1186 +103 1267 +104 1349 +105 1431 +106 1513 +107 1595 +108 1677 +109 1759 +110 1841 +111 1923 +112 2005 +113 2087 +114 2169 +115 2251 +116 2333 +117 2415 +118 2497 +119 2579 +120 2661 +121 2743 +122 2825 +123 2907 +124 2989 +125 3071 +126 3153 +127 3235 +128 3317 +129 3399 +130 3481 +131 3563 +132 3645 +133 3727 +134 3809 +135 3891 +136 3973 +137 4055 +138 4137 +139 4219 +140 4301 +141 4383 +142 4465 +143 4547 +144 4629 +145 4711 +146 4793 +147 4875 +148 4957 +149 5039 +150 5121 +151 5203 +152 5285 +153 5367 +154 5449 +155 5531 +156 5613 +157 5695 +158 5777 +159 5859 +160 5941 +161 6023 +162 6105 +163 6187 +164 6269 +165 6351 +166 6433 +167 6515 +168 6597 +169 6679 +%% Object stream: object 88, index 0; original object ID: 5 +[ + /PDF + /Text +] +%% Object stream: object 89, index 1; original object ID: 6 +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +%% Object stream: object 90, index 2; original object ID: 87 +[ + /Object-87 +] +%% Object stream: object 91, index 3; original object ID: 88 +[ + /Object-88 +] +%% Object stream: object 92, index 4; original object ID: 89 +[ + /Object-89 +] +%% Object stream: object 93, index 5; original object ID: 90 +[ + /Object-90 +] +%% Object stream: object 94, index 6; original object ID: 91 +[ + /Object-91 +] +%% Object stream: object 95, index 7; original object ID: 92 +[ + /Object-92 +] +%% Object stream: object 96, index 8; original object ID: 93 +[ + /Object-93 +] +%% Object stream: object 97, index 9; original object ID: 94 +[ + /Object-94 +] +%% Object stream: object 98, index 10; original object ID: 95 +[ + /Object-95 +] +%% Object stream: object 99, index 11; original object ID: 96 +[ + /Object-96 +] +%% Object stream: object 100, index 12; original object ID: 97 +[ + /Object-97 +] +%% Object stream: object 101, index 13; original object ID: 98 +[ + /Object-98 +] +%% Object stream: object 102, index 14; original object ID: 99 +[ + /Object-99 +] +%% Object stream: object 103, index 15; original object ID: 100 +[ + /Object-100 +] +%% Object stream: object 104, index 16; original object ID: 101 +[ + /Object-101 +] +%% Object stream: object 105, index 17; original object ID: 102 +[ + /Object-102 +] +%% Object stream: object 106, index 18; original object ID: 103 +[ + /Object-103 +] +%% Object stream: object 107, index 19; original object ID: 104 +[ + /Object-104 +] +%% Object stream: object 108, index 20; original object ID: 105 +[ + /Object-105 +] +%% Object stream: object 109, index 21; original object ID: 106 +[ + /Object-106 +] +%% Object stream: object 110, index 22; original object ID: 107 +[ + /Object-107 +] +%% Object stream: object 111, index 23; original object ID: 108 +[ + /Object-108 +] +%% Object stream: object 112, index 24; original object ID: 109 +[ + /Object-109 +] +%% Object stream: object 113, index 25; original object ID: 110 +[ + /Object-110 +] +%% Object stream: object 114, index 26; original object ID: 111 +[ + /Object-111 +] +%% Object stream: object 115, index 27; original object ID: 112 +[ + /Object-112 +] +%% Object stream: object 116, index 28; original object ID: 113 +[ + /Object-113 +] +%% Object stream: object 117, index 29; original object ID: 114 +[ + /Object-114 +] +%% Object stream: object 118, index 30; original object ID: 115 +[ + /Object-115 +] +%% Object stream: object 119, index 31; original object ID: 116 +[ + /Object-116 +] +%% Object stream: object 120, index 32; original object ID: 117 +[ + /Object-117 +] +%% Object stream: object 121, index 33; original object ID: 118 +[ + /Object-118 +] +%% Object stream: object 122, index 34; original object ID: 119 +[ + /Object-119 +] +%% Object stream: object 123, index 35; original object ID: 120 +[ + /Object-120 +] +%% Object stream: object 124, index 36; original object ID: 121 +[ + /Object-121 +] +%% Object stream: object 125, index 37; original object ID: 122 +[ + /Object-122 +] +%% Object stream: object 126, index 38; original object ID: 123 +[ + /Object-123 +] +%% Object stream: object 127, index 39; original object ID: 124 +[ + /Object-124 +] +%% Object stream: object 128, index 40; original object ID: 125 +[ + /Object-125 +] +%% Object stream: object 129, index 41; original object ID: 126 +[ + /Object-126 +] +%% Object stream: object 130, index 42; original object ID: 127 +[ + /Object-127 +] +%% Object stream: object 131, index 43; original object ID: 128 +[ + /Object-128 +] +%% Object stream: object 132, index 44; original object ID: 129 +[ + /Object-129 +] +%% Object stream: object 133, index 45; original object ID: 130 +[ + /Object-130 +] +%% Object stream: object 134, index 46; original object ID: 131 +[ + /Object-131 +] +%% Object stream: object 135, index 47; original object ID: 132 +[ + /Object-132 +] +%% Object stream: object 136, index 48; original object ID: 133 +[ + /Object-133 +] +%% Object stream: object 137, index 49; original object ID: 134 +[ + /Object-134 +] +%% Object stream: object 138, index 50; original object ID: 135 +[ + /Object-135 +] +%% Object stream: object 139, index 51; original object ID: 136 +[ + /Object-136 +] +%% Object stream: object 140, index 52; original object ID: 137 +[ + /Object-137 +] +%% Object stream: object 141, index 53; original object ID: 138 +[ + /Object-138 +] +%% Object stream: object 142, index 54; original object ID: 139 +[ + /Object-139 +] +%% Object stream: object 143, index 55; original object ID: 140 +[ + /Object-140 +] +%% Object stream: object 144, index 56; original object ID: 141 +[ + /Object-141 +] +%% Object stream: object 145, index 57; original object ID: 142 +[ + /Object-142 +] +%% Object stream: object 146, index 58; original object ID: 143 +[ + /Object-143 +] +%% Object stream: object 147, index 59; original object ID: 144 +[ + /Object-144 +] +%% Object stream: object 148, index 60; original object ID: 145 +[ + /Object-145 +] +%% Object stream: object 149, index 61; original object ID: 146 +[ + /Object-146 +] +%% Object stream: object 150, index 62; original object ID: 147 +[ + /Object-147 +] +%% Object stream: object 151, index 63; original object ID: 148 +[ + /Object-148 +] +%% Object stream: object 152, index 64; original object ID: 149 +[ + /Object-149 +] +%% Object stream: object 153, index 65; original object ID: 150 +[ + /Object-150 +] +%% Object stream: object 154, index 66; original object ID: 151 +[ + /Object-151 +] +%% Object stream: object 155, index 67; original object ID: 152 +[ + /Object-152 +] +%% Object stream: object 156, index 68; original object ID: 153 +[ + /Object-153 +] +%% Object stream: object 157, index 69; original object ID: 154 +[ + /Object-154 +] +%% Object stream: object 158, index 70; original object ID: 155 +[ + /Object-155 +] +%% Object stream: object 159, index 71; original object ID: 156 +[ + /Object-156 +] +%% Object stream: object 160, index 72; original object ID: 157 +[ + /Object-157 +] +%% Object stream: object 161, index 73; original object ID: 158 +[ + /Object-158 +] +%% Object stream: object 162, index 74; original object ID: 159 +[ + /Object-159 +] +%% Object stream: object 163, index 75; original object ID: 160 +[ + /Object-160 +] +%% Object stream: object 164, index 76; original object ID: 161 +[ + /Object-161 +] +%% Object stream: object 165, index 77; original object ID: 162 +[ + /Object-162 +] +%% Object stream: object 166, index 78; original object ID: 163 +[ + /Object-163 +] +%% Object stream: object 167, index 79; original object ID: 164 +[ + /Object-164 +] +%% Object stream: object 168, index 80; original object ID: 165 +[ + /Object-165 +] +%% Object stream: object 169, index 81; original object ID: 166 +[ + /Object-166 +] +endstream +endobj + +170 0 obj +<< + /Type /XRef + /Length 684 + /W [ 1 2 1 ] + /Root 2 0 R + /Size 171 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +stream +  +    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQR$Ï%4%HWWWWWWWWWW W +W W W WWWWWWWWWWWWWWWWWWW W!W"W#W$W%W&W'W(W)W*W+W,W-W.W/W0W1W2W3W4W5W6W7W8W9W:W;W<W=W>W?W@WAWBWCWDWEWFWGWHWIWJWKWLWMWNWOWPWQBÐ +endstream +endobj + +startxref +17104 +%%EOF diff --git a/qpdf/qtest/qpdf/good3.out b/qpdf/qtest/qpdf/good3.out new file mode 100644 index 0000000..7982e10 --- /dev/null +++ b/qpdf/qtest/qpdf/good3.out @@ -0,0 +1,6 @@ +/QTest is implicit +/QTest is indirect +/QTest is null +unparse: 7 0 R +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/good3.pdf b/qpdf/qtest/qpdf/good3.pdf new file mode 100644 index 0000000..068e796 --- /dev/null +++ b/qpdf/qtest/qpdf/good3.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /QTest 7 0 R +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/good3.qdf b/qpdf/qtest/qpdf/good3.qdf new file mode 100644 index 0000000..7b33f19 --- /dev/null +++ b/qpdf/qtest/qpdf/good3.qdf @@ -0,0 +1,101 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +%% Original object ID: 2 0 +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +%% Original object ID: 3 0 +3 0 obj +<< + /Contents 4 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 6 0 R + >> + /ProcSet 7 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +%% Original object ID: 4 0 +4 0 obj +<< + /Length 5 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +44 +endobj + +%% Original object ID: 6 0 +6 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 5 0 +7 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 8 +0000000000 65535 f +0000000052 00000 n +0000000133 00000 n +0000000242 00000 n +0000000484 00000 n +0000000583 00000 n +0000000629 00000 n +0000000774 00000 n +trailer << + /Root 1 0 R + /Size 8 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +startxref +809 +%%EOF diff --git a/qpdf/qtest/qpdf/good4.out b/qpdf/qtest/qpdf/good4.out new file mode 100644 index 0000000..7982e10 --- /dev/null +++ b/qpdf/qtest/qpdf/good4.out @@ -0,0 +1,6 @@ +/QTest is implicit +/QTest is indirect +/QTest is null +unparse: 7 0 R +unparseResolved: null +test 1 done diff --git a/qpdf/qtest/qpdf/good4.pdf b/qpdf/qtest/qpdf/good4.pdf new file mode 100644 index 0000000..326d542 --- /dev/null +++ b/qpdf/qtest/qpdf/good4.pdf @@ -0,0 +1,83 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +7 0 obj null endobj + +xref +0 8 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +0000000556 00000 n +trailer << + /Size 8 + /Root 1 0 R + /QTest 7 0 R +>> +startxref +577 +%%EOF diff --git a/qpdf/qtest/qpdf/good4.qdf b/qpdf/qtest/qpdf/good4.qdf new file mode 100644 index 0000000..7b33f19 --- /dev/null +++ b/qpdf/qtest/qpdf/good4.qdf @@ -0,0 +1,101 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +%% Original object ID: 2 0 +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +%% Original object ID: 3 0 +3 0 obj +<< + /Contents 4 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 6 0 R + >> + /ProcSet 7 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +%% Original object ID: 4 0 +4 0 obj +<< + /Length 5 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +44 +endobj + +%% Original object ID: 6 0 +6 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 5 0 +7 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 8 +0000000000 65535 f +0000000052 00000 n +0000000133 00000 n +0000000242 00000 n +0000000484 00000 n +0000000583 00000 n +0000000629 00000 n +0000000774 00000 n +trailer << + /Root 1 0 R + /Size 8 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +startxref +809 +%%EOF diff --git a/qpdf/qtest/qpdf/good5.out b/qpdf/qtest/qpdf/good5.out new file mode 100644 index 0000000..ff2e3fd --- /dev/null +++ b/qpdf/qtest/qpdf/good5.out @@ -0,0 +1,5 @@ +/QTest is indirect +/QTest is Boolean with value true +unparse: 7 0 R +unparseResolved: true +test 1 done diff --git a/qpdf/qtest/qpdf/good5.pdf b/qpdf/qtest/qpdf/good5.pdf new file mode 100644 index 0000000..0d9b55d --- /dev/null +++ b/qpdf/qtest/qpdf/good5.pdf @@ -0,0 +1,83 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +7 0 obj true endobj + +xref +0 8 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +0000000556 00000 n +trailer << + /Size 8 + /Root 1 0 R + /QTest 7 0 R +>> +startxref +577 +%%EOF diff --git a/qpdf/qtest/qpdf/good5.qdf b/qpdf/qtest/qpdf/good5.qdf new file mode 100644 index 0000000..e830781 --- /dev/null +++ b/qpdf/qtest/qpdf/good5.qdf @@ -0,0 +1,102 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +%% Original object ID: 2 0 +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +%% Original object ID: 3 0 +3 0 obj +<< + /Contents 4 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 6 0 R + >> + /ProcSet 7 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +%% Original object ID: 4 0 +4 0 obj +<< + /Length 5 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +44 +endobj + +%% Original object ID: 6 0 +6 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 5 0 +7 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 8 +0000000000 65535 f +0000000052 00000 n +0000000133 00000 n +0000000242 00000 n +0000000484 00000 n +0000000583 00000 n +0000000629 00000 n +0000000774 00000 n +trailer << + /QTest true + /Root 1 0 R + /Size 8 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +startxref +809 +%%EOF diff --git a/qpdf/qtest/qpdf/good6.out b/qpdf/qtest/qpdf/good6.out new file mode 100644 index 0000000..17b498d --- /dev/null +++ b/qpdf/qtest/qpdf/good6.out @@ -0,0 +1,5 @@ +/QTest is direct +/QTest is Boolean with value false +unparse: false +unparseResolved: false +test 1 done diff --git a/qpdf/qtest/qpdf/good6.pdf b/qpdf/qtest/qpdf/good6.pdf new file mode 100644 index 0000000..790f700 --- /dev/null +++ b/qpdf/qtest/qpdf/good6.pdf @@ -0,0 +1,79 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /QTest false +>> +startxref 556 +%%EOF diff --git a/qpdf/qtest/qpdf/good6.qdf b/qpdf/qtest/qpdf/good6.qdf new file mode 100644 index 0000000..c0c078b --- /dev/null +++ b/qpdf/qtest/qpdf/good6.qdf @@ -0,0 +1,102 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +%% Original object ID: 2 0 +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +%% Original object ID: 3 0 +3 0 obj +<< + /Contents 4 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 6 0 R + >> + /ProcSet 7 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +%% Original object ID: 4 0 +4 0 obj +<< + /Length 5 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +44 +endobj + +%% Original object ID: 6 0 +6 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 5 0 +7 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 8 +0000000000 65535 f +0000000052 00000 n +0000000133 00000 n +0000000242 00000 n +0000000484 00000 n +0000000583 00000 n +0000000629 00000 n +0000000774 00000 n +trailer << + /QTest false + /Root 1 0 R + /Size 8 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +startxref +809 +%%EOF diff --git a/qpdf/qtest/qpdf/good7-not-normalized.qdf b/qpdf/qtest/qpdf/good7-not-normalized.qdf new file mode 100644 index 0000000..eb5dbb1 --- /dev/null +++ b/qpdf/qtest/qpdf/good7-not-normalized.qdf @@ -0,0 +1,101 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +%% Original object ID: 2 0 +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +%% Original object ID: 3 0 +3 0 obj +<< + /Contents 4 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 6 0 R + >> + /ProcSet 7 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +%% Original object ID: 4 0 +4 0 obj +<< + /Length 5 0 R +>> +stream + +BT +/F1 24 Tf 72 720 Td + (Potato) Tj ET +endstream +endobj + +5 0 obj +44 +endobj + +%% Original object ID: 6 0 +6 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 5 0 +7 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 8 +0000000000 65535 f +0000000052 00000 n +0000000133 00000 n +0000000242 00000 n +0000000484 00000 n +0000000583 00000 n +0000000629 00000 n +0000000774 00000 n +trailer << + /QTest 16059 + /Root 1 0 R + /Size 8 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +startxref +809 +%%EOF diff --git a/qpdf/qtest/qpdf/good7.out b/qpdf/qtest/qpdf/good7.out new file mode 100644 index 0000000..ab14fba --- /dev/null +++ b/qpdf/qtest/qpdf/good7.out @@ -0,0 +1,5 @@ +/QTest is direct +/QTest is an integer with value 16059 +unparse: 16059 +unparseResolved: 16059 +test 1 done diff --git a/qpdf/qtest/qpdf/good7.pdf b/qpdf/qtest/qpdf/good7.pdf new file mode 100644 index 0000000..e5f2298 --- /dev/null +++ b/qpdf/qtest/qpdf/good7.pdf @@ -0,0 +1,79 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream + +BT +/F1 24 Tf 72 720 Td + (Potato) Tj ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /QTest 16059 +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/good7.qdf b/qpdf/qtest/qpdf/good7.qdf new file mode 100644 index 0000000..f7cdfe6 --- /dev/null +++ b/qpdf/qtest/qpdf/good7.qdf @@ -0,0 +1,103 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +%% Original object ID: 2 0 +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +%% Original object ID: 3 0 +3 0 obj +<< + /Contents 4 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 6 0 R + >> + /ProcSet 7 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +%% Original object ID: 4 0 +4 0 obj +<< + /Length 5 0 R +>> +stream + +BT +/F1 24 Tf +72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +43 +endobj + +%% Original object ID: 6 0 +6 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 5 0 +7 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 8 +0000000000 65535 f +0000000052 00000 n +0000000133 00000 n +0000000242 00000 n +0000000484 00000 n +0000000582 00000 n +0000000628 00000 n +0000000773 00000 n +trailer << + /QTest 16059 + /Root 1 0 R + /Size 8 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +startxref +808 +%%EOF diff --git a/qpdf/qtest/qpdf/good8.out b/qpdf/qtest/qpdf/good8.out new file mode 100644 index 0000000..e631e46 --- /dev/null +++ b/qpdf/qtest/qpdf/good8.out @@ -0,0 +1,5 @@ +/QTest is indirect +/QTest is a real number with value 3.14159 +unparse: 7 0 R +unparseResolved: 3.14159 +test 1 done diff --git a/qpdf/qtest/qpdf/good8.pdf b/qpdf/qtest/qpdf/good8.pdf new file mode 100644 index 0000000..6c60cde --- /dev/null +++ b/qpdf/qtest/qpdf/good8.pdf @@ -0,0 +1,82 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 132 + /Filter /ASCIIHexDecode +>> +stream +42 54 0a 20 20 2f 46 31 20 32 34 20 54 66 0a 20 +20 37 32 20 37 32 30 20 54 64 0a 20 20 28 50 6f +74 61 74 6F 29 20 54 6A 0A 45 540a> +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +7 0 obj 3.14159 endobj + +xref +0 8 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000518 00000 n +0000000553 00000 n +0000000671 00000 n +trailer << + /Size 8 + /Root 1 0 R + /QTest 7 0 R +>> +startxref +695 +%%EOF diff --git a/qpdf/qtest/qpdf/good8.qdf b/qpdf/qtest/qpdf/good8.qdf new file mode 100644 index 0000000..a8f5297 --- /dev/null +++ b/qpdf/qtest/qpdf/good8.qdf @@ -0,0 +1,102 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +%% Original object ID: 2 0 +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +%% Original object ID: 3 0 +3 0 obj +<< + /Contents 4 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 6 0 R + >> + /ProcSet 7 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +%% Original object ID: 4 0 +4 0 obj +<< + /Length 5 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +44 +endobj + +%% Original object ID: 6 0 +6 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 5 0 +7 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 8 +0000000000 65535 f +0000000052 00000 n +0000000133 00000 n +0000000242 00000 n +0000000484 00000 n +0000000583 00000 n +0000000629 00000 n +0000000774 00000 n +trailer << + /QTest 3.14159 + /Root 1 0 R + /Size 8 + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +startxref +809 +%%EOF diff --git a/qpdf/qtest/qpdf/good9.out b/qpdf/qtest/qpdf/good9.out new file mode 100644 index 0000000..75c40bc --- /dev/null +++ b/qpdf/qtest/qpdf/good9.out @@ -0,0 +1,5 @@ +/QTest is direct +/QTest is a string with value ¡Hola! +unparse: (¡Hola!) +unparseResolved: (¡Hola!) +test 1 done diff --git a/qpdf/qtest/qpdf/good9.pdf b/qpdf/qtest/qpdf/good9.pdf new file mode 100644 index 0000000..881392e --- /dev/null +++ b/qpdf/qtest/qpdf/good9.pdf @@ -0,0 +1,81 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /QTest (\241Hola!) + /Z ('žyÔãjø׸B^Q\n‹9”\rD|kã¢JZm:½l™\\) +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/good9.qdf b/qpdf/qtest/qpdf/good9.qdf new file mode 100644 index 0000000..94d4a0d --- /dev/null +++ b/qpdf/qtest/qpdf/good9.qdf @@ -0,0 +1,103 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +%% Original object ID: 2 0 +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +%% Original object ID: 3 0 +3 0 obj +<< + /Contents 4 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 6 0 R + >> + /ProcSet 7 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +%% Original object ID: 4 0 +4 0 obj +<< + /Length 5 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +44 +endobj + +%% Original object ID: 6 0 +6 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 5 0 +7 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 8 +0000000000 65535 f +0000000052 00000 n +0000000133 00000 n +0000000242 00000 n +0000000484 00000 n +0000000583 00000 n +0000000629 00000 n +0000000774 00000 n +trailer << + /QTest (¡Hola!) + /Root 1 0 R + /Size 8 + /Z <279e79d4051fe36af8d7b8425e510a8b39940d447c6be3a24a5a6d3abd6c99025c> + /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] +>> +startxref +809 +%%EOF diff --git a/qpdf/qtest/qpdf/heifer.out b/qpdf/qtest/qpdf/heifer.out new file mode 100644 index 0000000..ee55018 --- /dev/null +++ b/qpdf/qtest/qpdf/heifer.out @@ -0,0 +1,5 @@ +WARNING: heifer.pdf: file is damaged +WARNING: heifer.pdf (file position 92741): xref not found +WARNING: heifer.pdf: Attempting to reconstruct cross-reference table +WARNING: heifer.pdf (object 2 0, file position 51): attempting to recover stream length +qpdf: operation succeeded with warnings; resulting file may have some problems diff --git a/qpdf/qtest/qpdf/heifer.pdf b/qpdf/qtest/qpdf/heifer.pdf new file mode 100644 index 0000000..a3c6242 Binary files /dev/null and b/qpdf/qtest/qpdf/heifer.pdf differ diff --git a/qpdf/qtest/qpdf/heifer.qdf b/qpdf/qtest/qpdf/heifer.qdf new file mode 100644 index 0000000..0e20c93 --- /dev/null +++ b/qpdf/qtest/qpdf/heifer.qdf @@ -0,0 +1,1349 @@ +%PDF-1.2 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /Metadata 3 0 R + /Pages 5 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /CreationDate (D:20020815124312-04'00') + /Creator (Acrobat 4.0 Import Plug-in for Windows) + /ModDate (D:20020815124312-04'00') + /Producer (Acrobat Distiller 5.0.5 \(Windows\)) + /Title (geese_w-anchors.pdf) +>> +endobj + +3 0 obj +<< + /Subtype /XML + /Type /Metadata + /Length 4 0 R +>> +stream + +geese_w-anchors.pdf + + +endstream +endobj + +4 0 obj +993 +endobj + +5 0 obj +<< + /Count 1 + /Kids [ + 6 0 R + ] + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Type /Pages +>> +endobj + +%% Page 1 +6 0 obj +<< + /Contents 7 0 R + /Parent 5 0 R + /Resources 9 0 R + /Type /Page +>> +endobj + +%% Contents for page 1 +7 0 obj +<< + /Length 8 0 R +>> +stream +q +/RelativeColorimetric ri +1 g +/GS1 gs +1 i +0 792 m +0 792 l +f +q +3.617 790.98 608.383 -787.92 re +W n +q +610.995 0 0 789.113 3.0369 2.5269 cm +/Im1 Do +Q +Q +BT +/F1 1 Tf +16 0 0 16 112.495 255.964 Tm +/Cs5 cs 0.78 0.275 0.157 sc +0 Tc +0 Tw +<01>Tj +/F2 1 Tf +14 0 0 14 164.401 206.964 Tm +0 0 0 sc +0.0003 Tc +[<01>-219.7<02>0<03040506>-24.7<070406>-24.7(\b)0.1<07090a06>-24.7<0b0c0d06>-24.7<0e0a0a0f06>-24.7<0203090a0f06>-24.7<030f06>-24.7<1007111206>-24.7<0f0c130a06>-24.7<0e1006>]TJ +6.7492 -2.889 TD +[<140c1006>-24.7<050b030d06>-24.7<0203040506>-24.7<070406>]TJ +-11.7937 -2.4191 TD +[<0e12030f0206>-24.7<10071106>-24.7<15071006>-24.7<0c0d06>-24.7<030506>-24.7<0e12030f020d06>-24.7<0b07160a06>-24.7<0c0f1706>-24.7<0f071112030d0b130a0f0506>-24.7<05>0.1<0706>-24.7<0c06>-24.7<040c1303081006>-24.7<03>0.1<0f06>-24.7<0f0a0a1718>]TJ +/F3 1 Tf +9.75 0 0 9.75 101.201 106.951 Tm +0 Tc +0.028 Tw +[(Heifer International is a nonpr)30(ofit that alleviates hunger)125(, poverty and envir)30(onmental degradation )]TJ +-1.5183 -1.3026 TD +[(thr)30(ough gifts of food- and income-pr)30(oducing farm animals and training. These animals pr)29.9(ovide a sour)30(ce)]TJ +-0.7968 -1.3026 TD +[(of pr)30(otein, such as eggs and milk, for childr)30(en and generate income for families thr)30(ough the sale of animal )]TJ +0.5957 -1.3026 TD +[(pr)30(oducts. Since 1944, Heifer has helped over 4 million families in 125 countries become self-r)29.9(eliant. Each )]TJ +1.2818 -1.3026 TD +[(family Òpasses on the giftÓ by giving one or mor)30(e of its animalÕ)140(s of)10(fspring to another family in need.)]TJ +/F4 1 Tf +8.1749 -2.1231 TD +0.031 Tw +[(T)80(o)0( learn mor)30(e about Heifer, visit http://www)79.9(.heifer)125(.or)30(g)]TJ +/F5 1 Tf +16 0 0 16 48.2658 742 Tm +/Cs5 cs 0.275 0.275 0.471 sc +0.0002 Tc +0 Tw +( 666)Tj +1.9556 -1.875 TD +( 444)Tj +12 0 0 12 140.128 286.264 Tm +-0.0003 Tc +()Tj +-2.1762 -2.5478 TD +( wwwwwwwwwwwwwwwwwwwwwwwwwwwww )Tj +-4.6179 -1.9108 TD +( wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwwwwww )Tj +7.1656 -3.6623 TD +( 333)Tj +0.0531 -3.4502 TD +( 555)Tj +/F4 1 Tf +9.75 0 0 9.75 117.723 24.2689 Tm +/Cs5 cs 0 0 0 sc +0 Tc +0.031 Tw +(To learn more about the gift you've been given, visit http://www.heifer.org/gift )Tj +ET +q +375 0 0 375 121 317 cm +/Im2 Do +Q +Q +endstream +endobj + +8 0 obj +2338 +endobj + +9 0 obj +<< + /ColorSpace << + /Cs5 10 0 R + >> + /ExtGState << + /GS1 11 0 R + >> + /Font << + /F1 12 0 R + /F2 13 0 R + /F3 14 0 R + /F4 15 0 R + /F5 16 0 R + >> + /ProcSet [ + /PDF + /Text + /ImageC + ] + /XObject << + /Im1 17 0 R + /Im2 19 0 R + >> +>> +endobj + +10 0 obj +[ + /CalRGB + << + /Gamma [ + 2.22222 + 2.22222 + 2.22222 + ] + /Matrix [ + 0.4124 + 0.2126 + 0.0193 + 0.3576 + 0.7152 + 0.1192 + 0.1805 + 0.0722 + 0.9505 + ] + /WhitePoint [ + 0.9505 + 1 + 1.089 + ] + >> +] +endobj + +11 0 obj +<< + /SA false + /SM 0.02 + /TR /Identity + /Type /ExtGState +>> +endobj + +12 0 obj +<< + /BaseFont /KPPLPG+Times-Bold+2 + /Encoding 21 0 R + /FirstChar 1 + /FontDescriptor 22 0 R + /LastChar 1 + /Subtype /Type1 + /Type /Font + /Widths [ + 250 + ] +>> +endobj + +13 0 obj +<< + /BaseFont /KPPMKC+Palatino-Roman+2 + /Encoding 23 0 R + /FirstChar 1 + /FontDescriptor 24 0 R + /LastChar 24 + /Subtype /Type1 + /Type /Font + /Widths [ + 778 + 556 + 291 + 333 + 326 + 250 + 546 + 291 + 565 + 479 + 582 + 500 + 424 + 553 + 582 + 556 + 603 + 395 + 883 + 946 + 234 + 601 + 611 + 250 + ] +>> +endobj + +14 0 obj +<< + /BaseFont /ItcEras-Book + /Encoding /MacRomanEncoding + /FirstChar 32 + /FontDescriptor 25 0 R + /LastChar 213 + /Subtype /Type1 + /Type /Font + /Widths [ + 282 + 214 + 333 + 565 + 565 + 830 + 669 + 195 + 283 + 283 + 518 + 565 + 282 + 243 + 282 + 401 + 565 + 565 + 565 + 565 + 565 + 565 + 565 + 565 + 565 + 565 + 282 + 282 + 565 + 565 + 565 + 453 + 768 + 582 + 569 + 616 + 720 + 536 + 512 + 733 + 710 + 219 + 358 + 520 + 447 + 820 + 732 + 788 + 512 + 788 + 526 + 457 + 475 + 695 + 620 + 926 + 553 + 497 + 551 + 285 + 282 + 285 + 565 + 500 + 268 + 511 + 570 + 461 + 583 + 514 + 271 + 595 + 584 + 205 + 230 + 440 + 205 + 840 + 584 + 572 + 577 + 574 + 329 + 376 + 292 + 579 + 468 + 816 + 445 + 464 + 424 + 287 + 282 + 287 + 565 + 0 + 582 + 582 + 616 + 536 + 732 + 788 + 695 + 511 + 511 + 511 + 511 + 511 + 511 + 461 + 514 + 514 + 514 + 514 + 205 + 205 + 205 + 205 + 584 + 572 + 572 + 572 + 572 + 572 + 579 + 579 + 579 + 579 + 518 + 430 + 565 + 565 + 518 + 565 + 504 + 545 + 768 + 768 + 830 + 268 + 334 + 0 + 795 + 788 + 0 + 565 + 0 + 0 + 565 + 579 + 0 + 0 + 0 + 0 + 0 + 360 + 360 + 0 + 820 + 572 + 453 + 214 + 565 + 0 + 565 + 0 + 0 + 398 + 398 + 1000 + 282 + 582 + 582 + 788 + 1020 + 934 + 500 + 1000 + 333 + 333 + 195 + 195 + ] +>> +endobj + +15 0 obj +<< + /BaseFont /ItcEras-Demi + /Encoding /WinAnsiEncoding + /FirstChar 32 + /FontDescriptor 26 0 R + /LastChar 121 + /Subtype /Type1 + /Type /Font + /Widths [ + 316 + 316 + 389 + 633 + 633 + 883 + 728 + 212 + 351 + 351 + 568 + 633 + 316 + 261 + 316 + 412 + 633 + 633 + 633 + 633 + 633 + 633 + 633 + 633 + 633 + 633 + 316 + 316 + 633 + 633 + 633 + 494 + 824 + 695 + 651 + 649 + 752 + 616 + 574 + 759 + 778 + 296 + 448 + 666 + 531 + 880 + 792 + 835 + 587 + 835 + 630 + 525 + 555 + 752 + 695 + 1073 + 628 + 584 + 619 + 351 + 316 + 351 + 633 + 500 + 339 + 568 + 621 + 489 + 635 + 561 + 352 + 639 + 644 + 272 + 312 + 550 + 272 + 896 + 644 + 618 + 626 + 629 + 389 + 446 + 373 + 629 + 543 + 874 + 560 + 543 + ] +>> +endobj + +16 0 obj +<< + /BaseFont /Courier + /Encoding /WinAnsiEncoding + /FirstChar 0 + /FontDescriptor 27 0 R + /LastChar 255 + /Subtype /Type1 + /Type /Font + /Widths [ + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + 600 + ] +>> +endobj + +17 0 obj +<< + /BitsPerComponent 8 + /ColorSpace 10 0 R + /Filter /DCTDecode + /Height 790 + /Intent /RelativeColorimetric + /Subtype /Image + /Type /XObject + /Width 611 + /Length 18 0 R +>> +stream +ÿØÿîAdobed€ÿÛ„   + + + +     ÿÀcÿÄ¢ +  + s!1AQa"q2‘¡±B#ÁRÑá3bð$r‚ñ%C4S’¢²csÂ5D'“£³6TdtÃÒâ&ƒ +„”EF¤´VÓU(òãóÄÔäôeu…•¥µÅÕåõfv†–¦¶ÆÖæö7GWgw‡—§·Ç×ç÷8HXhxˆ˜¨¸ÈØèø)9IYiy‰™©¹ÉÙéù*:JZjzŠšªºÊÚêúm!1AQa"q‘2¡±ðÁÑá#BRbrñ3$4C‚’S%¢c²ÂsÒ5âDƒT“ +&6E'dtU7ò£³Ã()Óã󄔤´ÄÔäôeu…•¥µÅÕåõFVfv†–¦¶ÆÖæöGWgw‡—§·Ç×ç÷8HXhxˆ˜¨¸ÈØèø9IYiy‰™©¹ÉÙéù*:JZjzŠšªºÊÚêúÿÚ ?õN*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®ÅV°<ºü±UØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š´JŽ»b­â®Å]Š»v*êþ8«±Wb®ÅZS^ÔÅ[Å]Š»v*ìUØ«±Wb®Å]Š»v*×+A×®*Þ*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WUÃv*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]ŠµJŠñVñWb­+Wov*ìUØ«±Wb®Å]Š»v*ìU¡Zoøb­â®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»hV›õöÅ[Å]Š´ÄöÅ[Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»ZylÒqUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*¦ñtrHàI¨¦ã¾*©Š»v*±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»Z¥MhkMŽ*»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«@Ö£ÃoZ¨ öøªìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«_E:wÅ[Å]Š»v*ìUØ«±Wb®Å]Š»v*àkŠµ¿.»w«x«±V•1VñWb®Å]Š»v*ìUØ«‡LUN8!F‘£@­)å!„šR§TÅ]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUj’EH§¶*»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š­ïÓ犮Å]Š»v*ìUØ«‰¦*ኻv*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUÛÿLUØ«±Wb®Å]Šµ½}±VñWb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±W +Ó~¸«±Wb®Å]Š»v*ìUØ«±Wb®ÅVÆüÐ7µìz⫱Wb®Å]Š´@"‡¡Å[Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUÝñWbª²É,\¤^. R>F•ÈD¥_$‡aWb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®ÅZR§pkŠ·Š»v*ìUØ«±Wb®Å]Š¸N*ÕWøâ­â®Å]Š»v*ìUØ«±WöÅ]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*î¹UØHWaWb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®ÅZU +Žƒov*ìUØ«±Wb®Å]Š»v*ìUØ«»ÿ UØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±V»â«dr¼@Zò4'Ãß]¾*Þ*ìUØ«±Wb®Å\HqWb®Å]Š»v*ìUØ«±Wb®ÅTna2¢€x•uzÿªkLU[v*ìUØ«±Wb®Å]Š»v*ìUØ«±W +÷Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®ÅV’=öÅWb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®®*ê UØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ÐP #¾*Þ*ìUتЭ;Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»u7®*ìUتNJ7ûJ :W"b«•@ƒ$­â®ÅPwúmµè‹Ö.= XÌnñžKãÄŠlUŠ»v*ìUØ«±Wb®Å]Š»w~¿F*ìUØ«±Wb®ÅZf¢×ov*ìUØ«±Wb®Å]Š»XéÈ éBÞتüUØ«±Wb®Å]Š»v*ìUتÇb¨J‚Ä +…Oߊ¶­U„W±ëŠ®$ Î*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å\qWb®Å]Š»v*±Wb®Å]Š»v*ìUØ«±Wb®Å]‚•£…Zb¢•4®Ã]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*Õßov*êo\UØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb«YAÁê1W"ñ@µ­;œUv*ìUØ«±V»ôÛov*ìUØ«±Wb®Å]Š»v*ìUØ«±U¡TTŽýqUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»q½™» +Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®®ôÅ]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»Býv­‹QÈËNDh¹é•žªeHœ´¡¼PìUØ«±Wb®Å]Š»v*á^ø«±Wb®Å\EE1WWzb®Å]Š»v*ìUØ«±Wb«0€Óz’M}ñUø«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š¬‰c +Ç‘N­†%ˆ¡ïØü±!WaWb®¥zâ®Å]Š¸×¶*ìU¢h*{b­â®Å]Š»v*ìUØ«±Wb®Å]Š»v*ã^Ø«±Wb®Å]Š»Züø Øž˜ªìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®ÅV©$n)튮Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®ÅZD +¡GAŠ·Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®ÅZR{Šb­øŠŸ£Ü`VÚ´ØT⮩ñuö­â®ÅV…¡&§|UÌái^øªá°Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*´- ð8ªìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š¸Šâ®Å]Š¨ÃwÏ*DáÚá(²Ô CôiZ¹$8׶*·zÓµ:â­†´íŠ·Š»v* pn$WŒT/§%wb~ÖÝ€ÅUñWb®Å]Š»Zå«té÷⫱Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»w¶*ìUØ«±U…Àp»ÔÔôÛo|U~*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«…;b¨ M*mBòò6<¯xcíÊ5ãÈ|ÆG…$£òHhV›ìqVñU¡~C©ëŠ®Å]Š»hîÅ[Å\1Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*íë튴I¨ªÓ* D´A#ä)ýqUø«±Wb®Å\qWb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb­qø«Š·Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUتÞ\=> (±ÅWb®Å]Š»v*ìUØ«±Wb®Å]]銻v*ìUØ«±Wb®Å]Š»v*µMEiO Uw¶*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å\kÛv*âh*qWb®Å]Š»v*ìUتдëîqUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±V‘h´Å[ÅZ&ƒÇov*ìUØ«±Wb®Å]Š»v*ìUØ«±U2$. ûB›œUSv*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»i‚‘C¸=±VñWb®Å]Š»v*á^ø«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±U€¿#P)û&¸ªüUØ«±Wb®ÅT.`õ£ È ¨cÇb@5§ÓŠ«â®Å]Š»v*ìUØ«±Wb®Å\1Wb«\¤R: VC(•W± (AÄ*®v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]\UØ«±Wb®Å]Š»v*ìUØ«±Wb®ÀUØ…vv*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUÕÀmb­áK±Wb®˜ª×uD,ÆŠ:œ‰4¡pÄV…wü2JÞ*Òò©¯NØ«x«±Wb®Å]Š»v*ìUØ«±WWzb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»uEißÃv*ìUØ«±Wb®Å]Š»v*ÕEiôâ­â®ÅV¨§}Î*»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb¨yï- xÖi84‡Š ÷9 䢞z䉠Šo +»v*ìUJxRdàßf Ÿ£|‰¡Tb+²JìUØ«±Wb®Å]Š´¦¢´¦*Þ*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®ÅZÞ¿«ov*ìUØ«±Wb®Å]Š»pÅ]Š»v*ìUØ«±Wb®ô×Ôõ;ÓÑ×_Š»v*ìUØ««Š»pÅ]Š»v*ìU¡ZœU¼UØ«±Wb®Å]Š»v*ìUØ«±Wb­mŠ-¨ÜËn!tS*¬Ÿê·ÃúÎS’e²"ѹsªáºn*WÛ]Š»v*ìUØ«±Wb®Å]Š»wLUØ«±Wb®Å]Š»v*ìUØ«±U©ÎŸ+튮Å]Š»v*ìUØ«±Wb®ÅZ^]ñVñWb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]P1Wb®Å]Š»v*ìUØ«±Wb®Å]Š»p«±WÃv*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìU¢ |1VñWb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb«]U…ÏîÅWb®ÅVÑëö¶ùb«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUتɦœ5þ#mA ñŸ˜ªìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»uw¦*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«XR†Šñ$¼šØ) BÌzuéÞ’FȬ±5튻v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb« j€Ý϶*¿v*ìUØ«±Wb®Å]Š»v*ìUتÐ)_Ÿ|Uv*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUi`^ç§ÑŠ®Å]Š»v*ìUØ«±Wb®Å]Š¬«ó§‡ù«ü1Uø«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š­,¡‚×s¸,Uv*Ö6¶´( Hž§å‘áÝ$¯É!Ø«±Wb®Å]Š»v*ìUØ«·¯¶*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb­u\U¼UØ«±W}±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«LiÚ¸ªÕõPðÅWâ®Å]ŠµE­{ôÅ[5튻v*ìUƽ±W|ñWb®ùb®ùâ®Þ¾Ø«±Wb®=1V•h´Å[Å]Š»v*ìUØ«±Wb®Å]ŠµÄV´Üt8«x«±Wb®Å]Š»v*ìUت‹¼þ²*ÇX˜rV„ÛbªØ«±Wb®Å]Š´1VðZ» +»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*±}Q^T;íAM¾óŠ¯Å]Š»[U);žƒåŠ®Å]Š¸€zâ®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WbªIsÊñ+ƒ"}¤î>Œˆ’ªáV•Tt­â®Å]Š»v*ÖÜý銷Š»v*ê +×¾*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb«A¨þ¸ªìUØ«ºâ®Å]Š»k¿Ïov*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«\¾*b­â®Å]Š­å¹;wÅWb®ëÓv*ìUØ«±Wb®Å]Š»v*¤ÑBÎ%( §Ùjn1U\UØ«±Wb®Å]Š»ukßv*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ÓØWov*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*×*-N*Þ*ìUØ«±W UØ«±Wb®Å]Š¸â®Å]Š»v*ìUØ«±Wb®Å]ŠµÆ;õÅ[Å]Š»v*ìUØ«±Wb«JÕ­)ø⫱Wb®Å]Š»Zî‹ND +|N*»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«‰ ®*ìUØ«±Wb®Å]Š»Y$jåkÑ,U~õöÅ]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb«TMMA; Uv*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØªÞ Ë—zR¾ØªìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]ŠµŠ·Š»u:ûâ®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«Jj:SÛov*ìUتÊý5ü0*ü*ìUØ«±Wb®Å]Š»v*ìUØ«±U‹êónTáû$uúr*¿$®Å]Š»v*±Ä„¯Eý¯U~*ìUØ«±Wb®ÅZ&¾ìU¼UØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUg3êq§ÃJ×_Š»v*ìUØ«±Wb®Å]Š»v*ìU¥$ö¦*Þ*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«F½¶Å[Å]Š¸ì1Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*â*)Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±V'~Ø«x«±Wb®ÅV»*)cÐnqW+ƒÐ⫱Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUت›»+ [‘¡§aâqULUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUhêkóÅWb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUتÖPÊAèqUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUتÕUUt1UØ«±WUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*¥”;rpÉû”#犪â®Å]½}±Wb®Å]Š»v*ìUتœu”ö;|Žøª¦*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»u)ôâ®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š­f +µcAÜâ­ŠÆ*Þ*ìUØ«±Wb®5튻v*ìUØ«±Wb®Å]Š»v*ÕÞ˜«x«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»qìqV‘Vƒ¦*Þ*ìUØ«±Wb®®ôÅ]Š»v*ìUتÐZ¦£nتìUØ«±Wb®Å]Š»Z …ÜÔø⫱Wb®ÅV‘PGŽÛb«±Wb®Å]Š»v*ÒªŽ˜«x«±Wb®ÅZA°Å[Å]Š»v*ìUØ«±Wb®Å]Š»v*Ð` Ô„b­â®Å]Š»v*´²É§Ï]Š»v*ìUØ«±Wb®éŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»¦*ìUØ«±Wb®Å]Š»u7®*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb«T“]¨;b«±Wb®Å]Š»@Øêv·³]Á!%”¾ŒÁ…>*¨ñ¹$Ò:¹&6±$I+ÄÖ†‡æ1JüUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Šº•ëŠ»v*ÒòŠ»v*ìUØªÉ €Åji·sÐâ«ñWb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*¨®*ìUتЪ nzäDV×d‘MtÛ·Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®ÅZe®*ØÅ]Š»v*ìUØ«±Wb®Å]Š´Pj> +stream +ÿØÿîAdobed€ÿÛ„   + + + +     ÿÀwwÿÄ¢ +  + s!1AQa"q2‘¡±B#ÁRÑá3bð$r‚ñ%C4S’¢²csÂ5D'“£³6TdtÃÒâ&ƒ +„”EF¤´VÓU(òãóÄÔäôeu…•¥µÅÕåõfv†–¦¶ÆÖæö7GWgw‡—§·Ç×ç÷8HXhxˆ˜¨¸ÈØèø)9IYiy‰™©¹ÉÙéù*:JZjzŠšªºÊÚêúm!1AQa"q‘2¡±ðÁÑá#BRbrñ3$4C‚’S%¢c²ÂsÒ5âDƒT“ +&6E'dtU7ò£³Ã()Óã󄔤´ÄÔäôeu…•¥µÅÕåõFVfv†–¦¶ÆÖæöGWgw‡—§·Ç×ç÷8HXhxˆ˜¨¸ÈØèø9IYiy‰™©¹ÉÙéù*:JZjzŠšªºÊÚêúÿÚ ?í¤iv*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»A~›Ñ¿å¾ÛþFÇýqGwé½þ[í¿äl×âý7£Ë}·üúâ¼Aߦôoùo¶ÿ‘±ÿ\Wˆ;ôÞÿ-ößò6?ëŠñ~›Ñ¿å¾ÛþFÇýq^ ïÓz7ü·ÛÈØÿ®+ÄúoFÿ–ûoùõÅxƒ¿Mèßòßmÿ#cþ¸¯wé½þ[í¿äl×âý7£Ë}·üúâ¼Aߦôoùo¶ÿ‘±ÿ\Wˆ;ôÞÿ-ößò6?ëŠñ~›Ñ¿å¾ÛþFÇýq^ ïÓz7ü·ÛÈØÿ®+ÄúoFÿ–ûoùõÅxƒ¿Mèßòßmÿ#cþ¸¯wé½þ[í¿äl×âý7£Ë}·üúâ¼Aߦôoùo¶ÿ‘±ÿ\Wˆ;ôÞÿ-ößò6?ëŠñ~›Ñ¿å¾ÛþFÇýq^ ïÓz7ü·ÛÈØÿ®+ÄúoFÿ–ûoùõÅxƒ¿Mèßòßmÿ#cþ¸¯wé½þ[í¿äl×âý7£Ë}·üúâ¼Aߦôoùo¶ÿ‘±ÿ\Wˆ;ôÞÿ-ößò6?ëŠñ~›Ñ¿å¾ÛþFÇýq^ ïÓz7ü·ÛÈØÿ®+ÄúoFÿ–ûoùõÅxƒ¿Mèßòßmÿ#cþ¸¯wé½þ[í¿äl×âý7£Ë}·üúâ¼Aߦôoùo¶ÿ‘±ÿ\Wˆ;ôÞÿ-ößò6?ëŠñ~›Ñ¿å¾ÛþFÇýq^ ïÓz7ü·ÛÈØÿ®+ÄúoFÿ–ûoùõÅxƒ¿Mèßòßmÿ#cþ¸¯wé½þ[í¿äl×âý7£Ë}·üúâ¼Aߦôoùo¶ÿ‘±ÿ\Wˆ;ôÞÿ-ößò6?ëŠñ~›Ñ¿å¾ÛþFÇýq^ ÚëKž)}` Jc× â è½>£ýù¿Ó:ßóGÈ4ÓcKÓå–ûµþ˜/ù£äK†•¦ÿË$ò-?¦Ëãþhù-7ú/L±µ‡ŠŠ“é/A¹; /ù£äv`>aóî›bZçLÒìî4ÈøÆ÷w#S)&»ÔqTo˜™ÎòçÒŽ8ÓÒQæû9€_„×~ôé–c†3)F?gØØhâNN¦‚A³€ÔzIý2ßóGÈ2áoôF—ÞÎÜ{zIý1ü¾?æ^ÿDiCþ<íÿäRL| Í ¼-#Kÿ–8äRL>?æ’Ó†‘¥ÿËò)?¦Ëãþhù!„~bk«¢Ïi§é66qÝÊY&–z©'ŒQ§ˆµ'¨Ê3ÇÇ‹ÜÔA2Ûéoö%æ2\[ýXy~ RþÌL¸Vþ†ÒiþñAÿ"“úcùx4|–›:F“×êP|½$þ˜/ù£ä‡ Iëõ(üòOéƒÀÇüÑò álhÚNßè0oÿGý1ü¼?š>KNý ¤Ë ¿üŠOéù£ä¼.ý ¤ÿË ò)?¦?—‡óGÉi±¢é;ÿ Áÿ"“úcàcþhù#…ß¡tùaƒþE'ôÇòðþhù-;ô.M>£üŠOéåáüÑòM;ô6‘ÿ,0ùäŸÓÍ$S¿BéòÃüŠOéæ’x\tm"¿ï ò*?éåáüÑòE;ô.‘ÿ,PȤþ˜øÿš>KÂïÐÚIÿ()ÿSúcùx4|–úIê, ùzQÿL| Í%áhhÚM?Þ>~’L| Í%áwèm#þX`óÅ?¦?—ÇüÑò ÂïÐÚNßèPȤþ˜þ^Í$ÓGFÒåŠùŸÓåñÿ4|˜Ó_¡´Ÿùb‚½¿vŸÓËãþhù&›ý¤õúŒðô“ú`ü¾?æ’Ó_¡ôùaƒ~þ’L?—‡óGÉh5úJÿ–(?äZL/ù£ä¼.ý¥Ëò-?¦?—ÇüÑò^¿Di_òÅËÒOéù£ä–¿Di_òÅoÿ"“úcù|Í ŽÆ‹¥³qvâ•%š8ª¨«36nN'1ü#ä´òMkób9µ§µò—–âÔt˜\ÄuY-$”NèO&…P*öÚ­\ÁÉ“5ñɆ’Rè~ óɺ†‹æ] _:{¸d6Ú•¡Ž2aœÀtèèC‡¦eã†)‹ ãÊ$ƒÍ;:>—ÿ,pùæŸÓ,ð1ÿ4|ƒZt}3þY!ßþ+Oéåñÿ4|“M®›§£’–°«TŸMz0£N>?æU_JBH¡Ûc^»xåÖ•n즔ÅÌ2L¤©‰dRõ´¥k\Bê؉¯ÄíürLÐúœ·0ØÌö¼ÅÛ6î‘4Åem˜Ô¿ ‰•¨s/Ôã¶:›Èú•Í¶¡o:4’½¤7‹pMˆäI[‡Ù *ô1hýöz}9!øütež.\<ºnI{zÝ\zfv©“ѱԒG“÷ƒcû]ó6Â-œ†ë©“UÀbŠvÝ1JÜïm•-¤ºrÊ‚(¸ò«ÅÊ€¼ºŸÃ"eA¾ƒô~>÷‡y‹Ì·ÚÏ™n"»¹»’ÖÒåik¥ˆHÞ‚xÇÛað‰8×Ç0sNfG»ñöµâqW㧒ëø|Ùyf×Úu½ôúµÄ¿X’óÄvêï*_ÓåDUFaÑ@§L®s2º¿Ç._gsd±¼‡ã¯?·½ ¡éïw :¤R}nkò,“K}–憊@xë¶Þ£0é±ï‚Žê\_Ž~OvÑt8´{­–9b”Ÿ†[©®Än©¼Q4§hիǹï\ÎÄÿ&ÙÃö£©¶ùc]ߦ*ê +⮥:ý'll}†*Õ?Ìâ­Ðtû±Zu1M:”¡ÔéOŠiªn6öÅ ë㊸÷Ëu+×æ6Å]M«Š´Gá×犺‡éÅiÀ}Ø«TÅZ¦ÞÕÅ]LU¯£j›ä•Ô5é×hß犼çóÇ^ú§–­¼¿Ïטæ4‘m¡e{†Û¨+E§zæ.§%F›°BËÓ¥¿±Ó–+ìÚÊÙ’ÞÞÙg>«D–bÌ# +ÔýŸçæ;ÛÑÊ1Ú«¹•~OfÿI ¡½]Zñ- +¥-Wzb*<3y ‡A®ß1z úæ{ˆ°Œ)k‰¯O–*ò†ü´ó|×ú¢Ã“M%ÉšId0·Ãj¼[í?!˜RÁ##¾Í#­ÿµŽYy'ó]F;5Õ»JÒQ³1‚²I !Жû>Ÿ2À£ÀŸsg«×îz·”¼ï¥ùž)V0m5{`¡¦IQ$geæ +xíÕzÍÛ‹cÍ–üÓë…•­åX¨$d!APÕ>X¨?I¦^ÆCgùëTú¶¥oÕÍÖžn.m”éó-TÇÄŠ kcêÆY¸°vaÓ~Ù…9üÚˆ€eGŸõ¼¶î Ò,.¡×Ä1êPAwë´ºlWwj©YŠ=&Œ´–åw?|]J•oƒøý(…~¿Çâžý§ÞCr­wPÞzƯsÂÎîZ 4¼Y¸×ß}†fã&€l≺䊧ÜrÅlW·õÅ[ú~œ +¡{ŸOº€Êaõa‘}phcøIæù4ùã¿Nl'\&þ—ùÂíZù<¿yòY¬2K©ŸT°‘Èp‹P}Gßö©üÛw×Ký­`Eí´n‡ãÉiçï0~†K›}L¯˜`I'ŸP½½‰ãõI~fÞ¢hÈVBœ•¾.í–Ç)"ºýŸŽi•q_/¿}¶û é&Ö<Ûysn&¶Iá­ÔvˆžˆUU«j‹ËŸ"ëûGuÊ¥¹ØtþÔ±·´þ[è×Öñ>¬u™õ +ØT}^y’ä³ áË"ðtP‚Š’/ ;õ˱  í_ŠeD_ÀfžÇ2UvõññÀ®¦œˆ©ÜŽ¿~¥+I%xË;e’Dû!OîÜZmör ݤŠV>»d¸ ÁëŠÓ€û·Åi®>;b´ê~8­7CN½ñKT ÅßÏüÆ*íûôÅ\@þ¸«Fø«_NÕÅ]ú»b«H©§Søâ†ÎçµïŠ)£øý;b­šý=N*ÑvúqV¨~ìUÄ~8ªÃ@ ;79%y¯ç?“Τtß0C4ÑêZ ++ÅfÐs·š æÛ”…“¶ü½KÙT#ª8¥Û¯á˜xtâõr5¯oáîýl‡„Ø%µÊ¤ð–v• +™‹³ gâm©™"$¹¸†É,bòÛê×RÀ eFøþÒ0ä§î9— X¶’)Güü2h¥§ ððÅ/;˜—JD²@…>¬T@Ÿ½ÐÝdF4<~ÆaÇS¸ÛÞÑ,§zø1“ç-Yõ¸5Y¢Ô«L#RK~a‚2ƒÄŠ +þ¼®YdM¬%BüÃ-‡ó)EäßZ´AlÄU‰Èm¯Úå»æéóˆ£ÇãÜ‘—Ÿãñæ²Ïó6O_ý2M¬Ž´(Ä2! <7<¿ÙwÁù“|¶üsXe?Äט<É \êq¼ÚÖa¶õÝÔ„™äp /' G““pèMK&Hšµ9H69ï_¬ý©.§hÚ”÷ó^¬Q]G5­Æ›w"ˆfy%b“C$z'Ó®àД;zoŠDŸÁl‰ë}…é‘jºwI§AÒüÁ¢ê¥†Ÿyé–ôܳ +Ž*ôcô 1È&Ñ QÊOvjP04Ünù+eKd¹¶‰¡I¥HZáŠ[¬¬Èê§*r?,lU±$îWÅý*,‡ñ~;ÓÓñÜ«nTKvõP­:ž~<¢Zoßa‚?QIä\ÝÛZÁ$ÓIÂ(©Ì€XÕP +Ô““$ ì„O0h¦Ù.í!VBþ”ß‚ŒW‰Mêj½› L€C7<¶±ú‚éÆc é° Ng Oøde’"ì„  ¤·ÿš|gi_IËŠHî"GZÉh:V½iü3&®1ä-1$û¼ÔbüÃ[ýÒ'³Öäš'†¨N!;£µXÈúzåpÕGÔNÝÉÉt[ßÝv¥­]ézÎ¥6©hâ™P*¿Q @§Ý~SôŒÄÔÈØîvÚ?V0|Ðí¯ÅÆ%,V&¾äßÛß®QnWO¼Ÿsgi%ûI"[BÐÄß¼p íRùüó3G '“…¬Ðì®IbŠ&šI"UäұˑcM©›;n¾”ä½²Ž(¥’æ$Š`Z)ZE +À/2Tôû;â òbd5¶,°=ÒÑÝÍ$±È¿e£JEàB~9oeœº*´Ð¤‘Ç$Š’IËÓV!Kzc“Ò¾ ×&ÂÔþ½aÍã7Púˆž¤‹ê%Uí^›bŽ!Þ²çTÓmnb·º¸H¤™]âg4Ž‘z‡á~•®6¦@snMKK’^À±°%]¥J0SŸšïB)ŠñŽö†±¤µ´×+{[ÁžiUÁ û,i¸­6Æ׈7§¦Í*CÔo4‘¬©oÓeæ¯Uñ¦*$_êú^šœï®£‡nJ¥ªì¨*‹V51S0ïh“ÔA¨A!²ãßü‚9bòG‰õ‰æBDWk#/:ª#·÷oÁ»7ß„ G[˜´9îšÒ+ÔúȨ¿$äV•àXÜk¾5½/ˆÑOÓK2$³AÄM0fNb«È +Ò£@Ù ´\[1@²ÆLˆdŽŽ§’-y:ïÐxâ¶J?éô÷Å(}Bò )o.‰X ^L@©>}ÉÀdÒËcÓõÉ'’dŠ @„ÉqÅcwegÅ @µø›âÈ‚6F9qH›=V{m z‘ZÆYã*© ‘Ûaʼϼ¹¢¹PÜ—2Q¡L¥g.ü#u2*4Ž¤ÐÐR¾ÃvŨ—ÙÞA4'‘ -y+nÊ<0¦$§Všåµ[ggXíšô£Þ¬Cªõ¥·|æÛ8Pú©,ðÉãBGù Qø6dcêÑ”n5Þ›å¶ÕM7ØñÅ/¤žÝ-#d’X×—1©]¨+E¥â“Q†í›ˆŽ§’‡ÁÌ:qN;V0q RãjU¸´J£‹9û\wûLR´öÂ$X˜*+Ù^U⣓:°UAMÊufåL>$»—†š›P²’1ëÌ)’;€üÊì´¨eªuÂ&B z(0ib‰î•L¡½¼Èj|5qAÁ=Û) ÙpmÉQuËf`Í"Ps¨øPßå.ßÑÉŲºýP3\=ËšŽ²(]RzQJþAîdp¿ÔÓã.>º£Õ ÂN4QAPyWjûoÛ"y0àÛ/6:Y&³¸xýHÊ»)O²ÜGVVä+Ó®ç˜6ÈC˜äÔüÔ·Ý\Ï5À«@F'#5ø>#SOÃ%<²—6QÍtÿ˜š­ÍÜ7m{_ 4á‚° +8+M¤ããã„gžÌü3d ¼Ãç&ÕæHîµ G+‚)8¯ _Œòb@«ø׶øÏ<ååA#æúþ>K-üѨÚNaU)o]ášgy *‚{m•ñʹ–FI…Çæ½wnðê#×øÜq< +Ÿål2G,ÿ³ ºË^¸{Å +=xÊbãû°›2³NMü2³–c«t1’”ë~hF½[[{ˆ Å9Jü“Ó†#ñUªÝwí¾Gy,eR¶“EDS‰ƒAyœ2í ;EˆÒØú¯îRYíÙ‘ÖÓÓ••Ü€U£’¡ÔŠu*~ŒF¶#ø~ÖRÓžðŠ{ëgÒmôùaybF˜ Ü3siñ.ËBv²_}%–#få¿I.Zá  xzqC"ÆÑFµcð­ü›—ûxN»þÃÀŸx´Lhp¥¤P·DŽ&fHØ°Šž˜‘ˆø»õÂ5¸ÿ˜X˜Lr)a¾e’w@ÒMv®—S3‚ïêW–àøm÷aüüG(›bp“Ì…·iÓ2JÖÁY*¥ªœQxÍAAô䥭ÆhѾæø[žê &ŽXáônb+éÍ +~ mÁÉn>` +GcHÈuK +ÎËÇê·!!–¡h~!ܵrÈkqÙéðe,RîÝ«‹Ëid[‚-®¼y(b¦N+Ö§†Z¼w±ø€Ã†Drn×QŠÌÑ<¶ò´ÆG‘PÇÅQŠþÂ6jq’OͶù(Â`ýÚJœãŽÙ­ã‹˜(=Gv“ˆ#jß<6+æˆN¹uW±½žÖ脺»¹2¢¢‰$$hOIYƒ=g¶OÆ„ üÓ 9¸óî·jZÅÚè×>´s\³ÂÊñÄÄm²¯ù Õc”i³ò¹a¹3 ,ÊV¶÷#e½‘ 7oC(–#ÃÔ£*ªï²¨¦cž{9x€:Z]¤ÛÞ…¹½H^3<ËêK-ã• +7éQÛõäá´o½œ÷“.Ñ`™®žç„ „1 ®seßèúpÂföXÊ-®ÀF +'+° +þ#·^øm—0•j×·CÌÜ%g{{[(ÞÞ¢‚G’B‘OåP«ý¹Uú›#Jÿ:ÝM§iÚ}ÿ}y£—¥WœjꬠПݜÈÄ}Dç9ÚÇ{—_™MÝQ¥>€3&«ÞÑÅ}êM«Éê/+©ˆ­A­ð>ø‚ þ³ÎSHÑŒÂf¶uqûLÒ€)ÓnT9ÌñžöÿÊLÿñ¡h/0–HKQÉæëCÄ°-ñuÁÆ{ÓùIÿ8|š“Ë>^’#êB²ª’[”²ÕX-Zª·l|SÞËÌù)'–¼±fŠÒ5$™*“º=O~\ê>$ûÐ1Hìf²- A<ߢmRG¥dy‹Ÿ† nI*wÄÎ]嘀ïtžYòÇ6žçM¶û—gs õýåÓ[ÛH’ÜQ— +À…â#VÂpÇâ'’EÌðÇ™óü}¨ÿ=ùïKƒN ¤Þú×nñŒ¨ÜyêÇÔ:Ž4¯z`–qÁÅ‚L2D†è¯.ÛMe¦ésê%¼f(ÄvI$’F>£–_Œrøþ¯2qH=íiôífö`¿;z»Ò:**€ÆAUSA’²‚…6ã÷EV 'šJsPÈ¥ +Õ~~=pVìøöCëZšÃ®é¬-âr-d Ry#«Ž<@*^{ßÉ«)MµìNìǯ6h‰õo”jÉ°YiáL‚/gœ}f@(]¼¯lÖñ[ŸàÄtYêžä×èþ˜‰Ÿ +=ÈK+Ù^,Ö³™–DwXàk¥˜€6 8mÓî˶·_‹ ÏÞ…Ô¼¥i:ÜO0E"’<¬$Uè{rcZq¯^žøÕ2–ó(M#Ê w1‰X­âážCNM]ö¯!ôãv±À +ilâ”<Ò\͇GŒJ –)((LÄ:îzm¾_ÊE§ù "’æÑgŒž&[ɨjGÂß÷n?NPÁÐ/·ò½•„Ô])eµ˜°õÙ„ñ©~›•ùk¶ F÷gF<‚2×Ë6r#Ëk*]Bü„ dxÅ£«òÜ¢™@ +@Ä4ÿÒ+£¨RAúŒ€  ª9ÐŒk½l](Äþ]›T6·€A4$£$¤£ðèLmF¯Åô4ÆâK"Òô-,•I¤Éê”·œT¼]Ð VŒ§áø}²ÈÄuMR>÷ɳ\j°êsêHð/¥è© Œ-d5©1O–NXÉêÀwÕ†^ùgÔ¦Ól¯‹w§ÌÞ¡9ÅqË÷±.úòŒôß*‘¢Ó,àºMü½ªÈÖ×¥ìd‚ä:$ÑËéMõˆˆåOP…‘\0Ý|EW$!–À7?ŠP›WÒ¬u™-¯^k jM¤nìCMPXƆŠéQ€ÐrÀK„ýIíö§¤iP¢‹yî2a[[TÌ=¬ŸÎÞšý?Fù+ˆlœˆä/ܧ¡]èzÌ qœÖSxÜ$nŒH*ä‘]ê¤)4Èñ@ì˜ H RJµ‚-.ìD†ÎâUž#m«;˜Õd!™Ù!b¨üÑý“¸ÄeŒqzv'Ïu¬´Ñ6³f·czèv÷*òÚËz~¼R)¥ÂÈ´­G*V¢¹ 6èÈÂg ýIÏ-.Õ‚XÚ¼ºi¢—Oeõ"`d4çU? +ü[.݀ɜ‘™ŒrKN“e$×M×½D|Ùäh@£ò‹à‹#r^ûwn‚ÉÄ`6I]£Gæ}:Þk3uss`ò3ÚÈÅm®cVQÁĵ47qð2õ^ØŒµÉ—$Q*Ó&­wjSR[?^Uá,±•‰f@A<㣞ü +øâs2ü½Š–íiÉw¦I!†â#¸q$è$šUÇðòt4#í0ëÜo¼û™ÇŠÝKHÐuq!Ô£Žà:ݬb 8“º°‘J“]ÎÿF@“v˜Dó`ZŽ‡å=;QXô»ÙnÝcdœ;stŽ¤ñiP˜d¡é°o³ÕÕ§ƒªDÅõ1¤" +Ú¾9 +-¶)³6œ²‚–à)ƒ É¡­7ø°€Pgt—±˜Â[ÙC;Üʤ¯ÅØ×{XŸtC­â¸6â1AⱯ§¹,x¡¯Ù8’¾!¤DrjP–T’¤¯ÂG*îh¢€a´Jsb¤ln® DÒÆÌ}XA!Z»U¼rBú5ñE·—u ŸÔ˜H øT@©Z„ÀS,¤y³.v˜§•.¥dFfôWb¤vð¡9ltÒS0Œ²ò´NÕ‘GQAJS‘?å“–CI|ÐrÒ"ÓËÖþ¹NFq·Ú#¯Ë.Ž–6ÃÅ!m¤ˆ¡˜ª€Á§â8Šî(™d0€^-gYåãU”*” +íË&#¹E¢-¬î?zd•ž¦Š*E6§l”Açh4żçæhôMBÚ(¸´âfÕâe’o«TÇ ¢þíd^UÜ€@4Üæ·_rôƒðós´YM‘ñòc~g´X¯¦Õ®îîÌw\Fámd‰Ôp¹æ9¯§¿Úñ#01Xy'Y(Ê|C»›*Ó¿:,ôA7—¯/¤Ón­Lksõë)d·žF‹Æöí3­A§'@{æâ¢@§ˆçl½?1|‡sQÁæ=x¤ +~¯úJ(¦æEjž±J·FË8Å¢Ó¸ò{e·½›î"Ræß­UÃ@ìÃ~­·0.í”H)6¿Yµ.ÝP4ê”T°+@”tßí}9Xr =ÞŒó%­ßøS†PìÖñ¤ˆÌœc•%ø ê „ýôÊuTq”éèe,bà"½Cl7÷횧d·â-Ä¡¨5»S¸«_2%®¢²ÊÍn×-Å&åÀ-*+ÉOW;ïÔf_Û<Î3ê»f¼Ú¦Š$µŽãP*þŒGx¸nÊÈ8—ïû9e’2”Aˆ-ÛÍæ:Ék ‰ÈZ2‡Ž­B´‘I¡Û½7ÀÕ¢6¶y ä¿Vš6Hs4¬`õVJ•ëÓ$2lìxUžîÝ%lH`6©®Äáñ86·M; oåš³úvòª—‹aEVˆ•r;6Ƙ™ß0±ŽÜ÷PKc®ÏªÙÝú¶wpÒK7 ¦s§/zõÈ™uê‘ +%[S‡KÕ>«ªÚÆ‘êö©‘H3|>›²rMzøtœˆ8¯qÍtÐCªZÖþÂ5¼‘8HÜy¨?²Uä¥_o ‰ÞËÃK´»1Y™êåoQ#hä—KʨÅ4¢ +0ÿd1ñ7ÙF29ª_Iæ3s§JŽRÞÞW’b&PLoP¬)RðÇÄÛ™AÄx†Á ¨ùvËXç½¹Ž;Õ"ºZúéS÷n6W_åÈñOd(—[ùOËööæ)£†id!®) ¼rH›$ÔbËû\z÷®"Èa€CäˆÔôÍ&øÇ%ðk©`d0»"$Š Y ßÙäÊQ‰æ¥tš@šYm^D€äPÖ³'ÅÓ·Qˆ%d#½®±»´ú½·ÕÉõwv•Ç)±4lM¬e©¡/Ä°ðB¤W„@ñ"»€¦4SÄ¡Ö'¼-ßLNÒ?[ƒWz˜Ã*oÔ±¦<%‡Œ:"® ó¢£Ok<¯ÀŒÊéFÿðý=r^S–ù%'Ua,°›ƒ/¤¹DŒô£(åÒ‡Û:£Ä>jv3ß\‰e`‚8I£¯ö˜OýlxäÔ“Õ`[¹f‘¶yMQC>QÑ@ĈòS´‘£3¸I^‘rRÀq5/¾DÉ0‰KõØïï4û‹PT<1qZ !Ëq c-Ø䌪ÊOo`Ü6P'ãFTÛo +{W “TBem£Þ²úqDJò,[¸íÐ{a'f ÚÓÊws02(UUûLEzצ]O90–@o(:3s‘xžÃ-ŽŠG™`s„Â-Z Ø×~´9|4q rÌ‹‹G³ŒÕWmë°¡lpD0–BUÒÊÝ:-Ë,‰’¯£Ú€ŸC“¤.TŒŸ†;!µXÕi¶Ûví„+„q”'[ôÓu®ÇîÆÖœa¨öü0q'… ó2jÞ¼P¾ŠÖ4ŒÑ…¬ÜØìõ­)N™ƒ¬É G s4¸ÁÃÔœÅ<ìO¨Îß¼šB¼¤”…¥¶Ð|=3\I‘²D@Ú?‚·EyÎ;+ËC&‘ê´’X±(нj²@ûúr»-8?íøÊ@ujü¿¼Þ[ù·å=VËW¸ÖáAu£]˜ KÔQXæƒèÜF 0ÊTU{0û'­2ðHMf>wøêóHS›ðîi@b~üµŠ§kVIÔ›s‘ŽD§¼$H§­~WßjzŽ“¬Í¨]ÝÞ*J@—ÍpÉ¡wôÄŒhM{S15SU¸Ö4FXæ:šHfÒKF‘´¨¡­ƒ®ò+•cñxû ¯.;¶ãÉD‹ýZfCl7ªöÌ4À¢­ t¶øú•£S}«×|YÄÉtÝ"ÍlÒr94±™YIÛ“-z|ó?’2€‘çVãOQ(ÌÊÒ­b¹¹K€ KJê ô‘ˆÌ $D²žEÌÕšÆOr{§éöQ[ÄþšúÑ«C!* Z7*Ç–mñàˆÞ¼d²$Zñí°ì;fDbŒ›æ¾øPרìýimÜØiCŠ-ÁÜ÷ Á²]Èí¿Ñ†Ð[1û°$7Uÿ>˜Ú[  Ó%[è1µvýñµn[¸`‰¥™Ö8VIÑU|NBDe˜bÚÇš-o*¶æ« ‘P‹$réÈ þCçš­N LÐs1ݱ›H¢Ž%`üdcñNô,Õ$ñ«ÜõÌ)KEw4®=?Hì{ï@~g"CŒ ÇëyÿæN½«ùg]³Ô,š;›-RÈÚêZuÂm.’î®bøyΪÊC¯U æf–ˆ#ÍHá‰jþNÑuM:o2ù5¤“NŒÕôyM{¥·í ~þÙØEGGõÈâ#b¦7¸Hቀ€·5¯¨>Ó/Å’k{å]¬qùMK/šöv @ADᣟc5Ú“ë@ŽÿŠf•gUönuùnµ¦ùLK¹Å“ˆn¤.^NC‹™¸C^#ö€þS“¦À³ëL»´mÅV•-áR m-®ÔµÍ:ÂF/)2ý‰å@Üü?×-ŒIqg”²Ë[¶¼”27£é©f’Eæ´ìþxXŒ îÛköáçgbHN"?³Ð’wü± Äæ«HÚòÙ}Dxþ"= Æ5¡Osˆ âln†Î@Ê8š¿³%ÂÊÔÝÖI.eXYCzl TôG? )í "×7O=Í´¾¯¥eõLdê9†ÄÐ`>K{ÙY­ÞÜ]À,­%ú¼+F +eíJt¹-˜L“ÕZ=Ìžc0ɧZ\ÜÚ.шGK fr‘°ÿeˆº ‰ì¦WÞVó>‡hnn´9GE4Oå(yV'f ðîiA’àæâÇ¡In<Å-Õº.ZÅV¨ô÷ÀfÉNçëWq–m( N]:nMzäxI褅{=U"iÒ;kxFÀì+°èñÉÇ ÈºÙ‰Èlt[ÈäŒË7NÊÍöˆn¦•ý³#ò§«µòÄ +I4ÌüêZ¬ÍÔÔýªdÆŒ^å‰ÎŒ²Ñl­ù²êàq4…2Èi£Àå%;Ô59糎ÊÂ(4ëXÀ‚žä³÷¥}ó7gäÉW(…¹˜upÆn¤~4•èÖSØÞGu=ü·ÇÏ‘ø£ŽBêU‹Q˜µï˜ã³eŠ|Põ}ç´L|ÛÏŸÙÑ•Û^Ý2o+”èª*@n<’.<ñÄ'V‚æX9r+$R+)¶¡ïÌØÙ¸s ^]ù‰ai¤ùšQà¿Awƒ@¥Ø¬‹¾ßÞ+‘Ì,ðá“•ƒ%Çt›AšÆmR(ÁGœyq%ÙjžøéÀ3²Ì}6„QÇIW‚/]Í:o›xŽAÀ‘³j6öV6ÅZ(Õ”Sb(||r¼xcÀlžYK™T…•e(J—Yö«­}듈¢CYÜ*†_™É±o˜½·ÀÉ´fwá—nꢧéÈÎq€¹iŒ%#@"ÜÁn·WJ^n+L¼Éðð®j5}® G†8‡Sú°Óv‰øæšÝèºZ¥žo.áÔ¯b’ku0™aã=Nr¬|„þÓ-{fÀj €y¸!ô¥:…Ö›uõ{ *ÔR­xÈ£j©=ÿ™{}Ç/Œ¸˜l…æ¾94Ù”+B€iŠ³„P>ßšž+É>6c‡€óFÛÞXêRÝiÚeÁŸÐ´Æfµš&`®¥‚úª”zýžClÑöx0ËB\Qáü[´Ö Æ âý|’Ù¯Tº¹JÉÑÓ‘³þ,ÝÏ ‹¨P—Z°X Ëp~Ÿ¨ìÕI(׫rýž´ß+ž¢5v˜XƧæ>hÖ·N¾Œ»‰ª¬~b¿iW§ÌÓ5Ùu˜#£q”cÉ(i-‚¡äþ¡ ¥%#âä (_£Ç1h–©æÖáËz@׋/ć&RÞDÛ}ºãMBösª–Žu@òFÄ¢SF$¥HZÐWÛl tmŽü˜ÿ枃s©yk¹$ýþ— ½K›Rš+)ß®Y†@N»Ü¹@ð1 g +ºåÇæD#›§Ž"KIRIÐü2GÑãÕ†\Þ\›Öµ¼Šhîa!d†HÄo;žhÀ0Û–V`B|KdþJòúj¦§4?Xµ‡¢² eyAî¤`}Þ9‰ªÊ`‰õ9º,q‘&cnŸ¥ì¶ ©k>Q1Ùß~Š¼‘/`Ž9Lª‘Ž +:R™°Ðå90ƒÕ×ë± Yˆè˜ZØÞ[ZÚ¤ºŒ—ˆ³ÜÈ ™EÙ¥©û; ÍÓ)‚MFƒóo•ìa®­chŠBÞC¨U$€²"¶ÿh}8a“É#$¹1+˸-ã $‹ÉÈÄY—zo—ó[%"“ÌLÐ\zÀG7¦Ëè’hÀšò°\Æ:½÷3à+®<À$ŽiLëÎÞåeôªÃ’4ØpK8;¤Fˆu¾­}ªÎ«ÃÛÛÉ#±’[E +‘]ý²')™ØÖì„eJB¢¢Ÿ²vfDPj&Ê;NÓä¾cGX¡_µ++1'ÁUzæ6}d1žû›¡†RÉí×”´‹KO­^kÚÜñ¥Ä¡#ã QWa¹'nøF ‰tj ñUnè´›½6aŒ'„ŸÜν{†]èÃ+”Gm†K OU”ÄBPAB #¨?N^98Ç›üÎÐíõ ].å•KÃ$±1$Šz¨•åG–.6ÌY8m„éÚ)³¹Š^ux¬¹*W§Óƒ˜Æ@¶Ï0 „ç—zWç™vÐC¹l«ƒ'*Ó犷ϭ:⮜ŒAwc@«¹®3˜ŒL¤h&249¦réÞs’ÁmìǧjáH¢Š@y +žeˆjžù«Ï‚Tg·»ð\ìÆR†þô—L‹ÌVúµ‘Ô `·uzL@T5¤htø€ý³V4&Gú~EÚËY â—ܶóø—¡Zù¾&¢N„?íØ ææ9âyº éHä·Y†×VÒ.Y`S=¸$Õ]àWÅv#2#!vÕÂG6$R¡Å;»2XªE(B …5#­AÙÿbr2,¢kvCa¦Cl×>„QÀ‚gô—‰a1ZÓsNÃ5X±p’çfÌeeàQy˜OǨÊÖæÞ5Idº,œ£cBªXñ]ÀâNÇ*‘£vëLB&-r&—„иWˆ+˜Ûâ~Ôjk¡ë•œ}È Ú)/ìîK¡„+EHç;ºTÓán@€ª×l2‘ &:~•ªkçÙúÓ‹w>£8Ž$JƒÊ®Ô…è+Û¡ÁµZÇŸ!ºyþÖUŠæ[m<=]¥2z”U;Ñ‘xà ©Ê¥š14\¼zÈ_ö¦çÉ: 1ŸSSº´}‰ÆÈÜ”•bŸ U=‡Sá‘Žq°Ÿ'–ÎgäÞ:î;þ7û=ùCP¶Ð®´ûøDj–ò[ÚÞ¤oé F²) +aøÔ}¡™\$IÇ9@ÈÖÑ4>»ÊŠf…Ô<2‚ ~"Gü.l4úfˆÙúÖäÉnc­·«Fxä=96ü_v*ú&Þæ壆ÛQ25ÄqEº©ýýË2 Vk•`¾¶ýþØñlÕ +qž.{KùÃî“MŠhÃzÔE,oQ%IߨUwÛc±ä7s0ÂPžãöþ;óFÑDÞŸ¨c?HÍ\r=‘¶mÎûÖ™`6çû”3õr^Rò/îÕ¹)RHmÇ-úøclkdâãHÓ¡ +n'™íʱ““±­ H©Í´´°Ùu^)*:´:&• S­¢Ü?%â øXìÔªpdÅŽéféi¡júÔsÙÙ&“DBËrª¿Ì°…%©þQQ˜õøãôÿ\ÌZ,’ÜšûþLÃB…­5{m:ÑÃÝHAží€Y‡Äyúb€øxf³l™ó‚OìÏ&(bÀvéó,ÛÌVžnºÒ'‹CÔaÓugÃs,"xPƒº²µµÛÀçK0HÙæàbü›ÒìüËkcÔµ8ïn㌠–Kq¼”ø›fª + †8ʽE–Ic'Ò1ù#KóMÕµõÐX/í¨¢êÙé$°T–·—o°NàõSÓ©Ã’Cd㘉LXׯ⹞×I±|b¶Í.¬òGÆ8ÏÖþ¤Ì 7g1òñ¦h'‹ÔD‰'­n~Úôå3@sþ>Í©9ò®½©A¥OÔÜ£iŒ–²¬BØTUGšY8òXæVŒœp1ø÷8ÚȉÌHe[×Ø™[ê¦y™#¸Vc±âÌií¶d †éÇ8Å]2«ƒÚ¼7¼¶™ +JŠ¸£~6Á§_–‰yW™­¾¦.`ž6šK9ŠUÌÓÅhÙfP QuyµážêýJžfI +LAñ5b|3X}E¼L®l zá«m,&HÅš°ªÑW§‡AL°Àsè‹kË–Ú„×*‘£’É'/js 7Å‘Ç)PI4-èšLW—EŒÇpT¼ªÅkÕŒj«øo™’Î1ÃŽh†#9T±5]@Áaq ±hʳ@ÒЖfZòPzwø¸ýžs”Ô唥)Œž‹œóáü[1‚ÃDÕ´M-5kHncU‚ê k…ˆæj® ×âZõ΋KY0ÀžçžÔñcË0;ÊatðËP8ɘòä®ëLËq€! ßæ2h´é˧}²j—ùÎÝ[Ë—É¡x¦¯P8¸ G‡ÂÇNû"wž—Še­ z úí„ ¶“×åAì´©€Ê¢y}kY$ +]•Gòª÷ÊòLÆ$lá#V¯q®yÞ*A5Ì—'hÞúÞs><#WûóQ©×dþOØìph·õG–ÿ’û}kN¹’ÚßOh$º„!• C“° HÝÚAñíš|Òˈȓg™ïv8áFÀ ®´>èCLžÓH’×IœGun-柔‰ë5O9yÈÔï,1pC†/9,Üsâ—/ЃÒmu©´(m¼Þ,¯50)s-š¸„µOE“âRqß}º bQ©xœ2¸1ÝRÓôv°–õ-ir¡¬Ý‰5§ÂѽiñW¦U=5 Ä~§'~-¥óOôMR¬ŒÆ7O »®]Ù£),Q¶ú¶¡umAH&uþÛ~—X d!ÜV'äYP#e$ZnE>,˜u¶q¡¨»òüW0žB};œNj„QI­X~¼Æ nC.;óu•ëéÅ57‰ßÕ +ü~@G9"?§%!vÍq–éŽ.ð™Al"‚9bv9¢v³… êBò +ðšôÈHÞÍë~„ÆHk"ðã0_Ò +J’j +råEÜV› ˆc-öéÏö¡ÒîÞ7)qš(÷P¬€Ük@\xI¢34Hú¾L£ÈöÏ«kòYIrÿU‚ g–î#xÈP©F‹µW½i×$%0HØ|œ¯å¼'rG>£õüS¯?]_þ’µ6«)¶ú²†‘¼³HŽÀó*?v¿]º·n§~3,‚Cº¿ rêævqÆbO[þÏÓòAC¤^\~^kµãH’Sond“ŠÅÊÌR?ûž”Ë1`¨q[šÉ€îý¯—|Ñd–ždÖ¡”Æb¸º3Æ  ”ÂaΛt9Ÿ„ÜC­æ¯ä}(_y‹OÑ[ÒŽÞ[´¤šdHR(}+<Ì)éQ¹;ni‚r¨’¦&[¯­,´Ï#j>[¹K$…µk,«rˆÍrÓCÉÚf”ž4—ˆnR†)˜°Œ%•Ôß<‰¡R~ÌÞüÇqÆHÖhnúÏ4(¯ÅIƒ‰$øªn¾àq‡&¬Yꄾž¿ŽôG¡‘ú¶²–´Z,’XK÷j³á¾Ëv#¦{ݶ),rûRÈl¦Ô €¾¯O$Ì´OJ‰Ò´¥_Zo^¹ :²œ¹3 汬ß[X™R?¬Î K(ád­ 7Ù +NÝó:yÍYupÅÅ m{äo.,–­q¯êvñ„2CMRÃPB«_å'1óqä1²ça†æ‡Ÿ_ÇÉŽ_yâ8g–a£\ÚÉ!ä÷)u#õþ`¼{.aËC0(ßãÞçGYÈ„ÛÉ~lÕ&ÔÖîÏG’òÌFê÷QE)ØuFçå\–‹NqOˆnÃ[š91ð³güÀº· žÒXŸù&FZ{ü@fÔç=Σòñ+¢üÆihQâèþ8@î_ËÒ×^µ•Ö%Bæ¬ãáožÝrØÌ]†Äj’_=éäO±' Í ¨ ”j̈hè±"Àš‘Rz“¾YÄRËà)õˆ‰%~ .Ƈ®cê1Œ‘ó Ør'¤hÑJ!ž†&äŒFå[Äd1F…#4·b_˜:e5ŸQèc½‰jñ/ÀÃcü¼rþq¦˜<¯PÒäÓ/ã2*½³Ê$…ÏîÉÜ|C¯n¹®ËŒÂ[òr`mÆáÕ>"cRbD;¡ª¨ÛµzåFLÄSË ?YŽX§$lˆ™i•û5o ¶Ÿ0‚CÒÌú~Ÿ¤­–•¦;Ý>ó]\”Ž2Änä†æûôP,¸òd&>¯±³ŒH<~žî¬Vò WP”Ëwx •øQZED«À}ù‰ü—*þüw¹ƒ´at‘ÚeÄöv0Zsx½1£ó.d«–cJ·vé„CÒG \ä&L¹Û °7ÅÃòf.T cEbHöÛ2à%ÍÇ‘™ÔJÏäJQ]«µT홎¼óv»oõþ^M%¼T0RVŸHÈŽh‰¢òe%Ô5A T{Šå¶ÝÂß¾ÿ<.;Ó–Hp‰Qü[dq‘ÿRYwù-ª@A°Ö}X#‚Çqz”2Š£QÃÇ ;ï\„´\QÃÈlÅ/´?0èv1j·h®ê°A n(-‹+*PòÙ_¯€b3ã '3M)@ú?ËÚݼWkf†Þt‘.´—f’h¥ãêBM½ÀHß`nà“ð,Q÷ùìåþb·þÏ=ØÌÚ=ûOêGõwŠniCSJfÒz{•º˜Ê…&v––öˆ5OM  xõ¡Þ„~¬»1S"‹IåO²ì¿"GêËE±*2Ç ­ÊD«ŽŽ¥‘¿à©Ê§Šæ(ÎC‘^“_Ä¥#Ô.B0¡IÕZ²¦RtqþGÚÚ3ž .†æòM1š/õUJû+\¢zYGpl}­ÌÄ3]* {›Uš+’ç¨FZ¡#r­ÇðÉcŽk2AäœÞYÉ©h·v"åJÁШ•tßæ´Ì\IÞh’PÔ"£ñ铲ٲâôƒB:~¼R« J&Óàr˺%TuÜuT90ËÍ)üóå¥ÛÝ€[NˆþI‡>ð¹0ÇÝç7Ö^*¬ÑÇ/Qê™h>^›!Èd‡ío!£Ð´åZ=­°ø¹OÖRèy+]²¸à@ûTÈ÷¦ ÕÉÿxämól½‚ï ·Ãj¸7Àª½œ¨²åþâbüT•×Ýk÷eyq‰Å³ÌK&Ñë3Á:Õ usCð§‹mÔý¬§€Ae“rf[ mwˆ*+A°¥3"ÜL‚Š97]×c±§Üzà,^;©[>›©ÝX°£[HU;UÅìNO͸IêŠTôÃI´ßBÐîõ=E-ž9máPZâbŒ¼„`Lv~@˹$вˆó7–åÒ.‘r“Op¢9ܧ!!'àjS·¶"Ki7:wú>xY9˜°*hSñŸŽD”µúF´©Ì-I… êçnÆŽcfà‘þ“(ä1Û£&´´I}6Œ²<ˆ¯%1±GPÊÄ6ãcÐïŽ8‰{ÙNU¿FK¤¢ÅêÚ̼8ʬkÉYhVŸ#™@mN&CtBI²–ÎÆ×O”z’Úƶìàì}:ª8÷e +Ôí\„‹9Ê÷y÷æó ?0éó][*HÅ©FGdOÚê+ßlÁÖCÕ²##B˜<Ú¥ªA#K/?ªò^ ++ÈŸÚ|[n?EFbK1}åÛÓ´=>Å€çio .E@,ˆ¼OŠ¹·„j 1™Ýá>`·³ÓüŪۨjC}+€Á€,O0õ¯A]ûSÃ5³‰!¾D­%iÑ¢!¥d52†J¨ˆ¡ãN_CᑭѸ ¾Ú§)úÒ)e¿4_ÔjÊb+á×aÜâ°„ëøü|Ý '4 *ÛÛFÜajÄÉ1,xî~*u¥0›lê¾B€ÇäõW‘gayqI}0vˆn§ÀŠ|³71&ÑúZÖâyŽózÂ)¹+ÈǧdOÇ%Ž5+-™gé¤ÏÏæžHÕÚ…\CŽDõõPO¹Ë5#Ð\Hsx¯—¬ï5jÃN°Y®kó×€Hã,ò™2µ)Ö‡ðÍn8 ¸Œ¥’[ù÷Bó,pÜ[˜´‹&/.¯Äú~‹ƒG—"kñ•ã¹,¿3ž®LèìFÿ±1üýԼµæ1;E躿µ½ZÈUWŒ°û<€ †»Ö²:€x‰rôùÜ‹Ð0o`B·7‚`hÑoÈí±'T÷ÇrÏ&š'zdwo¨ùŠëJ¼°C éÜ®DÃÖ”úK#± >äUzïì2yŽIчÚÕŠñØÈvòOî­í>¹lò-Ä~îáˆõPÎÇ÷u N”Øwß2%’PãC$¸HIéÓg‹§3­ª—#iÜ»SlTáµ¥Àž¹$ð®÷ü:âJi”ù8FªÌ ’n(wïôÇD†ÙÂ7µpŒ§…8„®éJ÷9umN4žSªÛýKU¾´ŠÁpê€T„óJW²Ù#¹gé`Õ8̃Òür“i6 š²« ƒ! ïò9P;Œ¢Å¦¾fÓþ¹åëëe^R4Lу¹æŸ§¾Ù wi‰§‰9(`v"¢¹'!º×û14†Ã>^58«FP¿hñ#±ØãaQÖZ>·zÊ-,'›žèÜ +% "¥ßŠÒ£Ç +Ênü¡¤G¥Ád. ×Ò’M,gg&Œñðª´Ú>DPïãZ` ¿s1PžôÊÎÙÌ€SÔQö¶sP6aÓ§_|¸EŒ¤žX/§ÉâÜÀ“Ûjá–ÍDÚ6EuoQ—fZöñ\¬¢5È¥š¿•tMZe¹¼ÍÀNTw¸õ‚ =ð‚WŠÚ‘¼¿e2αÉq©© SMÁ5¦-l_Ïz¦›k¤¯¢2¥ÄžšÊ~›(äX;«€h?—¦FR¦Ì{nÀ ôµ-J ?I†f¸}Ùdš6PÅÍÙ>µ~Œ¢y÷Üš¡hÏ8éRùmô÷7K<· Û,UJ•Pµfqñ èN Ó”ÜÚÄÇÁŽùcCm_Y¶†w&ÎÝDw`TŽÖ…¡ ÷-Lj;ïì3ÌÑúXc;ýTº­Ï+BÜ[°bŽ\ì…TSáæ}ÙóoªÛ¢ej¦C ÕA`¼edÞ„}–û²ðãLÕ…icu½¤q”@0øk_lŠÄÜXçU—-/K»d ;XË/‰>²µº6ÜããÓ«f&®<¤† å}*íwG³²˜g™ ¬èB¤pŸ\ûD7¥¹Þ¤ô¦aâË›!ËÍïÖ·Q;·Ä¥ä;Ó±³h$p4ñßÍ;U´ó×66XîÐM‚)]=n^²ªH±‡öÛ03¦{›#¸ “]ÍF?Xi7ŒµP>«ÒÇñÌüÙ6Œ)Ø}£µ)•Œledþãî[u¤k0DVòÊx¬áRÓÆÑMHËòUšY$àŠU€ô åÐwƈ¶Ñ«ñø +:sCh&Ydôô‹Æ’K¦:rN(Y¸‹o—\Œ“mÈåÞõ¿'F”-X…I®]‘kÁO¨ƒ[¢×rzõÍŽ˜©ÄS» `o 4¨EžW©<•!O~ŽùwáŒÎÉæÄ“Eä-A!?¿™­âF$+zbhµø{í•jeQaŽÎúiÒ‡ Œñß3è·N­,rFÆÚæVk9@¨p漟¶¥©N¹..­ø÷ +úw’¼Ë}Ä­™¶‰·Ý7§·ücÞO¼ ‡2@ezåž™ +Ô®$º›©T>”cäXý'ËYŸry¦ùc@Ó”}ZÊ>u¯«"ú²u¯ÛjŸ»ìLËWözÍÜŽ¿^[[n‘Ç’í_çr¦U(Hžt!“Fâʦ¤A§# ™›«õ­~Öç©=ðãÂ!É–\ç"]28|/^Ûá©#2CQM,"W‘ƒŸ…V«CâzÔS#6 Ò`GôÀ® J~-ѧ¾¸Ÿó8±µ) ‚dã,k"ÿ+ª°¯ÉȘƒÍ"DrC6œc,Ö olì8ó)n=Jž«võšuT§ÚS~ßådAõ,Ç¥›4MÑÔ—õO\¶Ü{y¯æUó(¡ÜÚÄXµ ã£##ɲXàaµ26ÜÌÿ/äÿG»PÚHÓ5‚¢€‘¶ùYú“ü,÷K½ÃFR¤1UZò ð¨Ã[LáHÆŠ7efUfBY€J±RµRzdšÂàß…-°8†+ji·^ØP‚šf(jÀ7€7é¾$2Š'Ù·g,åx¨­AÛo ¬l-¸‹’œ[H øãc·Jí–ÛQG[ʉ7"G¤ùž˜Ï’"Êê~]Qødæe¡©ªÖõ)ðýð -§ÆE}·Ä ÒâOn¾øP²XËS‹'©ÐõÀÆüï§ß,êÒèÏÅÔF^¨C2óX+ŸЀrœ—Âwn„…òyÆ‰æ ‹O³Ÿ‚^A +ÀÑFyD“àIvR–¼›cšÏ¹Úä[)¶ÖãHÖxAweW¸‚µn+±ö@ïO|¾3¡cŸV…š<º2í1c–Þ+ˆþ(åEpÕ$:•Ø¨?Ç6p1:¬»H‚ŠÔ-ÄÖÄ +FY½ŠÿfC$l# ødŠƒ™‰CWØ“±>øÇ’Ènª ø°”¬ªz€~`aKªT"¤t_öñ,RëÛ”pc–°¡ô£z ÿ™*2‰Lr¢ß g˜1øªI{la*Y¡.¤!‘]H=j:å¢b·kðͼ÷ó¸JºšµÞÝåžR¤óY£Š°U"B+δÛÇ1õD옋‰dš]‡Ôtý3M§#ik R1¤‚ìTq™Ø“ï—C`6G•¦¦_Fê2GÛ$U€¯ŽJfˆaØ-ù‹O“Tòî¡gÖy¡oACYPsŒAæ£èÈåHF3Ã'Ì:¥æ™i6Ÿ¡Z„÷)éƲ„”'%>«:ññãAJ{æ²1&éžIïË’V<£qiyk}m¨míBöjyüAÊÆ!CFP±mÉzCRKŒDsü}ìŽiBŒO¨~ûþÅ=GË‘D`ˆMs?£"¯Ö"JGŸ‘øåV%5bM YÏík†=Í2ÞÕ¬®[Nµ½’)^[iäyÚ"Cñ<¢S8uøh|8Œ&ÎÍØeFžÇù}qÏ—ôÙFñú@ñz†½Yœ0®ÛûåÑ +r86·¢K§hú¼WW‰g±S,/VVB>!ЀÒֆ£.Œ€—sÄ`x‚O®d±kÔÆK^¡é\“[}Ø)KƒûdK0W,m^…ù{oMÖ"ŸXº“n„ª* ?ðUÈvÎGfyé¯NÀÓl²ÜBóÍ qþ8R=Hž6’‚Œƒ(-Ö£‘ú0MØŽì3È[s&òEÈK¹ã5âåŠlJ×íü¿^SÑ ° 1²ºš ¶µp£@~ +«ý€[u¯à‰ ÒÎ ‹ejËÅI5¨µœÈp›ªôï…Ñ54׹ŵÇs¾ß,mid°E"ñuä­+áã4ƒHk™u@¶*ОLÌ´ +?•A\«'z[1ˆ]È¥pó8 +ÅGįµj|i_»&%êdcéL0md*yÕK¨mÏ%í×'-âÓR DìJªUÙ9JœÔПòzý†2Žn|°”Ö9®§Uao(ÿ,ª®Þ?\´HžŽ9ˆQ‹Íy4…y}¤jvË(µå|-nùâ«I¡ëòUæ+Iï|¿©ÚÛ­g¹´ž(V¡Iw•~&Ønzåy7‰ ˜ù‚ñÿËßÌ {dÒ̬²!†H%fB#ÇŸ&rÛŸ†§Û5£‡1³Ÿ ±ŽÁŽ/˜ÖôbªªÐ¹©Éµk©¶v*Ùâ:¾ e±‹ÖŸ OBÄþ¬E!t>º™Ã´*Í"%(¦†œ€©ú2$ŽöB'¹(·TXêÌIZ*ò¶QGi¨?Ö==)SU˜¬lÜ•yñ÷sÆ&1Èv²Rë»K;˜ÄR\ýv퇹·BÌ®Ƥ1 +dÝ*S¸d쎌1ȇԚl‘ÛúêÕÁ\4cP+µ7¦gÂB‚r@îœ +Q÷åÍ$—÷‹a¨Ð‚Eõ@õ)-ŸSŠ5UDnRT¤a~/pTe±Êaàyìë[œz·`цÑn*?ÊÂ<ØÊu´^Gù×ç-5¸t=?ÓKñ, ÈÍY® X€vŒu^§¶bç¨!Ÿ”‚¾Ñ_ˆZTäY çŸV-ç« h¾aòÏ–¬áßjwpÅumëÉÇêsH"n|˜·9 ¢R‡©í”Oxƒ“$¸ '¦Ì?ÔÌÇÜÎH§‰¹ •NU5ï„–M†,›‘)ÎÇÓcìi÷aä¼ÞÍ¢ÇtåÌoQFZ¿´¨ouÈã#‡šrÄC+°¼[ÀŽKOµË°ãÊ.¿Óíµ )¬nÓ½Êä^‡Ø +uÂQåÿ"hzJÇ!ˆ^ß ¼¸›—Z¢¢±ßÄœ¬@un–Ry2:AØ~cYÝÀSç[&KM|r,]¿l+jNë²…Z{OÙ;›#Gš[s0jªWì°<Ç.ÛPwÁÄz¶´FÎÂå“ÄÕw€Ë[—\¦0à‰nœøä’ð™™ãVuCYS ºº÷í7÷²0µ¼IØ/f V@•=è||2È䶹ã¤úeJ5+]€ì;fCˆW×l)m†æ½E{„!å +¨Ó1!ŠÕ”|4÷ï„@جw·MËãŠòèI?ü2$‚Û+ˆK?3ï™ä zá{s‘ªÀ=Ó¬‘F¨§Jey>–0;¾_}LÄ­®¥õ;QÇœ,#±ûA(YÂcÜuíLÃàï –{Öèú˜4Ý>Âî[m6óQfXäY$•=Awi{ž9;f!{ô}apé%YùÕ¤&8ƒ2†R܃ +†”¨ËYÕ&zd®Ñ†ˆI ¥.ý:m–@ØhÉ*ZÞ…mªÇM,°HkO)ZÛ78ï®ü\Âv÷ýÞU=OãàÝ-Q—Aøø¢¤Ñ¾?U&c7Bò¨pÂN9c½ÁÝ„sVÄlÕ¶­u¸{y*Œ¨¬¯Zü*ÈçÛÃ#ŽUåœ%Èx…ôÄýaÝÄ+fùÐ~9x'¹¦B#“Ó|‚ñþlkþmÕ9Í ŽÑtf%ýÏ ä"¤´‘¼|W—Ù OqƇ«tÌرÜÍeGw,Ƭ6À°‹Q°¤.½,PØ—d.Šñ×á!‚—™YwÊ5·é2N!‘^5en[Šœk·\¼rq¥Í.ÖêЬë@…‚ȧ¥OJe9O¶ì£Hh5ØØ* T¹¯Â6 tܶà 2ƒ²g€ó¦Œ–ÒIHËu%C•4*Ö»w¦ SÃ!܈6ÊHev «»šÐíA–Šä×Å%3v’8Z¡UWb=÷üp‰)… ,[óƒó=|ƒåÅ’Î8®¼Á}ÉtûI”øïgF á}«Ò¹ ζ Š¹äùfo6y¾(í¼Ò׬5ËÉÞâ}I£ŠIMÜ,D"úkð§ÙQW Ì]Œœ‰ã<OT‘ך0uþd!‡Þ33ŠÜa]]¿dŸ¤oú†%?¥Õ"´¯|Y6ÉSغá×6–šN<@³T(;n;šÃ"I +¯¦ÛKs{m·¨^XÃPà’IÚò D¶b‰2aÓ‡2Þ˜T~o:ò(z0Z +á‹,›sNmíæñļ”PH =ÆÛå±ÜyHW4r+q©È +n2MGšá¶(q>ØY:»ï‹XÒ¢Ò§¯†øiTýgfâ´þ<4´çykðŸpR„¶íþj'í0ßîÁ ÛŸ`³3LÌ]ÐOÝþtÈB³&JÙKXž‘ƒ(aµ +ì7®G<€ °D’“"N’ú¢FŽ^A¹õz%)ðïQ]ó +Û—µS(±º"DfRŒ´äNÍã¹ÜÕ™p‘¡nà Ù8YyPŠ/‰©í—´¸H• `I¨ #¨ÅP—·7@ð¶E’J€:÷Û!"G&Pˆ?R'V3]HSö"…=v!’=ÊdEP=KPDfk‰HEE$©LrHD3Ç ß¢3I€Y@Q˜bǃ Žù!šrNËüþÔ òîxšsmõ«Ëh…Š(ef›r*X7¥ö{åY¶ €Ø¾n±ÐëÙêAnæµ¼B¶$ñu'Ó!ÌŸ gý–¥)MÍ3 ä«o†8’>Ç þ]~^êy÷A½—O[8,&yŒ€íRÑh[vbý=²µœ„A¹9Y´s„x¤(ì{ä𹳎OSÓe‘DËZ±—ÙŒnGC^½FdjÚc-ÈN­ž49¬¥š¿ nM>yxÙǖ轊þ äÚÜ }Ø +Ž+AÆ‘kšö¥¤È­ážÑ€ýè‘Ñ×ýe*Êà³.IÃz°åáà H(x¼ág;zsÅ<>˜'ˆ«Fá÷ÞÇc”þr$î qÑ6#⩳grüm$´kÎðH”#w‰‚· þÚì?¸jŽßÙæÖp7ü|{ü–j—êlÚŠ¤Ô`æ¼xµ ]þÏÄ´ÛÇ1óæ¾_Ùøè݃ûÿoãªsa*ˆ@vWá&›æf),°Ýæ×ÿp’Æ+$1‰È§ìÄÁÛðÈêEÀ³Òí[Ì[]¸–ž€2öG!÷x÷Íh™vf &º˜.ó”K%Ã'Ñ¢…é¾ÿð¹|2‹L > ƒJÕÖæ³fúÍO'‰÷f5I ¡¿åuË"8¢"}_¹®B¤d6?£õ§GS¶Ž¹¶XÝP?©0+D*ÂOZ’:eþ% '³Ræù»ókUÖ<Íçë¿@ǧ Gia=ÔÆÝV¿èûûÙ8ñjq?Ì|“½ÈøscÊb15]Qö?—Ú´63]k2ÚË®y-ôõ£%²]KQ•}™ùð"‹¹éÓ5ÿ›°<={éÞÃK.fGPîòûVɹ˜;F†JrõGÂô,´lÜÈ‚ó¦êöÌK'kCʦ ìw?<‰ŠL Ý¥rß»¯’W²ÏßÓéÂf9(î[o…ƒ0¢¹On}Wð?«#)Ž&|”®æXÊ1£†`‡pEü09;FSÂS?+]¨óN›¯$33U¸¸ÄÄzŠË~Ò»æ\%q&HTãâŽY9²²ñ¥7Uo|±¤…e*Õ*Aà +ÒÉ$EØ°°Ä%÷Õ™"N¬Â­ìI"Z]æMVÞ)ŽK^,£íG\£4€‹~Ÿâ·Z\¤7Í+3p¸£:Tå +­A߈¦jˆ¢ ¶» žÙ,o ôÜ"žQº·F«# ÁËñÊ3ô´dŽã’Y.´Úm¤¶W³!g(–wD„c>2ÆùèÔ½|2¨úbc_ÙÖ›MJ@þ/¢oc­¬6ýt’•·—â^lÃìþÏ_¿%‹!€ç·F¼¸„/z­Ö§kª1ÑýZ¥äRÁpÑõ ":3¨ÿeQò̱Lˆ‡ãàOœ¯|êù_ÌÚã-úé÷ j.IôÚRŸ¶WÒi˜òÀáF ƒÂYNç;·XKÉÓ}˜OÃ!4í½èÈCtd$Ÿ§™¬¢ã+^Ý•/ª +¨^Á*ž=OL€•¦Ú±Vˆ¿óµ¥–‘u{¦Ç3•bi¥Þ!3U£~A° xµ“èsjÍ3gsÓñÜòë:Ç_­•ÝÚ\NªÍr3¼®ÁÁÚDõ6PÍñmÏb0ñîá r?Ђ›Ë·©—QÈ–÷ñÞé÷1ÜKÆŽ8U®³òYxší⢇%Æ:w~6l»5düyWédÏ=o¢‰M ±!¶ãÇÀ›"©ºüÆN&š¨Ùü{‘¶“ €Í2qH jÄÅqÊŒ/öäüQt=;¨ÝÎñ}hÄÑ¢±ã+´…˜?åðd7+ünâˆm–Í\\Þˆ"eŒI(U*€Ž5Ú¤tíMÿ¦Pݾq–Ò÷þ?o5>*…H»‚W¢È¶ÐÊn%XÜ•PÞš²õ_æÛqLIa0vú{¸¹_Þ>NÑõˆ5m>w—‹z±ŸQ¶GRôåSÇz¨è=ðK–ÍØã‰ùüOé{f‹ÂCqx³Bõ$ŠzÇ$$·Ù)¦µÆÉN[ücˆ§ŽNµO eqª×â ôWâiz>; 8>jQ[–Vô•Ð + "µ÷ßlV˃‡«O«¢ºÄ3±ë^(ëîpJ`lÊ8ÉÝ ÂH(Ç—Ôí]ºŒj”)JæúäŠy°¥BÒ•;\§$ÀnÇV“‹ñ>šžqyä‘Q×hútLošYwtáÂñdoÚu”ÛoJaœå²a•]ù¢8Yâ¨yTP(X‘µôÊ窡æÛ 5¼¿Ïzü·<¬¢”ýnR}y`_Á®Ýwû³ ’MÉÌŒGÒ´[KOÒ¡†ê2Ñƪ–²3 ü&RjA§Ý±íLÅ— ¤iË”%‚C"°Ö ``B8 +4u}¸î9ì;W,¶§bÑCX…¼h¨ãmèjŸ†_”Òbä×cT&5©åàTíÓlËA …¦£(¸ê~_H©¾ÅFçl˜™¶<"“øoYÂËrÒ¼ƒd†Üì‡r8·FznÌÛ ‚÷9#3Ì°ƒ£Ôl­b`%’€²DˆÅûîU R0è;ùÌGñÕ²P2a~{ó¼M‘9p»VÙiê4‰´qÒ„W—Ú=†ä3,j8ÇË5 g]žÛœJ#–5õ,i V‹ûÉ$5–›Ö¼jUEÇɪ™ü~”.£­\¤vÖÒH%ô‘þ«4}B$P^¥›âŸËßµf¸²™ëº{ù_z¶^dŽB¤ú¬öPrR±H¦Fø¿¼R÷oÇ ãÛxe$ îÿC™¤13>cöýÌùµ«›È–‚×iåt +Lp‡ ϱ¨“Ç­s +Wד¹åõ=OÕc’õ¸,Ρݨȭ1€÷'6xò­ÕdÄE×à&pjŠÀµU¤¹o¾ç2ã0C,t¾}bÞ%¯#êx¢î AóÆSˆcr>ä¶ëJ•ä·­ì¢é”³Û€C¥8ô¯|¦p–Û—"ûBZ,03ÆÕT·7`[añ• Ëá(±ùµJÉ݃úV nnœ„;[ÐlÁl×"aÅÍ'/ ùûÌš«hþ~ÕâRÁ ¸ô¦Oq“Çé5Ì ãÙÌi>¶óZúâ¸ü€z¨GíHÜW¾cr#RM'›eó£­ã˜å°‘÷÷@®à¢€I^22­y0¢ŠÖ¦™o ËÎÁ?µÖKGé‡nqVo³0 @q¹æ;“•r,̬2T‚6vw1mñš…kž;dŠ{+yÑE`…ÉYKF>™“‹žÔé–?6PÔ;Ó+_8^ZÍ%ì¶òÅm$|ÌU#%ÛÕh_߉!áw)ÕNÙÖ›çk2h:Mõ„Q˜ÔÉm ¿&õøQ'&*‚Ÿ7Õí¶SœÊ&#ømÙaàž)Ëø€åîÝ#†g$âkuçiwk~-ÙQ'‹‹,Uû)·˜5Cryo×ËõwºâÚhºÆ¡[ÝéÐŪ]ª¼±Ç3/ÿ¢$—ø€®ûR´_;ƒéütoñŸ«¿ð¼W²$5¸’âfXáݸ­ͽ>U;òÜÓ2ªœ8e¹ +îßñÔ&w:”µq*±õ-ýx¨ˆ»»s¶B1îdg¸—Ÿè‰V{£=œrz‹ »2ò£?ÂôR­ñ! +9=ðr5ÕœÏn¶¿†þ}<”_XÒ¤{·+4Ö‰Qˆ$d_SšŒÛâjüþüDÊrÈ“cñæ†[Ðìà +FG cÓ4f>´eÉøCxþËc(‰.íÜì^âÒ5‘FC¤­ûD $ +-P™t7øszí¿›d½ŽÎòæCÝÂVxã4ÙË"ñöQ‡¾P3HÿÞxq1¸òæE»Y¤æŠoPJuBcß2#®< GE4ÕV1•’ê§â58ŸAJäŒÀó÷±£ýˆ¸üÃÈb‹1¤@•$©§›L³ÄŸ&<É©<Ϩ^Hˆµ€V®Ê(P~Ê÷Èœ’–Ü‚F8Ç~kíªœg¼•™\"µó;+3T£"æYA™.Y}+kIIcF<|+Næ§Ñ ãeÉyqusI>±ÐR5,½’pÇ*7LÇ X«D\jRÛ¡VGÚò;ö¨÷íôäÉ W& 7Í.¾ó4+ Hä2J¡«^n{Ð{eG5lÚ0ÛÔüÙmgo5ÜìÞ»1"£µTÐ(¡l¦’Û:ˆyTg]Au;­F"nÛ×k"9oÏ?ëÔríÒ™|£*¾.$3Î&Áù2Û1j—–Ú5¹‚ò­ ɶ%X£# #N>H/ËocLÃŽž17îs§Ú'8@ïýˆ-:áÕTé³*,O阙Ø-h|™ ?›¨Ë¤W'éL©ª,Ť¨I¬Œx‚6øž¼J‹üë‘àìÌÍòÙM<ù§ÛÎðÊüe©)J² ìY€;5záð¤ÇÆ"Ÿi|Ónå±êeÛýÛƒïþKR¸“(óer,Î×UµxÛ”…ÝT€îÌÌ+ð(¨ÉñŠÝ&Øßœ|ç—§M{nü¯í¢­º¨²)ƒ‘ +õcÛ+ÚFƒ9“ñx”ºýÍõÚÞM|fÔÈa¶ä V%ZTä +šü]T‘ó̱S§É˜ÈÙ)„Wí/%h!Qð_Ä}R¤ÐJ†­Å¶aØV•ÀGrc|IŸ¯¥^È—¶ö°Éj’ª\ÚÆ\#TGG¡àÑÐÖƒç]²ªÚ÷RA鲓F4‰-ît餒Ý=°ú³E'8’E,~ö·`‹bÎŒHçÑ–ySÍz}âÉ5Œ¾˜’v[˜¨îÌ +ñ“âTúr‰ÄÇbíqe?±ŸéºÉú±ôçQ‹ÉEvó*­öiý‡3A”÷(ŸÓ¢£õ=PEPŠ_:xåÜ{5p£­|À‹9BÅhŒî(¿êü¾ü¶9Mµœa7¶¹¶¹‹Õ{–³£˜ácü…M¾&õ¯\²Ä†å;ˆ†{Ë«‚Œ>­Ì²4|À)¡æÙ¸”§QZäjS‘ŠIá„oñøêœOªAmý`ˆ¢XÔ»¸‚‘öœ …e ˆÜ?ÈíÞø«Ìþy‹WüÉ×5 +K¥jwµRœJÅ° x ÂŶ ú¸Q:¬’[i¯}HËë´ŸPLJÇP6äi”Ç7‘BÝ¥j¶–íXïlåŠð©FõWá‘)WcVÚ0ùwÁ8ßDÆUÔ#›Î‚Ѥ–ÞîÞø,Aý+dn( N} 3 †Db´À´žµo6;ßi¨¡4»B¿[,U_ƒ—¤ìÌ +«1Ù^ù<ãêu&9?æìÉpò„¶ÑL÷׉é…I#‰]qÈzôfÚ£‡ÃßqÓ,ã³³ƒâäêZF¥êYÃ$V¶–ñÛê+S' Ê~ê;o晥äyo÷åQÉ*ß™åûYb?ªŠÒ¼Ÿqc ³Þ¹º¶pÍÅ u©™@>¥;#/%45ärg7ÑØèôƒ,O ·îü~‹ ò¦‹oi«ÝX»™8;\Þ‘I¹‰E DÄM„m5èo­?ïU¥¢P¬¼¾©àÊWí$€–FNNP¯/Å÷üR»§ƒôµÕ½¿5pªÐ½}P­Ä<è²{šŒäŽwÕ»ÔŒ/ù®¢BërÔÒE`>Üf‹UâzŽ»` t\0È(ë¨Þs,î$¨Žkh „#‰Õ(ÒUÚŒV鑶K‰¡ðFùo^¹tã( Áe¶»QÉ]ÞCŪ/&u?*l:Ö1Ža¿O“Ã$íÑ—[ùª8dá9õÛ”,ãÛ´l•Øòû$l|2º­Ã–d +©×¬¯½ º’#uoî0™w±t:ô@ŠF¡íEtˆcÖ‚ŒNøÝnž{Tj•`ån"†ª‹‡n,h~!Б„LÕ$e(Ô|ÒÒCp³\+Ç´”ªð +h ø@&„m2$ógµraúÿ˜ PBUL茀n]¾/|•[Í„kÿ\Šâ6™4KÑMzŽ#ì2Û˱Õ8Ú˜Ì|šÒ§‘g’ ”tÓeÙ#ôC·ª$e"¼¹3½ùaîæÕ‹—¹G©ÛºIi³ÛÃÉäFŽGVZ t~-Múÿ«×+à<Û†Py*j>mk­ÚÛÓh9Íhâ&¸SË”j¯*ËÈý¦Ú½ûdcŽÛeš€åøäÃ5Ï1êì²$œmbôU¨'àV/¹é×}ûdBy ¤—:ƒ€ëÊx_æßå“…Ú”W¾•àk¶g¶õ$˜,E~Ê•¯ÂBûã ¸äÝô<ãk>RƒP¹ . +²\–vCÉ |GõÌ)@DC³2AâaóƒjZ½åØî,œ²D„31²F¢ ø¸’932èS¯Ëœ’B®—¢\ÜGmœž‘úÀ“êà3‡3G4 #„E>×½{`”€Ü¸i4&Òêw± v ‰ôýE¥@u:‚8«ï‘"ù·C`i¨o¦’%$¶‘Q¬{Ö6Eõû°¯ñrûüððµd—AÉÅÜ–qýy¡y^EyVÒJs§ ŒcOŠƒÛ}¶ ÙŒr|¿‹Ll%µý5 µÄ +cšèAw0šHùN ˜Ñ·§.b8õ¦@­ÈÇ–òM©Þßh—Œ´M®“ko1Ag˜}aÃ0Y;±'cU_€WöFù/DPýhàâ;°ÏÌO<Ø·”5ä¼æ§êßU´`x¼·2 -+·ÚjtÛ—…¦u—ʲ۫Ù[Ïsœ–øSeLƒEÖ4¨$ŠŽöö¨nc,ÒÎÇቕÍ*Çm†ß|ÇÉŽD_W?E¬Ž)T·ˆåøê +pš†’­i"~öæÞh¤ pä«ÉgnÕD_…™·~^9W¾ßw㣚5˜Á»ßmûû뿇©<ïÉ-ŸPkø.ši&´™Ø}IYUÚ'”0©~ª¡{ÐV£/úH¢y l‘#-»Ëà ˜¿Öî-"õŠ £ˆE{8hùxùðeåðu£6Oà?C#T$k¯ãξ il+ou[¹‘cÉ7¨„ñ +Êåù?1BHMŸöO|»‰®P1;Ž_»ÿBâÍÇÕÚÝeÓíä–AîÒO,¤ÊÂÖNëZ½1†Û±€dˆÒ®.Ä’Hú{ÀMD±Æyªk'Ãv >WzÒƒ# ‹ŽÖŽ´]1.¢&ÞN<$çtÊ/ jÅ’BŒÉñ{¶ÛÓh›gŽ\ ?::tÓiþ­°`#*ñ”…Ñш•þШ_•+·#Eʸ·ÝÈðòݱ&šÑMeo©s§Æ£íè…c‘™XªËß­1£~ör1á>H7úõÌR¢[[Z;[òx.%VOQ¢ÂéBÑ*½öû;0'yrG<ÖÜBmⶈ³ŽoJU™šF5HV0Ü”7í õ§]ÐorÂQÞ‡5°ÚjïlÖ÷/—‘Jí¼J'*É•hÿhü4?gl6/ÉLH÷JšÚâÆÐ^_êë%b’JL1ÇëúrnJ‘qz|š¾¢\Ï&£°ÚUEÛ.§ ·‹à†I'uª×¯)¾÷åÔn¤SyGDDw(ƺѴËRÊ.I2Ë-ûªœa™WO„ö,p“Í™È"v ”^z¼‰ÉÐÇõuä"nRÈ@åiÍ·éßîÁàŽö™=̆-^MNÂ+¸uµ™€-oõe²jô'b­øe2h¹pŒ¦.<˜™µMfïT•WÖ²K9™@„úA˜ò}š«Çöi×2!Váåâ#¹2òï£}aõ~B[¨¿PClwß}ˆ¯L¯/¤¹ÚY ƺ§ÑÙ-ÙeÿIÓ¤–*YÅ|{x}ÙA•¹¹fDÞñüryäÍ»E<×–©rV­$’HK@]W—ÅØtã™ÁÑ¥·$ÏR×µxZȬy$QM$àêÂ7dUû[S®Õ9ÀsYÌòø¤7±[ÂŒÂP¡ã¬d/'ã#ר†WøZ­Çæ)–Å£‹d9ŽíÚ gÇ,it mð o@>…ƒžÙ&2()O§a:ú¡[ሺLKŠ/§Äô§ÅñbÊ%.¹›ŠÊ¯ jÍñrø¹£‡ÆOÙÅcMq­¿*­æH©u-ŠZZ*( e”u Eºf¯Â¼ç»ŠÿKÑþ`GL^sÎáŽm!K‰®£˜¢DcÓ…Œ$ÉÿìÛtï›>o2M¦ö×…œ imk<¦·€´ŸX’Þ)¹°A/N9?göG/³Ç"@%d(Y?WâÕî/Mimb´‰}}£//©rx!I”rIÛ‰ø[üœBíˆØ{•¯꺔úsH>²ò·Â¶à >%a;rã2É" ÚƒsØdxš¥°ÛoÓøý¬¥kù%†i!¶†[Vç¥ÈhÞ¤©öyu­Ôõ®BQáä±Ë@~>i¥“ýBso:˸„;;/œRXâB§Ô欟 xûW/Qá;ø«o­øùñ~=çîCY*Ïy1ý sÖ ôåMFAiksµ’gGà¨Q«½ +ö5ªÊgo¨|7?&ˆÛ¨WÐáÕ¥/ ­œ÷r»^+Jeh`Š¢8P'ØYïBWâ¼Oc3¹¾öF@r;þ/ÓÜÈnõ“q,³Gõk…„LtÐìepTúHçí*58(]Ë|Mñu³†5M/ªïnôîXPÚ´ŸVI#pHhV¨fýÒ·.5ø£¡¡;ýœ«‹~nÇÀ< KééîC[Á©;#Ã|²ªG¶—1óTä¡„|Uh¼Õ»uíYY "ößîüBéóÜ1ƒQaéZ°ø£Õ•ÃR7›à'àáÈr@rnLjqQÝ««[Yf‚Ùî. Šä%‹oR¿Hùqv…HíZa‰<Ó<1½×.eõ†½šú8a‰£[‡VôbhX;Y&fAì?kgˆ÷1rË+g—Q‘âŠ;8ˆ’K˜ÉÔñ )ŒqUAðQM;npËíF1é»Wãõ%·WÏÖlîÚh½G³g•#ýZ°cŒ}_ƒù½¾™ˆ°ñ*‡ãä‚¿‚p©<0*Ï)Qi¸(ñ3’Ï*'Ÿ®ä jœw´Œ×¶÷Ñɪ˜ax…7~aá‡e @­ðüB´é¾2ŽÔ9•”ÁÒè4æXlã +n’09šs þ•sJ­L ç¡;%—z=ŒVÒK-¡¬AY „ËëÈÄQ"¡ä£ÛÛ$$mªP5·ö¡'&Úˆœ&ŠRÌ㈑deïAŨ¿¯l—6<½èGŠ +©37&B®ÒÈ$cýã1û'ímû8RK7ò½ýÃhr;×ÑI}(ÛØ(g5# nY…ž#ÛhrŸ÷[Ïn¯"¿šâ~k'ïe”:ÐenTåÔûü³4 +ÙÔÊ\D”•5]>ÛP€HÓz·S¢Ã:¨¬êÓ*vâõÈe‰!ÈÑÎ"@oišõÛ‡ÓÆ“)’8}QÅŠ™(~Q¸ü Õ¾ì†,`&Yõr1àîæ{Ò]&Öõež-âŠêEÖöŠL·˜j4j*wNdmJ¯¾_"9žN<éVòÞîH™%mKÌüd –…×cSÑä+FÄmgt,M*ØEÎ14Ï$ˆ¡¤íÇ`€À§ +áEî¾óKžeXªÆ+t+è¡^T/ȨÏþWÑ‘ŸçKbòo˜ol{m6Y`”1Y`^(Ò)¡ Hcuú>ÖFY  Ìx2J6#"m¼‘«Ý^ÁdºuÌw×l‘#Éo"D íê–§ã]ÿÕ®2Ï.ÆË 4¤Dxdõm{GÓ’âËMSÛè1¬Ö±JÅ"?RGs$œjëÉ‘Gú¯Qšý<8¹½¢`9Dr÷ucvÞ[²¸²²µ¡Kë~uòñX.dFôå!$«~æŒê( S3e”þ~N 뫵¥þ‘º´°šH};Ëh//>°¨òÂáÔq•ÂƳú¿k™ §Å1º÷21ßk£Ó,¯æ6¶7M¬ZGqSª[È!B°ÞGçZ¿]ª0q,ŠO…"hz¼ÄNÈ9ü³®}ifMPºšp!–V·”z±ª„ +ž'’¢í&Àž¹1”w…:\¤P„¾H¯.~Ykš“Ü&©º>‹ ó‘dž@•ýÚð“þSì?—(ͬ„~ÏØìtÝ“–fçéûÐþzó|:=ƒy_Êð‹8m”‹DÖHÖMÄ~'™×í¿aá‡#Ç6ýN¤c=¿{ÍVÑ’Csõ¡qU>±è¤îj­Ô¯ëÌÛuH³º“#Çë#|Ø»ý¯¶z)û\p1âA<Œ-ËËo@\3CûLOíÇjœR™y]šßU²¹¬Œ“/§U™¹ÉÁ€=6¯.]²9‚݇iƒÏvmç¹b¸ÔìôûÈ™ä´F¶ˆ¹,®~)d5?Æ6_zå:phžöý|Ljۄ tï.ªÙ­õ¼Côm͘k› y‡ŽSñBµ§J0ïÛ®LÌ]uuÄ—ÚÁró»ÁhϧN‚Ñ—X«H‘øÙéѸž^ÕÉKíe ±ù½Ë:.ž”¶1¢¥-)#”à « þì–`x®ÕÌ Ò•gíwºbÛ‡éïÿŠþmóû¿8yN;™P‰RmBOI¤ýe$?»D#íH wý›¦[§™tü[‡Ú91Î`ŸIóïé3ÜG0³Ì^^7Í=ÍÜ-"ÉCêЪÔLÍéÉ=ÏhÈì [¦ùn9Яǽ×äɱ$ï·ö!îìá“Scs¦¼â²_Éúr,gÓVD¢¿ÂiÇáþG.mg=Ê$~7EéúV§§[ê 5Ê ZÖDú½”´XV9¿|m…PŽ<¼ynpGwãg‘wø(ètø„ײM Iû‰T™[¡6¼ÞX˜’Ã÷h~UÈÊ[ ÿ_>LðB×ë:άÓ1‹øÕg´Ôná`’\­LMê†âTøƒ€w""6åÜåG!;©-ö…ªØÁÔe[…b°£¸õ@å%² Ä‘FGn‚§.ŒÁbDOã’¾¸š•œ¯¡ð¢ëMã¸rŸ`ü ܾŸjN€x +j>ž\þÄÁ.ô3§ýrë¤C©þí`VnD/"jÃÇè`Þé®xÈ®|]ìæ}®þå¤ Á”(«niZ´`q­}Îç(ô£OãÍ}–š–Ìçê‘€ k™cWiX“ñJ@¹7!‚E8áÀ9}…&› ãI4ð–ì­Fõ@**(•ø”S¾ÿI6—¦j:¥× Xýf·Q<רv/"ßd°î»õï†S”cÁ,†¢-U¼™¯ÙË"~Ž»fä ìÁ_‘‘~:±ßæ}ˆÊÆ|gø›%˜ ìÌo4k} Ë#OfýÜPO-Ô ‘Êió5QP7§1xøç~nÛÁððŸæîó{{) »KyÆbƒÐhÀ‘RI*”Ž8„?g•s› tQ6z>«kb%ã‚æá#{i#@(’I*¯¢âf^T¡nõÁÄ Yú)¡é7‹:Ç,A›ÓçÜÁž:´¦£Ú?ahXõjm‘œ…#„ Ê?ýÌ ú6qaevxÞGiFv•I2«\š·cð¥x–~-ZW?ÇF¹PÙ§[Ë%Œ0 U­®Ú'§ë5S)Eª±è(Aa–¿Á„ˆÙÐip^=“Êï @ʶñ°ŽI3È°Ã"§ x ð¨ÆR#’a½þ +e?— äú^Ÿ ooeq?ïÔ²úJU¤Šwû1C§CN'¾ûÔrpƒ'#b>óä?gÚõ=?BXøZ[Fc1¨A͸pEjGë½wîÇ5'%î^¬F10ûÐ6±ÃëÂí5èø¢’Bc‰š|#w~õ­>]ò©d÷·ÀJ÷`~l±–ÏQºiîuycÇkUhôˆå„LjXÿ½&Õøbþ,9·ÓW†?¼ßiO÷’ø¶cë[Á ZmÕÌ–W¼’Ìdf¿gŠÄïQ$øŠÒ¤{ ´Q;ìuF\·³÷{Š?Ë·pËpÐO^ÛMlÖÍ}4†uo]89È +–õ8ñGø‚Óâ4Èä‰nö·5ßøûz/oü½¬Ûiš}£/—]ø]ªƒÈÝÌ@wøOîÏÆ¿ü¾TʳiüH’O«ñø·aÙÚóŽB<ã"íof»¶· +ÑßcR +Ç“2qc_‡5uGw¨'éåÞÝÙÝ5Ì/)Â\,VÑŸ³·zðÚ ó*Û_5½Í݉{Í6Y¬õ C€ŽË# yxŠ/5P¼¹mJf÷®Gc¸xýnQ)U1±þ•r?¡&²³úíÔÉu¼ú‘±¹_MWøê‹»?|k.”©Å<×~ŠI(e†K{U 9"É7‡ªÑ#M׶¯õ¦µìYïÓH]bdxГΠË’´«de½sòc ­ëÉ—Uý“A¦±K$µ{oB↊gf©~EÄwž¾uÝðùªêVbì aHîC¢Ì±Îæv(IaÀ1Næn—ñŽ«´µCèñsK´¿&Ïl‹4òEºÉ$ñpr¼úb:‚©mù9fû+^9r‚h:)@ôütDèþ_»[”·{ Ó]úÑÞŸï9V.‚ËQ,5G)ÁÅwŠÆy_ãñ÷$ ƒDÇã‘çÑ«½oOŸê÷µŽÚB¼â±Dõ&³àÀ2«;¯©ôÇÇ»(;`#oÁD`Gê­cko6‘:ÖIš6ôÌ~¹Yع¸¶æÎ@n+Ö¿³Ûv7ü{‹)“)p“·_Ö +T÷3FÑ<Ð3̶ÄUC8eåÈŸM½>.A}MÀ©Ë8{œc.þÿÅ~<Õu h5%ò´ÆXGÔ®‹F‹$Ž¼¸¤*…ÝxÖ…i½6®F&|[Jˆ%Vrjzd×C,-ÉÿOˆÇ,«»mB±€Þ“–å‚´øyR†RUC/#îëz•µ+«NBéu¨ér­lИ+Ì»påů ÅMóQˆO§ –´NªÌâïÝßA©ùúÑÏm5meˆ‘`Ï Ì¡þ?Þ¯-þÇÙïÖ0Ó¢?h#ô|ù¹:žÐ¸q@óèv©F^[ú¾\¼Ò]gU‘žÿÑ€_An;KQ"·ª.¨Äž%©1ãÒ­þNdcÇ°6£Q9ÌÊ}OãñßI!Õl9®ç³gžæÚHîd‘Œˆv¿©7Q+­=6áN=úåÒ‰äÑοGö.Ôo®5+‰í¡Óž;«dU¾¸‰’hÒ+fãÖ4ß8zž˜QÛ8ð€IÛ§ÇÞÆ[Ñçøè„žÚ i¬[jKªØI í¤vË +ˆæŒúªñÍ+qતüMF¦Íµ2Q‘‚6-щoºi¤yÇórB+ ½ìDòA%ÃC4³*dx¸d–Œe >ôÊ2i°÷ü}ÎÇlä_¼~¦_cùðéÍ­ÝEíŒq¬õ7ô®Ú:ˆ^9hˆ7ç!gªŽTí˜ß“ŸW.¯#|QÛ‹nø}ÿoº÷y}µÄšà–ò]9íWP¾¹QêBn¸ FHË&íÏ‹1­<;fį“¦ÔÌf?ˆ•ieÑôû Û2Å$Õ4õŠËSQ#´L®Æq"‡ŸÚ‰ù~Õ)]ð"w÷ÔÆPˆ'§àЄ¶·Òïôx$µ%kC/(¥Q"Ü‹QÏåðý®c¥)¾LØ;µGÞÎ-|᧴1r´»šRÂ7T0ÚF*Ì¥<ûýÁ–ž] ¾kbˆÄŽ©k©Ãé´‚>fEøÔíõyr¨iDPVŒvßzf<ñ˜nì´º¸å¿ïò¦+y¤Ö|ÈMÇ /Q¸Y@Üsw¥jK²/ìpߧ|Ì„ê1¾tóZÓyäcßøû[·Ý‹Qeÿz®T$FXä@¦y­k®­ÇÇ3z¿‹¯ìèÝcHÐí®&¸ž3=¦•™æâÏê‹eX½NMû#ÔâÝßcöi[#)æSAõ~<¿Ð÷ZnƒuébÏ-´ÿ¼–ÒÓŒ‚béýçÖÜúºñ¡ º° qŒ¥×ñûSÆvþ±%»Ñõ›û8£¶·I`ŽÞ¶¶27ÕL)èÇ›‚ÅêÝö5û5 ´Hà åö2-+Iˆ9ÓïÇîn —гZ4OX®B†B¯ñ}ÔW}ê–N¡¦qŸ/ÇÏo$Ÿ¢ØCÆæݯ'ÎÖÒ+FGôçñ`­º¸©Üä¥2Õ’àLIóý½ô™}wKžÖq8ô¸Ï$S4ˆì[ë¯Uõ»s¿¸QË!à ~ ö­‡wãö­‰tË™ujÇÔ5ix1 ݺ~Êrðz½ðï-Áb8bl¾_$MêÎc½F˜Ö+‰¶ Bõ8 +ñ­y¯ 0D†D^üøƒÉ.†Ìi‚9-=)¤…ÀŽxµys ëo€u—j ¶­2Ã+æÔc\ÿ³ª”$ §Ë¨j+êÈ‘ÙÏJé%Z±¿­ÁBŽ«ŠÐoñ¸ ®À6 b'Ëí]s«¦§¨Z^–²Ø¬ëRi!šhØ5c·þõÙõ"û_µ†ê$~>hžK˜?ÙýŸÚôKsÉ#¿ªò(büƒ–~<™EkÄ©éýk˜õaßÂ@¿ŠUuªêÓHÜn-í̇÷1JÎxÀIkÇ“8ߣ¾O„uq%–VOŸŸ¸A†çà‰®n¹ Š­ +*9‡_µ°§Pc•¹@›ë]J>²Šæ퀄´Hî"”DÌUáýªš)ξäXcÉÈŽgñö¥¶—ÿ\½ú­…¸–yÜô·h N-G,ÙiGˆTm3 a;•÷r÷tûÐÉt“z×–ÓAu3¿£é< } ä° +ÌjÍñTmö²GnmÊãVÓ4âòa4Ó†25¼K$1!4‘]—â ÝiN¸8IäÛÇÃÕõÒp¢­´D}npy—ñäò(yT÷ÁÄjšFHñ“~ÿÇÞƒ‹T…ç dï#z³^¼hŒ* + þÍ"§ìlJQXK!âæ–5ŒGs5ÁswÂIfœ*‰!,„’ŒP̼zFf'¼ïšÎ[?øëý¨;o6à ÷ÔZV{x­} =PreqwEc,x|tåÄmJòÁáuûNÛ½ Ê:æ›y¢C$—pO4,a¸º,©Ï@”©?·O»Ó5ºŒRŒ_ž—C©ñ1DÌŽ>¿¯â>ÛBk^v±´¼ŽxSco%Õä@Bà2:!¤eðëÛ,æ•oϹÂÕö”DdžOPš{ö1iµ @j$éqµµÄ>¥ÃÈ‚@¥Á,C!w=?m8ž‡3@êæée IünÕ•Ê\Éõ«ˆâº¸2¬–ì‰ó¢ÇT–&Bc©,>íÆ2–Û4ÅÝøòD¤âkH.9H}K¸#†Ý®@j†Y×–Û¨}·n†»`å¼ä±Aw¬!X¯áVI$D’TŽ3:I30™nzmÈÉË⪀ÌOÑ(ǧãÜ×<›Šzßâ’}Jæç[ÙÅÅœwO!6ët’^hãjò¯+ËâÐe±SQÜ쎸¹Ñ$x®ÒÚ+ÛyÇÖL×™£€sZ?x¢¿e¿WRª¿“:OíSö°mv»M¿«<´vJZU&)­çhL¡YknÆ#É9Ñz§ìï¸ÈÊ»ÿc7¿ÇzÏM›G’ÚëGW‚WÔšÞ`‘NʉÂ;y¶¢G,²S®ì0’'bH”v‘ú¾ï>{üÝtšėJºq ÅÁ+0>‰YéÍÿy->>ƒu¯o‡'doÑqã;P?´¡m´SÔm´¸m&ŽÒ8^). L–æxc2BŽú´f BZEþ\œ¢ =ÿc:ƒêçû?uú:^š´ßQ¾H^¯IËú±»ú“+¨¨åÇû΢Ÿå –ãa¸û™‹ðý¿{w7ši±KÙ#Ñ Sõƒh¬î`€5g·Þ@]™·-öM0p€n·óQ:ü_ÚŒÔ/ô»‡kKžQ˦zPZ"ÆÈìb Y! HÜIN<À5Ûج§µÇø¾·ºF§2Cñ…ŒÇÒåQÙ½{e˜Æ±°þë‹ýšw®5(ôÛñ͸¡0°¼F°Þ5ÌкÄdÔ!tWårTg—œÀ¹;šðŠ‚Q£a Ý¡u{Ù-EäÖzÓúñ5Äô¸n)3Í'¢Ü”£GñpsÒ¿9D_6S™4‹W»KÙgµ·åÄ}k€¦=Þ_ˆ¸o…¢-ÿڮø˜mDµø€]õþЇ’ßH¸(ŸÒd ‹½™ˆ†å ¨ªüŒ’†N5{·!îù– +þ—ãô|?T §ÂZÑ⻸æ¦_ï^¼!N/ÆF‘¢^NŒ?hrñoÍgˆŠþqûº*ÇúCM[«tÏ«›pnæ’YŒ±’褥THÿž Ÿ÷=2²·%Éƾâê¥wyqwwmo£ˆàÓRâHåT<¥EcæáX/ +<6®ƾ®lLAøø£ÞÛU†Â‚ØÜÉn¬Þ” eGn%L@ºý¦ø#¯JTÓ¾åLjÄÔ€âýß‹Dˆ®Vi⾬fÖæ!FÇJŒ­1Ç’+vçñý•"'—Ûøü{™O„ +'»ûUî &š+xÙȾ¬/Ì †.7Y@¯×âÜt$œ’7ú¿œp@"¹~=?±$»½µÒôó%‘’Y-¦/3z~›V_Jm€dv-Å›Ä7!Zå´dwc»÷~?‰²åw§]ð& tA Î~Ë0SÆfb½dÜø7µq–Ä~>^ä`‰3á????#øê¾ÚÇ̶²Gê³z‘ˆBÜÓí\8 ÂU|h·±##+ñîòr²iæ‘ôý¿ÙÜ«5•–«w²ÄU$S‘¨gu‘ªòJhW ±;²Ÿƒ`0 ˜š R_©è¦ùd»‚eyÜA1qVHÒ·ï8ÕyÀŒ»ˆÖÍfê¶FiiM¸úÊe™dâU¨)È«Wâd¾!‚aŒ.éZ[[«Èà·º·E»i¢œO‘>©nZ‘Ä\qäUëRK-k•ÊF"Èn0­Uìš]væ (¥n-’y´÷ +âãÓbÞPÌ™^?°i€K`O͉1÷õüròKc°ÓI–hµ&¥ ÂÇ5ôH(³¼¬"×íûýåœGŠ«fóà¡îý¯~ÿyoþY?䤿ó^aq®ïðg–ÿå“þJKÿ5ãÄW€;üå¿ùdÿ’’ÿÍxñàÿyoþY?䤿ó^> +endobj + +22 0 obj +<< + /Ascent 0 + /CapHeight 0 + /CharSet (/g3) + /Descent 0 + /Flags 4 + /FontBBox [ + 0 + 0 + 0 + 0 + ] + /FontFile3 28 0 R + /FontName /KPPLPG+Times-Bold+2 + /ItalicAngle 0 + /StemV 0 + /Type /FontDescriptor +>> +endobj + +23 0 obj +<< + /Differences [ + 1 + /g36 + /g74 + /g76 + /g73 + /g87 + /g3 + /g82 + /g79 + /g89 + /g72 + /g75 + /g68 + /g86 + /g69 + /g81 + /g92 + /g88 + /g85 + /g80 + /g48 + /g77 + /g83 + /g71 + /g17 + ] + /Type /Encoding +>> +endobj + +24 0 obj +<< + /Ascent 0 + /CapHeight 0 + /CharSet (/g80/g71/g75/g73/g87/g48/g69/g81/g83/g74/g77/g17/g92/g36/g72/g3/g89/g85/g68/g79/g88/g82/g76/g86) + /Descent 0 + /Flags 4 + /FontBBox [ + -32 + -277 + 923 + 777 + ] + /FontFile3 30 0 R + /FontName /KPPMKC+Palatino-Roman+2 + /ItalicAngle 0 + /StemV 0 + /Type /FontDescriptor +>> +endobj + +25 0 obj +<< + /Ascent 667 + /CapHeight 667 + /Descent -219 + /Flags 32 + /FontBBox [ + -177 + -250 + 1141 + 880 + ] + /FontName /ItcEras-Book + /ItalicAngle -2 + /StemH 44 + /StemV 60 + /Type /FontDescriptor + /XHeight 494 +>> +endobj + +26 0 obj +<< + /Ascent 667 + /CapHeight 667 + /Descent -224 + /Flags 262176 + /FontBBox [ + -169 + -250 + 1247 + 909 + ] + /FontName /ItcEras-Demi + /ItalicAngle -2.5 + /StemH 98 + /StemV 140 + /Type /FontDescriptor + /XHeight 497 +>> +endobj + +27 0 obj +<< + /Ascent 629 + /CapHeight 562 + /Descent -157 + /Flags 35 + /FontBBox [ + -28 + -250 + 628 + 805 + ] + /FontFile3 32 0 R + /FontName /Courier + /ItalicAngle 0 + /StemH 51 + /StemV 51 + /Type /FontDescriptor + /XHeight 426 +>> +endobj + +28 0 obj +<< + /Subtype /Type1C + /Length 29 0 R +>> +stream +KPPLPG+Times-Bold+2 ø ÍБÚg3Times-Bold+2‡÷Ž|šøì½ +endstream +endobj + +%QDF: ignore_newline +29 0 obj +85 +endobj + +30 0 obj +<< + /Subtype /Type1C + /Length 31 0 R +>> +stream +KPPMKC+Palatino-Roman+2ø3 kû©ú/ù÷F÷J—° + "%(+.0369Š1Š]‡Šz‰€‡…‰†ˆ‰‡‰‰ˆ…Š„\oеš›ºŠ‰×Š§aŽpŽŽ†Œ‡‰Š‰ŽŠ‘‰‹˜ŸˆÄ‹² ÷BŽ¦Ÿ‹™˜ ŠŠ§•¼†Ž‰rqŠqY‰ñ´¦˜›“”–’“˜™Ž–˜‰‡•”‡•…•ƒ˜‡Ü€}~y{ˆ„~…{~vwlltq|w~„{†y„z‰m`mwt€qxÎŽûDØøŸû_…‹…†‰p‹sutz‘€Ž€“‚“„•…“…•‡‡—˜‰œ™—ŒŒ–––Ž—›–™˜š—…ž‰€‡ƒŠ‰ƒ€‹~yŽ„ƒ‘…†’‰‘‡”‰”‰•‹¨Œ¼÷[‰©£ŒœŒŠŸ—¹†ŽŠ„~Šz‰l{‹ˆŒ…|‹qçǦ•v~o~iv‹Y>xr€lvŸŒ›ŒøPäù%“ˆ‘‡…†yŒlŒ_Œ`_ûvŠ6Š\„Št‰z‡…‡……ˆƒˆƒˆs‰eŠl÷ Ž÷ +ˆŠªfŽsŒƒŽŒ†‡‘‡‘‰ŠªŠµŠ¶·÷ê÷~üx«D…Ž€Ÿ Àœ²–£™¬ ·¥Â÷=÷ôûúŠ6Š\„Št‰z‡…‡…†ˆƒˆ‚ˆt‰dŠlÕ»‹¡¦¹Š‰ÍªdŒsƒŽƒŒ…‡‘‡‘‰ŠªŠµŠ¶·÷vŒâŒ¹’Œ¢œ’“Ž•¢²ŒªŠZhŠusnŒŒi{cmG],û;ûòûNøt¼pÄnÌŠomŠlkkŒŒil±Š¢‰”‰¾Ûƒ²° {žž…‡žŸ‡¡¤ Ž‘›œ‘¡™¨¡Ó¾‘”–•š˜Ÿ–¢“¥”¤§¨¯„®|ª|§v¤oœ›ok”guu‡„ww„}ƒ‚„FIìŠ×´‹½Å›Œ‹ŽŠŒŠŒŽŠ‰‹‰ˆˆŠ‰‡o}XB‚o³¢Š‰Ž‰Ž‰ˆŒ†uŒdŽR‹SUûm}Šc‰D‰r‡b›…÷ø¤§”ª¤¤…~  ~œx—q—q‘keU~^rgfqgy\vxŽ’yy’{”}–‚”…‰‰–›÷K“¦›¡¤œÛ÷'Ž¬¯Š‰³§Œhy‹‰†‡ŒˆˆŽ‰ŠŽˆ“‰—Š›‘Š¹ŠàƯ¥”š”™™™Ÿ–– ¡‘¤¦£„~Ÿ~˜y‘u|iX9v‰X†;µ©Œ¡¥Š‰«§VŒƒ†ˆ‡Ž‰’‰•ŠšŠ¨µáÏŠ³‰š†¤„ ›šy™s––uqqrr†p2=Š²£Œ—‰ŒŠŠŒŠ‰Œ‰ˆ‡‰ˆ…l|\I‚o° Š‰‘Žˆ‡Ž‡Œ€ŒxŒlŒoqQŠ3Š\‡Šz‰€‡…‰†ˆ‰‡‰‰ˆ…Š„\oɸ¦‹îÙø$Š‰Žˆˆ‡Œ†Œ…kŒPŒPŒQSûAŠ3Š\‡Šz‰€‡…‰†ˆ‰‡‰‰ˆ…Š„\oŸ§°ÏÀŠ‰´§gŒwŒˆŒ†Š‡ŽˆˆŒ‰ŽŠ‡“‰—›’Š¹ŠÝÙŸœ„š‡‰›šˆ›¢žŽ‘ž‘›’¡–¡—Ÿ˜žšž›—”’“”•”™“—”›’›’š‘žŸ¯„ª~©}§v¤mžžlh”bgp‡‚y„hnTX¾•‹“Œ”Œ‹ŠŠŒ‰‰Œ‰‰ˆŠ‰‡€…y„t„t…v†xˆ‰x‰…oÇŠöûœŒ—‘˜•˜š™˜™œ•’”Žž¤¤„~¤£Ÿw˜q˜p’mhe„j}l|lxts||sp„mts•uu•w™z÷PÁø#øAz™x–w’“vvŽuifƒ{ccyovzqyrƒmjtw”x”y—|›€œ€¡‚©ƒhrry{~ƒl…{…‚„“ƒ‘ƒƒ¦‚y~o{cy|ƒ~‡~†‰}}q“rštšt£x«}}¨²„¸»•Ÿ¶·Ÿ¬¦¡®Ÿ®—­¬¤†¡‚Ÿƒž}šx•”wpf!‰gp|ƒƒ†‘†’‰’“’‘“™˜ œªŠ£¨¥–¤œ£žž˜£—¢’£¤œ‡„žå’“˜˜ž‡”Œk\‰NŠûytŸž¤•«©¥s¡ s–kbb€ovyyur‚ovw‘–z|•}œ‚¡„ †¢¢¯•¨žž÷fü1˜‡•†“…“…‘ƒ€‘€Ž|Œvr„t}s{svxo}nlƒi—¢pr£}¨­œŽž’–Ž‘ŽŽ˜•¥’‘’Ž‘ŒŒ™©‹»«ŠŠ“Œû Úù3€€†~||~–€–˜†šš‰˜‘––––˜šš†˜€–•€~‘||~†€€-þG£¡–žž—ž›œ¡› ™¥”¨™²‘Ëá‰÷”Œ®ŒÊŒ¸Œ±­œŒ™Œ”ŒŽ‹ŽŠŽŠŒ‰‰Œ‰ˆ‡Šˆ†kyXEƒo•™‹˜Š“ŠˆŽˆ‰Œˆ„Œ}ŒvŠhvƒû¦~ŠoŠa‰aˆl†y‡x„|‚‚€‚€…‡„‚‰†„ŒŒ€‘iŠ‹ŽŠÞꀅ}{|‘}–€~—™†›š™‘––˜—™›š…š€––€}‘{z}…€€Á¿û¥ˆ“•Š–  ”ž•›™˜šœšªžµ÷÷œ¾÷­Ô°°™¡”’”˜œŒ¨‰onŠnljŒeŒn¬ˆŸˆˆ‘†‡…‡Š‡Š†‡{|drKpMz_tqQ¨{°y¹kצ~®~³‡š‡–Œ“‘“Žž­§‰gfŠedcŒco¢ˆšˆ’‡‘ˆ’ƒ‘™mž`¢RØûUše—k•n~f{hzh€r{ƒ‚‚‚‚„‡†ƒ€‰‚ƒŒ††Œ†Ž‡Ž‡†…~s@•…•‡”‰÷¨÷ Ž§´Š‰Â¬mvŒŽƒ†Ž‡ˆŽŠ”œ•¡¾÷÷±Åû)‘„Š†Š‡ˆˆ‰‰…ˆƒ‰„Št‰gŠj÷2ž¯ˆ¾ˆ¬qz„„Ž„“…–€ t½iÛûcø~ja mI~mûû¨f> +stream +Courier$øøø …ûùù·¬ ÷N÷UÂM›szEuroCopyright (c) 1989, 1990, 1991, 1992, 1993, 1996, 1997, 1998 Adobe Systems Incorporated. All Rights Reserved.Courierã‡æ7aö¬Ãô(`™­ÌäNrÄ;l¾Jmè]•Âá!‹ < Š +( +x +Ñ  N © ä  J œ   > Š 士Ý/l¹]©Ãß";½hÆ!hÛ V®#™ë0™þKÒg¢ìN”Â(=£ò(–:QªãVl˜Ïð  € Ô ç! !@!a!•!¶!Î!ñ""M"š#Y#Á#Û#ô$$h${$¨$½$Ü%%^%„%·%Ù%ì&I&¼&ú'w'Ó( (Û(ù)1)­*K++$+;+‚+Ö,>,´,ä-A-ž-á..:.œ/J/00$0©0Ü1H1Ç2&2—33c3æ4y55o5Ù6;66Â77E7x7ö8R8Á9%9‚::à;B;·>¿?`?ó@±A‚BB|BõChCÒDD=D}D«EEE˜EúFWFªG6G×H:H­I"I†IÚJ=J‡K +÷ ødw÷‚÷(ÈÐ÷íøÐ=ü·à¹û«i¦kanmmm©m²³§§¬÷¬÷¸‹w÷;÷¢`øIøÐ- ¢û¸¼û,÷¸+¢û¸½÷ À÷7Áÿž€ÿ3€g¾g¿ÿp€¾hÿ2€ÿÿÜ€ÿ2€ÉÊøŸ÷ Àû•÷7ÉíÁ,™÷yX~ûyû$™÷yW}ûyûUÑ÷û7ä&Vì~ûm¾™÷m÷#~ûm¾˜÷mÒg÷l€û7û$•÷7’÷3û,Á÷í÷*IÀóÁ]À÷ÂíÁjÀ[V€ø‰÷;Èlµ'¥&¥Rš\¤¿ÂÓ§Å[¹º|u²k\Á÷*UW]l›k™hóT"KŠ)e#ŠuŒQæhZ€ÊrчÉn§~ xe=1zIZZ–ªg›ÃUû3Á[´¯w°¶‰û+Â÷,V€÷”ÇÍØÃ÷Â÷Ã÷ÂõÂÈáÂÉÁýÿ÷÷ø†ÌcÆ5@[OJI¼Q×ÒÀÄÏÿTŠjsh_cl¥´´¦©·¶¤jfý÷?üÌdÆ5@ZOJI½Q×Ò¿ÄÏýUŠjsh_cl¥´´¦©·¶¤jfýõ÷Œ|Àü3û1™XÂ`Â÷5Á÷kÁè‘Â÷p÷ zøËÂûr°¦°œ¸”µÚÁû a|Vpdvû"÷^‡k´²¦¨®Ä²±zu©Ÿº¦d]žX9YXRei¢h‹’€…º Q…6lQ°4öÂÁ¡³°z®YºKéusnnTY[®Îк¯±œøÐw÷F÷?÷ñøÐ,?ûË*ù}÷²ÂøbùUEûWû,&û'Êû&Å1À\ßC÷÷$÷³õÀî*ù}÷™Â÷Ð÷²ðW÷,E÷U§WÀ(³!ûû$Cû\7ÀÅåÊ÷&÷'÷—v÷âw÷›Íø{ø#zÒû$W‘÷.C‘û.û&¿{D÷!f4ûÈiÙ÷ +Öû +È­5÷÷RÁ÷¦Áø–÷RÁûN÷PUûPûQU÷QûPÁ÷Pû÷Ž÷I÷=÷ò÷ ,AûŽÌ÷qÂ÷÷Ôø_÷qÂûÔT÷ ÷~÷ø¹ªo©cekpjm¨nµ«®£­û#ùàçø0øŒù<\ üý˺vÂøzÂ÷Â÷§Áø„÷¾¹‡ãdÌÆh_§Hwwˆ†y8rg0€9‡lˆ^~+Ÿûa÷@÷M’÷léU‡‚&zû!û +3pÖ£…¹„½½÷¦÷÷·²td ¦X‘NŒN‹Âø¥w÷­ÂøÂû?ø¥û{XT÷D¯ü_ûDT‹ÂøoÁíÁ÷¤Áør÷UDû¢÷?÷õẼÚ¨ƒ©~£Ìh?§NALpWYDÁÎÓ¨Ä×Ï[;|‡}†}jQ#M§a»ròuFc16Ð;÷ò÷Ò×èìC÷ LWaCi3–çî蓨׻\Qòû¤9=pP\+šåí뜵ØÌbE~Ä÷IÃ÷ŒÂ÷ Á÷­ÁøŽ÷ÚÔ{âQ¿©j[›[û@7-0Å1÷ Æ˦À¬û7BL0rƒnj‡j„…„WRα²”²÷ +¨é÷÷PS²f}O\D4\ÂÒÓ½ٲ·|i¤ n›]Œc}÷ ÷$÷ ÷÷ø ÷Êœz´Vfkpjk¬p±¯«¤¯û›œz´Vfkpjk¬p±¯«¤¯÷÷ ÷Ž÷ø÷Êœz´Vfkpjk¬p±¯«¤¯mûQ+CûŽËŸvè¹øŠÂûô÷'÷ô÷'Ãü"û8=÷ÁñÂàøAø–÷žÂüATøAû0ÁüAU vøp¹øž÷7Ùü"÷7T÷ôû'ûôû'T÷ ÷-v÷¶Â÷ Á¦÷*Â÷Àöøuø4¦„¦€ ËjD¨BPP{y\ûÁÉ›­³–³÷¦Be)ûvB}"ÂÆÕŸ÷°÷ úû!üªo©cekpjm¨nµ«®£­}°ß¯÷n°÷°²¯ô¯÷«÷(°øÉ÷½Øt¹i´Ä[C¤AûF*ûû4ûÍû,÷QßᩲÌ|¯X3FzI@H«Ïcu°¿»÷Ç÷÷B÷óKû"2^GYqpŸ®¢”£‘ ®÷f}YÂzkŒ~JC+*požv~–›‚¡´¯©¬žn©iºÛÂÞöûe‘Jb,Qi„±¡Á¹ó½°’bz‹Â÷Â÷¹Âd²…÷h÷P÷eìøïÂUûdø™û‰T÷#ûKübMT÷hÂ0¶÷÷µ¸û)Tª÷tû‰Ü÷ ÷É‹Â÷[Ã÷cÂ÷ Â÷«ÂzÂôø·÷*ÙP¶K—ø™’«œš¡›£“«¨§„¦€¢Õh9‘?û”TÙüb=T÷ÌôÈÇ•·°ô¡¥˜®®ø.÷ n€nvyni^ˆ\û ÷c⧭‹†·º†²eXô±û¡m{lk|zffŠaû-÷[÷&¹ºƒs²£|šom~Âø|ÁÍÃøÁøÁÈsºdVHpGû*ç÷2÷M÷ÀÖËÆl\·:Á÷iUNmž¦aZšVû1#ûû-û9æû%÷KÚب¸È‹ÂøbÂ÷Á÷åÂøÂ÷¿÷8=Ú"¢‘mjŒgû†TÙüb=T÷j·µ’³õžÙã÷KTƒR~Rp^Le@}Aûøbî㳈`½«o§J4‹Â÷_Â÷`Â÷Á÷4ÂÕÂZÂüúø°÷STûû»÷_÷4BÂ÷^TAû4÷`ü÷µûÂ÷SüsTÜüb‹Â÷)Â÷–Â÷5Â÷®Âø½øâYíû,û TÙüb=T÷²Âû-÷)÷ÌΙ󡪗´´Tq„rwWlM†Rû÷–÷Á¾}Z©–yqtûÂ~ÁÂnvø¬ÂµÃø/®øÈ÷¬É}Èp½ÎfBËû16Y7\q\|SHžû#Ðûío§ƒnppnpizš^£¹ªšº¹²t~´®‡˜™‰™¯®˜¡¦u·}vqqŒ‚n›ccŸ]||†‰|®™’—’—–›®÷&÷ó÷PTŠû[ûfC1û¾÷M×¹Ÿ¯صծÅÃØo3¸Ÿe’[[‹Â÷PÂ÷oÂ÷Á÷¤ÁøØÂ&jÂQád¼Ì–ãµ÷ á\Òû û¹TÚübü™ûCT‹Â÷ØÂ`ÃÎÂ÷2Â÷2ÂÜøìÂW÷š¼¶¼d£–yyŽwXdhgo°}i­X_momoܸ T¿üõÂX¼÷¥¨Ÿ£­¸ÍŽ?ûÅöÂW÷š•®Ì––‰…”¬t‹fdû±‹Â÷×ÃaÂ÷Á÷¢ÁØøÔÂ9÷”¸°„·m¤œvl˜[FHm]XØÊûSÞû×8T÷pÂ8¸÷“¹µÏ¯È¶Ã~Fû“9TÂ÷ñ¿ÂøÂø¾÷mãR÷"ûTû!û4û#ûí+÷0÷,ëí÷TŠ';BûûLçÜèÔÞ÷÷5­ûUûVÂ÷Â÷äÂaÂïÁ÷éÂìøº÷q°ƒ°|ªÜÞcA±>5Og\gìÑûTÞüš8T÷¶Âû-÷dcªÂbæì÷ìí÷ÜTŠû6I9.=ÒôæÌÝ÷÷­ûQûVÂ÷Â÷äÂa¼Â÷éÁìøÚûVÂ8øšÞÂûÜGµmI²9>=e8c|lƒffûì)÷ÉϤĺûeû-T÷-ø1û/M996Í÷Å­÷÷÷Ï;.‹Â÷ØÂbÁ÷[ÂаøÌ÷úˆŸ‡€œ¤{q”l,LATJÐ÷ûHT÷ûØûTø +ÂûV÷]°ó÷¸¬¿¤¢…i’Â÷ñÂèÂ\Á÷¯ÁlÂèÔø˜÷ÞP FF/ˆ]¨|•€É㘶ØÂÂzpµPÁ÷2Uc¦^U˜SûCV5r’pžzÀ[ØÕ…ä·‡¿’¦e„{…AûƒfLTž°[ÆTû>¸t¼¼uÛÔ÷ÚÄáÂ÷äÂ÷#Áø—·…ÁwW@hGpq™pnšƒ¯ª÷€÷–Âû–÷UûDTÒû˜û÷y¿ÕÖ¨¦ÊÁaÂ÷ØÂ÷Á÷¢ÁxøÍÂ9øûTÞ¸û‡YcW_Kpn‘švm¡„¯¯÷©ûTÞûb—b®psª²‚³²¿‘Ô×xH‹Ájvøš÷n÷#÷fxøÞøÂûfTÔ¸û%ûÙû%÷ÙÕÂûnTá÷?üË÷?ø‹×Tvø¤÷7÷‡÷2xøáøÂû2TÒ¸7ûÃ5÷¦\7û¤5÷ÁÔÂû7T­÷üÊÚ÷ÚûÈôø‹Â÷Ø¡÷bûP÷Y÷÷NûK÷cØÔø×Â?û>÷AØ÷%÷+ØÂûNT´ûûû÷½ÂûYTÚ÷'û*äû>ûBAT÷bÂK÷÷÷ûMTûVÂøšÂ ÷Sû&÷’æ÷GèøâøÂûGTÃû:û¿û-÷¿ËÂûSTÎ÷Lûõ*û9ØûT÷’Â6÷¸øš‹Â÷ØÂ÷Á÷­ÂøŽ÷'T/û£÷Ú÷ܾüû$Áä÷•ûØûÛWûzÂøIvøhÂ÷¢Âø8ûzÂRešÍ÷>¼Šã?½×Ìټ÷BͱšÄÂZ‰P€sZ}n‡kjû ûxmDiWÔiœmûû jk™n£ZÆ€¼‰ûú{÷§¾÷Úûú{Xþ{ûzÂøIvøhÂ÷§Âø8÷…¿D­x©÷÷ ¬‡«}¨s¼P–ZTć±|IûBZŒ=×S?YŠ3Zû>Ie|R‡T¼Æ–£¼™¨«¬÷ ÷œ©Ô­÷#šÁƒvæøF°ø¡÷‚Y¯v~lTiymœjПfo™aQtf`fºf§Ÿž®®ž­zy®°z®°y£°Ç²»º©÷ß÷ ÷‚÷(È Àø ø©m©dcoojk­p«µ¨©© nüŸyø_{üåÂ÷L÷-JÃkwóÁ÷Â÷Ážø÷0|ºjWPrKû eݾ®ÓÃÎ츹}t®ÎXÁ÷-Užb®hšh˜e÷!Tû"A„+Nûû àGà†û#Â÷#žÏ©À­~ÂqÂ÷WÂ÷dÂ÷&Á‡Â¸øœ©v¶€zmwh´kkš“mt|||jk‚|nˆÆÀ–Ì£¦„¦…¢÷b¸ût‚©€¬«âÙ¥¾¾¾v]¤¼šÀpQÁ1"Â÷(Á¦ø©øÄøÎOŽ…„Œ…ZY€lliiƒ\ƒY‹ˆx‰€û…TóQûÊ‚Y…mnxzq†ezyŒzsRÎ÷,œÅõŸÆ÷Ðö’Â#‘¨Þœ¯ðžˆŠDÂøµÂ÷ +Á\ÁaÁ÷lÁ[Án¾ÒÉø}÷c¯r¦p ûk÷9tƒ”–ª¯ŸÊ÷:1Á÷%ûKhhŠmnyolk u¡wäŸylƒXjPhžl¤x÷iû7¨uŽ|€†ujÔûRåUû%÷\¥¨Œ ¦‘¬Ÿ¹¨z¨tžÑ‹{—„’É垌ȣX‡|€_Gáû/÷ +|—z›¡±¶£¥÷4û Éœ~Ÿyt÷!¼÷å¼Þ¼÷ã»ø¬÷-HΪ³š½¾½}¼k°ÎÎkªJI«d[šYWVzleIÎkjÐIf]\aW›W«eGHªmÏÍaû†¬¿¼œ©³ÌIe÷$:I5/?ÕêÞÌàóíÏ95øÐw÷ê÷ïøÐ,¡û¸¾÷Õ÷‹w÷*÷î` ø„÷Õ@÷+öûû@÷+õû©øàøCø˜ÙûL÷$÷L÷$z»û†ûT÷†ûTû/»ûM÷$÷M÷$z»û†ûT÷†ûT©ø÷9÷˜ø=ÙûM÷$÷M÷$z»û‡ûT÷‡ûT©ø÷?÷˜øC÷rû‡÷Tz[÷Mû$ûMû$œ[‹Â÷ØÂë÷8ÂõÁ÷“ÑUÁÚìøyø¦÷Eû÷Eü¦ÂÚ øÜûTÚÜûØ#Tƒøüq]xr\z„w‹uuS!TõûØ!T÷žÂ!÷ØõÂ!½À˜­Ó¡¢‡†Ÿ‹Â÷ØÂ÷€–÷À÷¤ÁìøæÂ"øÏû%Tæü˜!TÜ…øûìqn‘o1c[EA TöûØ!T÷Â!÷ØõÂ!·¾ŽµÝ¢¡†† ÷qÂÝøGø™÷qÂüGTø +Â÷#w÷¥ÂøMø +Âû÷#Tû#ûT÷ü:Âø:÷MÂ÷Â÷#w÷¥ÂøM÷MÂû÷÷Âû÷#Tû#ûT÷ûûT÷û}Â÷}÷o÷ ÷€÷ø +÷©ªo©cekpjm¨nµ«®£­ùSµ÷Բбø’ùSµû&!n2Rui__3»û÷@oüF²ùíÐýí±ùí÷÷þ÷ ÷üøt÷½ï;Ü'';:''Û:ïïÛÜïû÷Ž÷M÷>÷÷÷,@ûŽËû÷è÷îøK÷+@ûÌF÷+@ûË÷Õ÷‹wé÷î`øLøÐ+ @ûÌF÷+@ûË©øßøCø—÷rû†÷Tz[÷Mû$ûMû$œ[Ñ÷Tû†÷Tz[÷Lû$ûLû$œ[÷ ¨÷Ò÷Ò÷pøÛ¹ªo©celpjm§nµ«®£­ûdªo©cekpjm¨nµ«®£­ûeªp©cekpjm¨nµ«­£­Â÷ Á÷Âw÷/Á¦Á~ÁðÀÀ Á÷"ÀÝ`-÷¨ø†ÌcÆ5@[OJI¼Q×ÒÀÄÏ-VŠish^bk¥µµ§©¸·¤jeÀ`øüÌcÆ5@[OJI¼Q×ÒÀÄÏÀ`VŠirh^bl¥µµ¦©¸·¥je€ûmŒÌcÆ5@[OJI¼Q×ÒÀÄÏ€VŠirh^bl¥µµ¦©¸·¥je@÷M÷ }Àü<û:™Xû$Âø:÷ ÷ Àã÷+ÂÏÁ¬ôø$ø©n¨akhsil§m³±«¦¬¬Üü‹÷UM{ic€cûpÔ±í÷ Ó™ôTPAwûfû p’p–vK¬ÒnÔÆÆ›ºø~÷E÷3÷¿ø^øû÷&i>÷´'ø~÷D÷<÷¿øgøâj×ûžû%—løìÎ÷ø øøû(÷3;û)û3´y÷(÷÷&ûøš¾¿}wñø!°ø‡ùY•q‚ocgptœtÐtrœoXWeGu¾€šž½¯¡¢zz¤°y¥¨z¬°É»¼Åžøµ¿ÜøHø™øµ¿üHWø‹½öø"øùQg}U^CRP¨¿rP™oF®ÖiØðÒÆÓ¤øš÷÷™ß÷íøš÷7ûøš÷÷IàÊÞø0øš÷8ûL÷6ûø{Æ×Æ÷gÆ×Æø)øÜÁ`¶UU``UU¶`ÁÁ¶¶ÁPvzzvvzœ  œœ  œzvûJ¸ÂÝÿ€ÿ0€ˆ¹àÐø(à³sŸx°]†4Пœ–z}}y|~“’}bˆ¥{¤дª²·ø~÷\÷d÷¼øŒù"\¯ûûE¨t¡÷8[¯ûûE©tû5Å÷îÕø…>~{~xwš±¶™¦›>ezlhdg¥i»¤£•šŸø~Í÷ø øùaŸû%ûû)÷bw÷*û0Û÷qÂŒøüøý÷qÂüüT‹Â÷¯Â÷_–÷XãÂÒÁ¦ÂõøÁ÷0T&û,÷`÷ÒQÁ÷>URD÷_ý÷,$Â÷2ü,TåûCübVT÷XÂ5³÷÷û<÷sû÷÷¹÷ì¶fµ¿µÃµ÷0µ÷$¶¼|øE÷òµ[ô®ˆ¥iš“zuŽvdd€€j•a–¥¬–ªÆ‘prŽvsŽt)w\r¼i«gÀ²®Ÿ£§|e¼Šãksgxeqw”£—¸°±…‹‹ÂøbÂ÷-Â÷²Âø¹÷•Tû^û²÷G÷BÓÂûBC÷x÷Âû²TõûŽ8hTÞ®û1!TÂø{²Âø/ÂøÄ÷³¿|áZ͹È`¬bU«eY¡HûE4û1û!8¥?ºUWF¶k¼Ël´¾yÅ÷6ë÷÷8T‰ûDûû]cš£k÷¨÷ÿ­V•Ib:÷^û©üi·xÆÉäÀ÷0÷.À³zq©‹Â÷`Â÷_–Â÷}ÂÐÁ§ÂúøÄ÷1T%û+÷`þÐRÁ÷Ü÷'÷'Ýâ÷ ª÷ì¶÷.¶÷@¶÷B¶øDødÌWÂ>RAg8/än³½Ü­á`ŒX_pa__§½µ¬­ÃЛVtÁ÷<ÃYÁ÷£Ã÷JÂ÷TÂÞøÈ•Âlf~gxw“zS¥xÌÇ÷Š“Œ““ÂÆq³¯sj¢WTkqbp™…~À-Uc~{`•U™­³™³ЙgS¾hyqŒ~izˆ„sPy\[:3ÌfÇ¥ÃâÅWž¾cÙÞ·¸––±T÷”ûR˲ÉÈ­ vz”™q’nŒjû‹ûueHLdm§¹¾¼¯±²“Ž›–¢Ÿ°†‹‹Â÷ØÂ÷ªÂøŽÂûAøûcT÷,ûØûDT‹Âø™Â÷¤Âø‰ÂûB÷~÷ÀÂûV÷¯ûuT÷>ûŽûUU÷ÀûhûCTÃ÷ñ¿ÃøÂøÄø.e´SX¬]TšPû6/"ûUT®eV\±bľiºÅÀ÷÷Ý÷)¿|¿j±„û#†]h‚a.ûbc“ j÷¦÷£n–fe?÷#û¨ûq§~³³öâÏ÷¬¹„r²Â÷<Â÷›Ã÷cÁ÷TÂø×–€Ânc~g@TÁð˜÷Š“Œ““ÂÆq³¯sl¢WDeZl|ºva¬Hû#sû"ûûS÷ |¯ç­Ë£”W¥³gظº–—±U÷“ûS˳ÊÈ­ uz”™q’nŒjûŠpG‹ûû+ˆ÷§äžô㪫{nš›k‘deÂ`Â÷ØÂ÷Â÷ÁãÀ÷Á§Â}½øÞ÷¦„«užfª_‘_›:¨pš«¨¨˜”¹¤Ê‘¤Ã‘—Œ˜˜§¦vž©jZ“.dRƒpigo‰[Up8TÞûØ9T÷ørÑ¡¢òØˈV}ˆ‚‚mjAhly{‚vsMÁo»y½ñd§€§€^:û†oY\™«cuTmºÃ{ĽÝ÷¨÷ +÷‡½÷¯w÷¨½ø7÷‡½.÷¯û$uYé˜ût.Y÷­Âø`Âø—é÷†üATø +ûO~ÂaÃ÷×Â÷Â÷¢ÂxøÑÃ8øûTÞû&¸3g$ûIaºÈ÷°ûTÞü¶Â÷Yt ¬w¼¿Ù£Ë°x@øÍ‹w÷c·m©÷·÷¶÷F¶nžø¶ø÷½;Wû{®V÷{<û½¶÷ Êû ÂžÇ÷ŸûŸ®û“÷‘·ûT_Õû‘·÷‘‹Â÷ZÁ÷fÂ÷Á÷åÂøÂ÷¿÷8=Ú"¢‘mjŒgû†TÙûf@UÖûZ=T÷j·µ’³õžÙã÷KTƒR~Rp^Le@}Aû÷Z÷<Áû<÷fî㳈`½«o§J4=½÷€¼}½÷¯w÷¼÷J»÷ ¼¾øìøÅb§üvý)´o÷2÷ë½.÷¯û#uYé˜ût.Yø²ûÕ½û.÷߶­ÌÞ¿f½@beylpQ¼ŠŽ‹Ž©©§²£nlinqrxû'\ Â÷†Â÷Pw÷¥Âø—÷RÂûO÷PTûPûOT÷OûPÂ÷P÷Oû½ÂüAT‹ÂÆÂ÷ÂÅÂ÷LÁ÷¸ÂøÝ÷²÷7È!û1Å÷Âû­T÷übûT÷ÖÂû-Æ÷ ÃÁ’®´±«¼¼T‰qƒpywchS‰Vû÷÷8ÍÉd:>½»¾÷?½÷¯w÷¼÷˽øç>½]»¹¾]÷GQûûVg÷[UYÁ÷)@Ö÷÷ øb§üvý)³o÷÷ë½.÷¯û#uYé˜ût.Y­ãÎÃÎã÷—ãà÷ï÷ø£wŸsswwssŸw££ŸŸ£÷>û;ÃüAS÷—û£wŸsswwssŸw££ŸŸ£ûtúH÷§¾÷Ú÷¨øTXüT¾üˆøTXüT÷¢Â÷`Â÷ Á÷`ÀøWøAÊ]çû1HD56ÍCäßÓËêV‰Q\_SOb¿½¶¬ÆÑÜŸ?qûVÂ÷Â÷ñÂ÷ÂïÁ÷éÂøº÷q°ƒ°|ªÞcA±>5Og\g÷›ûTÞý[8T÷¶Âû-÷dcªÂbæ÷ìí÷TŠû6I9.=ÒôæÌÝ÷÷­ûQ>½»½÷9½ë¼î¼‹w÷d½l¼÷X¼ù€øË>½]»¹½]÷HQûûVg÷[TYÂ÷(@Ö÷õ€÷øb§üuý*³p÷.øH¼u›q˜ú€Ÿœ•žªª~«rœ–{w’qefzwlž\œ£¥©§¨zlntuY…ù€Z™­½†bvxnVjj˜›o}X}§¸}±õ€ÆÆ°Ê÷‡½÷¼÷Y»÷¼ø4÷‡½û/÷ß·®Ì¿f½@bdylpQ¼ŠŽ‹ŽŽªª§²£nlinprxû'\÷§¯÷L°Ò°Ñ®ί÷ °â°÷®ø©ø•÷ûïûû û-û#ûõ#÷÷õï÷h‰û43û".á÷òÚí÷ ÷à0ûûû `÷©––¤§Âfœ_;ûŠ°ð´²&’÷Bmv…t`Òµ®•zy÷RÁáøAø—÷RÁüAUÂ÷ñÁ÷w¢w»ÃøÄÜø¾÷~èe÷1ûëå¿p»ìûGcž`™^‘gZ¬ˆ°‚«~;\§\÷ËÚY³6‘}«eS—UûQGû$û!÷3÷#Ü÷D×÷ ÷R{!5Fûû ;ØìíØØ÷’÷6ˆ­!J vàøCø˜³ûE÷C÷C÷Ed±ûCûDûD÷Cdd÷EûDûDûD²e÷C÷C÷DûC÷€½ë¼î¼÷ï½l¼èø3÷ä¼u›q˜🜕žªª~«rœ–{w’qeezwlž\œ£¦©§¨zlnsuY…èZ™®½†bvxnVji˜›o}X}§¹}±èÆÆ°Ê÷§¯Ó¯÷X¯Æ®ίۯ÷«®ø©ø•÷ûïûû û-û#ûõ#÷÷õï÷h‰û43û".á÷òÚí÷ ÷à0û24n¨suvqVd¸¿Æ¹³¹¤£~x›©ª¤js—g>VMD:ÌUË°®š¥¤‹Â÷Â÷¹Âd²÷{w…÷h÷P÷eîøïÂUûdø™û‰T÷#ûKübMT÷hÂ0¶÷÷µ¸û)Tª÷tû‰Þ÷ ÷É÷=÷Vj×ûžû&—m‹Â÷Â÷¹Âd²÷8΋w…÷h÷P÷eçøïÂUûdø™û‰T÷#ûKübMT÷hÂ0¶÷÷µ¸û)Tª÷tû‰×÷ ÷É÷M÷û'÷2:û)û2´yë÷)÷÷&û‹Â÷Â÷¹Âd²ã÷…÷hsßÊßx÷eëì€øïÂUûdø™û‰T÷#ûKübMT÷hÂ0¶÷÷µ¸û)Tª÷tû‰Û÷ ÷É÷÷÷7ûL÷7û‹Â÷Â÷¹Âd²÷{w…÷h÷P÷eîøïÂUûdø™û‰T÷#ûKübMT÷hÂ0¶÷÷µ¸û)Tª÷tû‰Þ÷ ÷É÷&÷û÷&i?÷´'‹Â÷Â÷¹Âd²¬Ç×Ç…÷h„ÇØÆŠ÷eí€î@øïÂUûdø™û‰T÷#ûKübMT÷hÂ0¶÷÷µ¸û)Tª÷tû‰Ý€÷ ÷Éë÷?«xÌÂÕÂZÂù€ù@ø°÷STûû»÷_÷4BÂ÷^TAû4÷`ú€÷µûÂ÷SüsTÜübmøNj×ûžû&—mÂø{Â÷+΋w²Âø/ÂÜøÄ÷³éX÷`ûbûE4û1û!û8ôû÷2÷6ë÷÷8T‰ûDûûû<÷÷äÁ÷0÷-÷;°û<>}÷üû'÷2:û)û2´yì÷)÷÷&ûÂø{ÂÖ÷²ÂêßÊßàÂøÄ÷³éX÷`ûbûE4û1û!û8ôû÷2÷6ë÷÷8T‰ûDûûû<÷÷äÁ÷0÷-÷;°û<>6ø ÷7ûL÷7ûÂø{Â÷nw²Âø/ÂøÄ÷³éX÷`ûbûE4û1û!û8ôû÷2÷6ë÷÷8T‰ûDûûû<÷÷äÁ÷0÷-÷;°û<>Vøû÷&i?÷´'Âø{ÂÖ¿¿²Âø/ÂÜøÄ÷³éX÷`ûbûE4û1û!û8ôû÷2÷6ë÷÷8T‰ûDûûû<÷÷äÁ÷0÷-÷;°û<>üøwX•q‚rceqtœtÜttœmRZZRx¾€ “ž·¼¢¢zy¥üz¤§y©üЭδ–Â_÷HÿAÂÿ6èõÿWT|÷M`¶Îåw²wÓÂnÁ÷¼Ái­ ­PøŸ÷3Âj¶bžFª/}F©ar¥»Ë̽å­ ¿Àyh¯µ 2Á÷MU­`m§dV™Wû#L)7,Ùkƒ­Üh÷§ÍT™~vvJNa#LK³Zm ÙTûH­ ³`É؃¹­P÷îÁ÷ ­rùaû%ûû)÷® bx÷)û1ÜÂønÂ÷{wîÁ÷ÎÁøìø™ÂûƒTõûÒû@j:fe“ n]¬ƒÅÁ÷À÷ÂûˆTÜû¶BAÅ\k³Ä~Á½É™®²´¯œÈË÷Ód÷fj×ûžû&—mÂønÂ÷8΋wîÁ÷ÎÁÜøìø™ÂûƒTõûÒû@j:fe“ n]¬ƒÅÁ÷À÷ÂûˆTÜû¶BAÅ\k³Ä~Á½É™®²´¯œÈË÷Ót÷û'÷2:û)û2´yì÷)÷÷&ûÂønÂã÷îÁ¶ßÊß³Áøìø™ÂûƒTõûÒû@j:fe“ n]¬ƒÅÁ÷À÷ÂûˆTÜû¶BAÅ\k³Ä~Á½É™®²´¯œÈË÷Ó-÷#÷7ûL÷7ûÂønÂ÷{wîÁ÷ÎÁøìø™ÂûƒTõûÒû@j:fe“ n]¬ƒÅÁ÷À÷ÂûˆTÜû¶BAÅ\k³Ä~Á½É™®²´¯œÈË÷ÓM÷ û÷&i?÷´'‹ÂøbÂ÷{w®÷ZºÂ¸÷WøÓø™ÂûWTÐû"û„û$÷„ÑÂûZTÏ÷Eû»û;ûT÷ÂÂû÷;÷A÷»o÷fj×ûžû&—m‹ÂøbÂã÷®÷Zdß‘ß^÷WåøÓø™ÂòûWTÐû"û„û$÷„ÑÂûZTÏå÷Eû»û;ûT÷ÂÂû÷;÷A÷»ê8÷#÷7ûL÷7û‹ÂøbÂÂÎåw²w÷Á÷ÃÂîø¢÷mTû6ûÏøøe¿ü/û^Á÷'÷®üücUø<ù¥aû%ûû)÷öbx÷)û1ÜÂ`Â÷2Ã÷ÃÅÃ÷ÂÁ|øXøâj×ûžû%—løü~Â9÷…¦‰§|¦²vY©6GFwsQ™UšªÓ¦Ï­¬ˆy¨¥{’hjl’_Z’[û8V4P¼JÄEñ×жÀÂ|7Š÷*¼OYH\:N`´±¦›¡Ÿ™¥°Áº·µ…„µÂ`Â÷2Ã÷Ã÷-ÎÅÃ÷ÂÁ~øpøû(÷3;û)û3´y÷(÷÷&û÷ +ü~Â9÷…¦‰§|¦²vY©6GFwsQ™UšªÓ¦Ï­¬ˆy¨¥{’hjl’_Z’[û8V4P¾JÄEñ×жÀÂ~7Š÷*¾OYH\:N`´±¦›¡Ÿ™¥°Áº·µ…„µÂ`Â÷2Ã÷ÃÒ÷ÅÿàÊÞžÁ~€ø¼Â9÷…¦‰§|¦²vY©6GFwsQ™UšªÓ¦Ï­¬ˆy¨¥{’hjl’_Z’[û8V4P¾€JÄEñ×жÀÂ~€7Š÷*¾€OYH\:N`´±¦›¡Ÿ™¥°Áº·µ…„µ€x÷Ò÷8ûL÷6ûÂ`Â÷2Ã÷ÃÅÃ÷ÂÁ|øOøû÷&i>÷´'÷ ü~Â9÷…¦‰§|¦²vY©6GFwsQ™UšªÓ¦Ï­¬ˆy¨¥{’hjl’_Z’[û8V4P¼JÄEñ×жÀÂ|7Š÷*¼OYH\:N`´±¦›¡Ÿ™¥°Áº·µ…„µÂ`Â÷2Ã÷óÆ×ÆÅÃÝÆ×Æ¥Ás@ÀøøÜÁ`¶UU``UU¶`ÁÁ¶¶ÁPvzzvvzœ  œœ  œzvs@÷qüÜÂ9÷…¦‰§|¦²vY©6GFwsQ™UšªÓ¦Ï­¬ˆy¨¥{’hjl’_Z’[û8V4P³@JÄEñ×жÀÂs@7Š÷*³@OYH\:N`´±¦›¡Ÿ™¥°Áº·µ…„µÂ`Â÷2Ã÷ÃÒ¾¿}wÅÃ÷ÂÁ{€øxùY•q‚ocgptœt}€trœoXWeGu¾€šž½¯¡¢zz¤{€y¥¨z¬{€É»¼ÅžÏýÂ9÷…¦‰§|¦²vY©6GFwsQ™UšªÓ¦Ï­¬ˆy¨¥{’hjl’_Z’[û8V4P»€JÄEñ×жÀÂ{€7Š÷*»€OYH\:N`´±¦›¡Ÿ™¥°Áº·µ…„µûJ¸÷À÷ñÃÓÂÿ˜€ÿ1€ˆ¹éÂúø¨ÎuÂur=Q:û0`÷ÌäÓÝ÷ÄÀ}g¶FÂ÷CT[ª][œQûAFû0ûë5÷€†?öŒ’’’˜š„y†ws}}“’€}cx©Š“±­¯ºú²s x¥úÞ̪¶Á÷<Â÷ÃÊÄ÷óÆøgøâj×ûžû%—l÷øüKzÀ_==y\\^‘£eg¢mÁÀ“ø.÷H÷û5û!/ûû +Ðû÷CÜÞ¦¯ÌJ÷jûñÆ“ÆÎ÷÷ª&rÁ÷<Â÷Ã÷-ÎÊÄ÷óÆøøû(÷3;û)û3´y÷(÷÷&ûâüKzÀ_==y\\^‘£eg¢mÁÀ“ø.÷H÷û5û!/ûû +Ðû÷CÜÞ¦¯ÌJ÷jûñÆ“ÆÎ÷÷ª&rÁ÷<Â÷ÃÒ÷ÊÄÈàÊÞÆÆø¬¾zÀ_==y\\^‘£eg¢mÁÀ“ø.÷H÷û5û!/ûû +Ðû÷CÜÞ¦¯ÌJ÷jûñÆ“ÆÎ÷÷ª&rP÷‘÷8ûL÷6ûÁ÷<Â÷ÃÊÄ÷óÆø^øû÷&i>÷´'äüKzÀ_==y\\^‘£eg¢mÁÀ“ø.÷H÷û5û!/ûû +Ðû÷CÜÞ¦¯ÌJ÷jûñÆ“ÆÎ÷÷ª&r‹Â÷ØÂ÷ªÂøVøâj×ûžû%—l÷ëü~ÂûAøûcT÷,ûØûDT‹Â÷ØÂ÷:Î÷ªÂønøû(÷3;û)û3´y÷(÷÷&ûÕü~ÂûAøûcT÷,ûØûDT‹Â÷ØÂß÷÷8à¨ÂvÞèôøøš÷8ûL÷6û÷êüšÂèûAøûcT÷,ûØûDT‹Â÷ØÂ÷ªÂøMøû÷&i>÷´'×ü~ÂûAøûcT÷,ûØûDT‹Â÷×ÃaÂÒ¾¿}w÷Á÷¢Á×ø‡ùY•q‚ocgptœtÛtrœoXWeGu¾€šž½¯¡¢zz¤×y¥¨z¬×É»¼ÅžØýÂ9÷”·°„·m¤œvl˜[FHm]X×ÊûSÞû×8T÷pÂ8·÷“¹µÏ¯È¶Ã~Fû“9TÂ÷ñ¿ÂøÂøgøâj×ûžû%—lø +û¥ãR÷"ûTû!û4û#ûí+÷0÷,ëí÷TŠ';BûûLçÜèÔÞ÷÷5­ûUÂ÷ñÂ÷-οÂøÂøøû(÷3;û)û3´y÷(÷÷&ûôû¥ãR÷"ûTû!û4û#ûí+÷0÷,ëí÷TŠ';BûûLçÜèÔÞ÷÷5­ûUÂ÷ñÂÒ÷¿ÂÕàÊÞâÂø¾÷mãR÷"ûTû!û4û#ûí+÷0÷,ëí÷TŠ';BûûLçÜèÔÞ÷÷5­ûU4÷Â÷8ûL÷6ûÂ÷ñ¿ÂøÂø^øû÷&i>÷´'öû¥ãR÷"ûTû!û4û#ûí+÷0÷,ëí÷TŠ';BûûLçÜèÔÞ÷÷5­ûUÂ÷ñÂÒ¾¿}w¿ÂøÂîø‡ùY•q‚ocgptœtötrœoXWeGu¾€šž½¯¡¢zz¤îy¥¨z¬îÉ»¼ÅžÂü,ãR÷"ûTû!û4û#ûí+÷0÷,ëí÷TŠ';BûûLçÜèÔÞ÷÷5­ûUÂ÷ñ¶ÍèÂ\Á÷¯ÁlÂôøùaŸû%ûû)÷bw÷*û0Ûê÷@ûûÞP FF/ˆ]¨|•€É㘶ìÂÂzpµPÁ÷2Uc¦^U˜SûCV5r’pžzÀ[ØÕ…ò·‡¿’¦e„{…AûƒfLTž°[ÆTû>¸t¼¼uÛê÷ÚÄáÁaÂ÷ØÂ÷Á÷¢Áxø^øâj×ûžû%—lø"ü~Â9øûTÞ¸û‡YcW_Kpn‘švm¡„¯¯÷©ûTÞûb—b®psª²‚³²¿‘Ô×xHÁaÂ÷ØÂ÷:Î÷Á÷¢Á|øvøû(÷3;û)û3´y÷(÷÷&û÷ü~Â9øûTÞ¼û‡YcW_Kpn‘švm¡„¯¯÷©ûTÞûb—b®psª²‚³²¿‘Ô×|HÁaÂ÷ØÂß÷÷Á”àÊÞ©Áyø'øš÷8ûL÷6ûyø!üšÂ9ø{ûT¹Þû‡YcW_Kpn‘švm¡„¯¯÷©ûTÞûb—b®psª²‚³²¿‘Ô×yHÁaÂ÷ØÂ÷Á÷¢ÁxøUøû÷&i>÷´'÷ü~Â9øûTÞ¸û‡YcW_Kpn‘švm¡„¯¯÷©ûTÞûb—b®psª²‚³²¿‘Ô×xHûVÂøšÂ ÷Sû&÷’æ÷Gèøgøâj×ûžû%—lø.ûÂûGTÃû:û¿û-÷¿ËÂûSTÎ÷Lûõ*û9ØûT÷’Â6÷¸øšûVÂøšÂß÷ ÷Sû&÷’ûàÊÞŠ÷Gæø0øš÷8ûL÷6ûñø-ûÂûGTÃû:û¿û-÷¿ËÂûSTÎ÷Lûõ*û9éûT÷’Â6÷¸øš‹Â÷ØÂÃÍ÷Á÷­Âø†ùaŸû%ûû)÷bw÷*û0Û÷/ü~÷'T/û£÷Ú÷ܾüû$Áä÷•ûØûÛWÂ÷5ÂÂÂ÷4ÂâÃøÁœ÷`Ûû¨ã.÷'Úب¸ÈsºdVHpG'9Åòm÷vŸÂû”–Š––’‹“Œ’÷¦ŸÂû±ê£ÓÌëÑÐqc±CÁ÷UUV®ZVCû--û pQwTÑz~ŒŒ~W}™øИû+™÷â ûE‹÷€’ð‹ü¯}™øИû+™÷â ûE‹÷€’ð‹ü¯  + øì +endstream +endobj + +%QDF: ignore_newline +33 0 obj +19922 +endobj + +xref +0 34 +0000000000 65535 f +0000000025 00000 n +0000000097 00000 n +0000000331 00000 n +0000001413 00000 n +0000001433 00000 n +0000001561 00000 n +0000001673 00000 n +0000004066 00000 n +0000004087 00000 n +0000004374 00000 n +0000004670 00000 n +0000004751 00000 n +0000004936 00000 n +0000005310 00000 n +0000006925 00000 n +0000007829 00000 n +0000010054 00000 n +0000028727 00000 n +0000028750 00000 n +0000074159 00000 n +0000074182 00000 n +0000074258 00000 n +0000074496 00000 n +0000074779 00000 n +0000075122 00000 n +0000075364 00000 n +0000075613 00000 n +0000075867 00000 n +0000076050 00000 n +0000076070 00000 n +0000081988 00000 n +0000082010 00000 n +0000102030 00000 n +trailer << + /Info 2 0 R + /Root 1 0 R + /Size 34 + /ID [<66be986488f3991cf47a7d3b19e355e5><31415926535897932384626433832795>] +>> +startxref +102053 +%%EOF diff --git a/qpdf/qtest/qpdf/hybrid-xref.1-ogen.c-check b/qpdf/qtest/qpdf/hybrid-xref.1-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.1-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/hybrid-xref.1-ogen.check b/qpdf/qtest/qpdf/hybrid-xref.1-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.1-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.1.c-check b/qpdf/qtest/qpdf/hybrid-xref.1.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.1.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/hybrid-xref.1.check b/qpdf/qtest/qpdf/hybrid-xref.1.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.1.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.10-ogen.c-check b/qpdf/qtest/qpdf/hybrid-xref.10-ogen.c-check new file mode 100644 index 0000000..963cdba --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.10-ogen.c-check @@ -0,0 +1,13 @@ +version: 1.5 +linearized: 0 +encrypted: 1 +user password: +extract for accessibility: 1 +extract for any purpose: 1 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 1 +modify forms: 1 +modify annotations: 1 +modify other: 1 +modify anything: 1 diff --git a/qpdf/qtest/qpdf/hybrid-xref.10-ogen.check b/qpdf/qtest/qpdf/hybrid-xref.10-ogen.check new file mode 100644 index 0000000..331cd70 --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.10-ogen.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.5 +R = 3 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.10.c-check b/qpdf/qtest/qpdf/hybrid-xref.10.c-check new file mode 100644 index 0000000..963cdba --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.10.c-check @@ -0,0 +1,13 @@ +version: 1.5 +linearized: 0 +encrypted: 1 +user password: +extract for accessibility: 1 +extract for any purpose: 1 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 1 +modify forms: 1 +modify annotations: 1 +modify other: 1 +modify anything: 1 diff --git a/qpdf/qtest/qpdf/hybrid-xref.10.check b/qpdf/qtest/qpdf/hybrid-xref.10.check new file mode 100644 index 0000000..331cd70 --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.10.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.5 +R = 3 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.11-ogen.c-check b/qpdf/qtest/qpdf/hybrid-xref.11-ogen.c-check new file mode 100644 index 0000000..ef82b7f --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.11-ogen.c-check @@ -0,0 +1,13 @@ +version: 1.5 +linearized: 1 +encrypted: 1 +user password: +extract for accessibility: 1 +extract for any purpose: 1 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 1 +modify forms: 1 +modify annotations: 1 +modify other: 1 +modify anything: 1 diff --git a/qpdf/qtest/qpdf/hybrid-xref.11-ogen.check b/qpdf/qtest/qpdf/hybrid-xref.11-ogen.check new file mode 100644 index 0000000..aae0b3a --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.11-ogen.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.5 +R = 3 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.11.c-check b/qpdf/qtest/qpdf/hybrid-xref.11.c-check new file mode 100644 index 0000000..ef82b7f --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.11.c-check @@ -0,0 +1,13 @@ +version: 1.5 +linearized: 1 +encrypted: 1 +user password: +extract for accessibility: 1 +extract for any purpose: 1 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 1 +modify forms: 1 +modify annotations: 1 +modify other: 1 +modify anything: 1 diff --git a/qpdf/qtest/qpdf/hybrid-xref.11.check b/qpdf/qtest/qpdf/hybrid-xref.11.check new file mode 100644 index 0000000..aae0b3a --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.11.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.5 +R = 3 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.12-ogen.c-check b/qpdf/qtest/qpdf/hybrid-xref.12-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.12-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/hybrid-xref.12-ogen.check b/qpdf/qtest/qpdf/hybrid-xref.12-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.12-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.12.c-check b/qpdf/qtest/qpdf/hybrid-xref.12.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.12.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/hybrid-xref.12.check b/qpdf/qtest/qpdf/hybrid-xref.12.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.12.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.2-ogen.c-check b/qpdf/qtest/qpdf/hybrid-xref.2-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.2-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/hybrid-xref.2-ogen.check b/qpdf/qtest/qpdf/hybrid-xref.2-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.2-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.2.c-check b/qpdf/qtest/qpdf/hybrid-xref.2.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.2.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/hybrid-xref.2.check b/qpdf/qtest/qpdf/hybrid-xref.2.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.2.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.3-ogen.c-check b/qpdf/qtest/qpdf/hybrid-xref.3-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.3-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/hybrid-xref.3-ogen.check b/qpdf/qtest/qpdf/hybrid-xref.3-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.3-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.3.c-check b/qpdf/qtest/qpdf/hybrid-xref.3.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.3.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/hybrid-xref.3.check b/qpdf/qtest/qpdf/hybrid-xref.3.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.3.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.4-ogen.c-check b/qpdf/qtest/qpdf/hybrid-xref.4-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.4-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/hybrid-xref.4-ogen.check b/qpdf/qtest/qpdf/hybrid-xref.4-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.4-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.4.c-check b/qpdf/qtest/qpdf/hybrid-xref.4.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.4.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/hybrid-xref.4.check b/qpdf/qtest/qpdf/hybrid-xref.4.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.4.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.5-ogen.c-check b/qpdf/qtest/qpdf/hybrid-xref.5-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.5-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/hybrid-xref.5-ogen.check b/qpdf/qtest/qpdf/hybrid-xref.5-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.5-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.5.c-check b/qpdf/qtest/qpdf/hybrid-xref.5.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.5.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/hybrid-xref.5.check b/qpdf/qtest/qpdf/hybrid-xref.5.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.5.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.6-ogen.c-check b/qpdf/qtest/qpdf/hybrid-xref.6-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.6-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/hybrid-xref.6-ogen.check b/qpdf/qtest/qpdf/hybrid-xref.6-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.6-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.6.c-check b/qpdf/qtest/qpdf/hybrid-xref.6.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.6.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/hybrid-xref.6.check b/qpdf/qtest/qpdf/hybrid-xref.6.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.6.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.7-ogen.c-check b/qpdf/qtest/qpdf/hybrid-xref.7-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.7-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/hybrid-xref.7-ogen.check b/qpdf/qtest/qpdf/hybrid-xref.7-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.7-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.7.c-check b/qpdf/qtest/qpdf/hybrid-xref.7.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.7.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/hybrid-xref.7.check b/qpdf/qtest/qpdf/hybrid-xref.7.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.7.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.8-ogen.c-check b/qpdf/qtest/qpdf/hybrid-xref.8-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.8-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/hybrid-xref.8-ogen.check b/qpdf/qtest/qpdf/hybrid-xref.8-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.8-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.8.c-check b/qpdf/qtest/qpdf/hybrid-xref.8.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.8.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/hybrid-xref.8.check b/qpdf/qtest/qpdf/hybrid-xref.8.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.8.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.9-ogen.c-check b/qpdf/qtest/qpdf/hybrid-xref.9-ogen.c-check new file mode 100644 index 0000000..0ab1338 --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.9-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 1 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/hybrid-xref.9-ogen.check b/qpdf/qtest/qpdf/hybrid-xref.9-ogen.check new file mode 100644 index 0000000..8c02e64 --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.9-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.9.c-check b/qpdf/qtest/qpdf/hybrid-xref.9.c-check new file mode 100644 index 0000000..0ab1338 --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.9.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 1 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/hybrid-xref.9.check b/qpdf/qtest/qpdf/hybrid-xref.9.check new file mode 100644 index 0000000..8c02e64 --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.9.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/hybrid-xref.pdf b/qpdf/qtest/qpdf/hybrid-xref.pdf new file mode 100644 index 0000000..3ad9707 --- /dev/null +++ b/qpdf/qtest/qpdf/hybrid-xref.pdf @@ -0,0 +1,1538 @@ +%PDF-1.5 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /PageLabels 107 0 R + /Pages 2 0 R + /Type /Catalog + /PageMode /UseOutlines + /Outlines 95 0 R +>> +endobj + +2 0 obj +<< + /Count 30 + /Kids [ + 3 0 R + 4 0 R + 5 0 R + 6 0 R + 7 0 R + 8 0 R + 9 0 R + 10 0 R + 11 0 R + 12 0 R + 13 0 R + 14 0 R + 15 0 R + 16 0 R + 17 0 R + 18 0 R + 19 0 R + 20 0 R + 21 0 R + 22 0 R + 23 0 R + 24 0 R + 25 0 R + 26 0 R + 27 0 R + 28 0 R + 29 0 R + 30 0 R + 31 0 R + 32 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +3 0 obj +<< + /Contents 33 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 2 +4 0 obj +<< + /Contents 37 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 3 +5 0 obj +<< + /Contents 39 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 4 +6 0 obj +<< + /Contents 41 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 5 +7 0 obj +<< + /Contents 43 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 6 +8 0 obj +<< + /Contents 45 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 7 +9 0 obj +<< + /Contents 47 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 8 +10 0 obj +<< + /Contents 49 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 9 +11 0 obj +<< + /Contents 51 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 10 +12 0 obj +<< + /Contents 53 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 11 +13 0 obj +<< + /Contents 55 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 12 +14 0 obj +<< + /Contents 57 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 13 +15 0 obj +<< + /Contents 59 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 14 +16 0 obj +<< + /Contents 61 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 15 +17 0 obj +<< + /Contents 63 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 16 +18 0 obj +<< + /Contents 65 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 17 +19 0 obj +<< + /Contents 67 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 18 +20 0 obj +<< + /Contents 69 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 19 +21 0 obj +<< + /Contents 71 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 20 +22 0 obj +<< + /Contents 73 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 21 +23 0 obj +<< + /Contents 75 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 22 +24 0 obj +<< + /Contents 77 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 23 +25 0 obj +<< + /Contents 79 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 24 +26 0 obj +<< + /Contents 81 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 25 +27 0 obj +<< + /Contents 83 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 26 +28 0 obj +<< + /Contents 85 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 27 +29 0 obj +<< + /Contents 87 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 28 +30 0 obj +<< + /Contents 89 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 29 +31 0 obj +<< + /Contents 91 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 30 +32 0 obj +<< + /Contents 93 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +33 0 obj +<< + /Length 34 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 0) Tj +ET +endstream +endobj + +34 0 obj +46 +endobj + +35 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +36 0 obj +[ + /PDF + /Text +] +endobj + +%% Contents for page 2 +37 0 obj +<< + /Length 38 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 1) Tj +ET +endstream +endobj + +38 0 obj +46 +endobj + +%% Contents for page 3 +39 0 obj +<< + /Length 40 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 2) Tj +ET +endstream +endobj + +40 0 obj +46 +endobj + +%% Contents for page 4 +41 0 obj +<< + /Length 42 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 3) Tj +ET +endstream +endobj + +42 0 obj +46 +endobj + +%% Contents for page 5 +43 0 obj +<< + /Length 44 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 4) Tj +ET +endstream +endobj + +44 0 obj +46 +endobj + +%% Contents for page 6 +45 0 obj +<< + /Length 46 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 5) Tj +ET +endstream +endobj + +46 0 obj +46 +endobj + +%% Contents for page 7 +47 0 obj +<< + /Length 48 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 6) Tj +ET +endstream +endobj + +48 0 obj +46 +endobj + +%% Contents for page 8 +49 0 obj +<< + /Length 50 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 7) Tj +ET +endstream +endobj + +50 0 obj +46 +endobj + +%% Contents for page 9 +51 0 obj +<< + /Length 52 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 8) Tj +ET +endstream +endobj + +52 0 obj +46 +endobj + +%% Contents for page 10 +53 0 obj +<< + /Length 54 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 9) Tj +ET +endstream +endobj + +54 0 obj +46 +endobj + +%% Contents for page 11 +55 0 obj +<< + /Length 56 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 10) Tj +ET +endstream +endobj + +56 0 obj +47 +endobj + +%% Contents for page 12 +57 0 obj +<< + /Length 58 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 11) Tj +ET +endstream +endobj + +58 0 obj +47 +endobj + +%% Contents for page 13 +59 0 obj +<< + /Length 60 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 12) Tj +ET +endstream +endobj + +60 0 obj +47 +endobj + +%% Contents for page 14 +61 0 obj +<< + /Length 62 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 13) Tj +ET +endstream +endobj + +62 0 obj +47 +endobj + +%% Contents for page 15 +63 0 obj +<< + /Length 64 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 14) Tj +ET +endstream +endobj + +64 0 obj +47 +endobj + +%% Contents for page 16 +65 0 obj +<< + /Length 66 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 15) Tj +ET +endstream +endobj + +66 0 obj +47 +endobj + +%% Contents for page 17 +67 0 obj +<< + /Length 68 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 16) Tj +ET +endstream +endobj + +68 0 obj +47 +endobj + +%% Contents for page 18 +69 0 obj +<< + /Length 70 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 17) Tj +ET +endstream +endobj + +70 0 obj +47 +endobj + +%% Contents for page 19 +71 0 obj +<< + /Length 72 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 18) Tj +ET +endstream +endobj + +72 0 obj +47 +endobj + +%% Contents for page 20 +73 0 obj +<< + /Length 74 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 19) Tj +ET +endstream +endobj + +74 0 obj +47 +endobj + +%% Contents for page 21 +75 0 obj +<< + /Length 76 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 20) Tj +ET +endstream +endobj + +76 0 obj +47 +endobj + +%% Contents for page 22 +77 0 obj +<< + /Length 78 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 21) Tj +ET +endstream +endobj + +78 0 obj +47 +endobj + +%% Contents for page 23 +79 0 obj +<< + /Length 80 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 22) Tj +ET +endstream +endobj + +80 0 obj +47 +endobj + +%% Contents for page 24 +81 0 obj +<< + /Length 82 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 23) Tj +ET +endstream +endobj + +82 0 obj +47 +endobj + +%% Contents for page 25 +83 0 obj +<< + /Length 84 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 24) Tj +ET +endstream +endobj + +84 0 obj +47 +endobj + +%% Contents for page 26 +85 0 obj +<< + /Length 86 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 25) Tj +ET +endstream +endobj + +86 0 obj +47 +endobj + +%% Contents for page 27 +87 0 obj +<< + /Length 88 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 26) Tj +ET +endstream +endobj + +88 0 obj +47 +endobj + +%% Contents for page 28 +89 0 obj +<< + /Length 90 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 27) Tj +ET +endstream +endobj + +90 0 obj +47 +endobj + +%% Contents for page 29 +91 0 obj +<< + /Length 92 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 28) Tj +ET +endstream +endobj + +92 0 obj +47 +endobj + +%% Contents for page 30 +93 0 obj +<< + /Length 94 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 29) Tj +ET +endstream +endobj + +94 0 obj +47 +endobj + +xref +0 110 +0000000095 65535 f +0000000025 00000 n +0000000145 00000 n +0000000541 00000 n +0000000746 00000 n +0000000951 00000 n +0000001156 00000 n +0000001361 00000 n +0000001566 00000 n +0000001771 00000 n +0000001976 00000 n +0000002182 00000 n +0000002389 00000 n +0000002596 00000 n +0000002803 00000 n +0000003010 00000 n +0000003217 00000 n +0000003424 00000 n +0000003631 00000 n +0000003838 00000 n +0000004045 00000 n +0000004252 00000 n +0000004459 00000 n +0000004666 00000 n +0000004873 00000 n +0000005080 00000 n +0000005287 00000 n +0000005494 00000 n +0000005701 00000 n +0000005908 00000 n +0000006115 00000 n +0000006322 00000 n +0000006529 00000 n +0000006748 00000 n +0000006851 00000 n +0000006871 00000 n +0000006990 00000 n +0000007049 00000 n +0000007152 00000 n +0000007195 00000 n +0000007298 00000 n +0000007341 00000 n +0000007444 00000 n +0000007487 00000 n +0000007590 00000 n +0000007633 00000 n +0000007736 00000 n +0000007779 00000 n +0000007882 00000 n +0000007925 00000 n +0000008028 00000 n +0000008071 00000 n +0000008174 00000 n +0000008218 00000 n +0000008321 00000 n +0000008365 00000 n +0000008469 00000 n +0000008513 00000 n +0000008617 00000 n +0000008661 00000 n +0000008765 00000 n +0000008809 00000 n +0000008913 00000 n +0000008957 00000 n +0000009061 00000 n +0000009105 00000 n +0000009209 00000 n +0000009253 00000 n +0000009357 00000 n +0000009401 00000 n +0000009505 00000 n +0000009549 00000 n +0000009653 00000 n +0000009697 00000 n +0000009801 00000 n +0000009845 00000 n +0000009949 00000 n +0000009993 00000 n +0000010097 00000 n +0000010141 00000 n +0000010245 00000 n +0000010289 00000 n +0000010393 00000 n +0000010437 00000 n +0000010541 00000 n +0000010585 00000 n +0000010689 00000 n +0000010733 00000 n +0000010837 00000 n +0000010881 00000 n +0000010985 00000 n +0000011029 00000 n +0000011133 00000 n +0000011177 00000 n +0000011281 00000 n +0000000096 65535 f +0000000097 65535 f +0000000098 65535 f +0000000099 65535 f +0000000100 65535 f +0000000101 65535 f +0000000102 65535 f +0000000103 65535 f +0000000104 65535 f +0000000105 65535 f +0000000106 65535 f +0000000107 65535 f +0000000108 65535 f +0000000109 65535 f +0000000000 65535 f +trailer << + /Root 1 0 R + /Size 110 +>> +startxref +11301 +%%EOF + +108 0 obj +<< + /Type /ObjStm + /N 13 + /First 107 + /Length 2445 +>> +stream +95 0 +96 74 +97 259 +98 393 +99 556 +100 898 +101 1077 +102 1275 +103 1432 +104 1589 +105 1730 +106 1887 +107 2040 +%95 +<< + /Type /Outlines + /First 96 0 R + /Last 97 0 R + /Count 6 +>> +%96 +<< + /Type /Outline + /Title (Isís 1 -> 5: /XYZ null null null) + /Parent 95 0 R + /Count 4 + /Next 97 0 R + /First 98 0 R + /Last 99 0 R + /Dest [ 8 0 R /XYZ null null null ] +>> +% 97 +<< + /Type /Outline + /Title (Trepak 2 -> 15: /XYZ 66 756 3) + /Parent 95 0 R + /Prev 96 0 R + /Dest [ 18 0 R /XYZ 66 756 3 ] +>> +% 98 +<< + /Type /Outline + /Title (Amanda 1.1 -> 11: /Fit) + /Parent 96 0 R + /Next 99 0 R + /First 100 0 R + /Last 101 0 R + /Count -3 + /Dest [ 14 0 R /Fit ] +>> +% 99 +<< + /Type /Outline + % /Title (Sandy (Sandy [Greek]) 1.2 -> 13: /FitH 792) + /Title + /Parent 96 0 R + /Prev 98 0 R + /First 105 0 R + /Last 106 0 R + /Count 2 + /Dest [ 16 0 R /FitH 792 ] +>> +% 100 +<< + /Type /Outline + /Title (Isosicle 1.1.1 -> 12: /FitV 100) + /Parent 98 0 R + /Next 101 0 R + /First 102 0 R + /Last 103 0 R + /Count -2 + /Dest [ 15 0 R /FitV 100 ] +>> +% 101 +<< + /Type /Outline + /Title (Isosicle 1.1.2 -> 12: /XYZ null null null) + /Parent 98 0 R + /Prev 100 0 R + /First 104 0 R + /Last 104 0 R + /Count 1 + /Dest [ 15 0 R /XYZ null null null ] +>> +% 102 +<< + /Type /Outline + /Title (Isosicle 1.1.1.1 -> 18: /XYZ null null null) + /Parent 100 0 R + /Next 103 0 R + /Dest [ 21 0 R /XYZ null null null ] +>> +% 103 +<< + /Type /Outline + /Title (Isosicle 1.1.1.2 -> 19: /XYZ null null null) + /Parent 100 0 R + /Prev 102 0 R + /Dest [ 22 0 R /XYZ null null null ] +>> +% 104 +<< + /Type /Outline + /Title (Isosicle 1.1.2.1 -> 22: /XYZ null null null) + /Parent 101 0 R + /Dest [ 25 0 R /XYZ null null null ] +>> +% 105 +<< + /Type /Outline + /Title (Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770) + /Parent 99 0 R + /Next 106 0 R + /Dest [ 4 0 R /FitR 66 714 180 770 ] +>> +% 106 +<< + /Type /Outline + /Title (Trepsicle 1.2.2 -> 0: /XYZ null null null) + /Parent 99 0 R + /Prev 105 0 R + /Dest [ 3 0 R /XYZ null null null ] +>> +% 107 + << /Nums [ + 0 << /P () >> + 2 << /S /r /St 1 >> + 7 << /P () >> + 9 << /S /r /St 6 >> + 11 << /P () >> + 12 << /S /D /St 2 >> + 15 << /S /D /St 6 >> + 19 << /P () >> + 20 << /S /D /St 12 >> + 22 << /S /D /St 16059 >> + 23 << /S /r /St 50 >> + 29 << /S /r /St 54 >> + ] >> +endstream +endobj + +109 0 obj +<< + /Type /XRef + /Size 110 + /Index [0 110] + /W [1 2 1] + /Length 440 + /Root 1 0 R +>> +stream +‘ê·„Q븆 U +$ +ó  ‘ `/þÍœk: اvEã²\Ã×N‰ð‚­?¦Ñ8cÊõ\‡î   ­!!A!©!Õ"="i"Ñ"ý#e#‘#ù$%$$¹%!%M%µ%á&I&u&Ý' 'q'((1(™(Å)-)Y)Á)í*U**é++}+©,llllllllll l +l l 5>ñ +endstream +endobj + +xref +0 0 +trailer << + /Size 110 + /Root 1 0 R + /Prev 11301 + /XRefStm 16113 +>> + +startxref +16679 +%%EOF diff --git a/qpdf/qtest/qpdf/inline-images-cr.pdf b/qpdf/qtest/qpdf/inline-images-cr.pdf new file mode 100644 index 0000000..48861a7 Binary files /dev/null and b/qpdf/qtest/qpdf/inline-images-cr.pdf differ diff --git a/qpdf/qtest/qpdf/inline-images.1-ogen.c-check b/qpdf/qtest/qpdf/inline-images.1-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.1-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/inline-images.1-ogen.check b/qpdf/qtest/qpdf/inline-images.1-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.1-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.1.c-check b/qpdf/qtest/qpdf/inline-images.1.c-check new file mode 100644 index 0000000..ca9fbd3 --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.1.c-check @@ -0,0 +1,3 @@ +version: 1.2 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/inline-images.1.check b/qpdf/qtest/qpdf/inline-images.1.check new file mode 100644 index 0000000..cf35ead --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.1.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.2 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.10-ogen.c-check b/qpdf/qtest/qpdf/inline-images.10-ogen.c-check new file mode 100644 index 0000000..963cdba --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.10-ogen.c-check @@ -0,0 +1,13 @@ +version: 1.5 +linearized: 0 +encrypted: 1 +user password: +extract for accessibility: 1 +extract for any purpose: 1 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 1 +modify forms: 1 +modify annotations: 1 +modify other: 1 +modify anything: 1 diff --git a/qpdf/qtest/qpdf/inline-images.10-ogen.check b/qpdf/qtest/qpdf/inline-images.10-ogen.check new file mode 100644 index 0000000..331cd70 --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.10-ogen.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.5 +R = 3 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.10.c-check b/qpdf/qtest/qpdf/inline-images.10.c-check new file mode 100644 index 0000000..628b5fa --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.10.c-check @@ -0,0 +1,13 @@ +version: 1.4 +linearized: 0 +encrypted: 1 +user password: +extract for accessibility: 1 +extract for any purpose: 1 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 1 +modify forms: 1 +modify annotations: 1 +modify other: 1 +modify anything: 1 diff --git a/qpdf/qtest/qpdf/inline-images.10.check b/qpdf/qtest/qpdf/inline-images.10.check new file mode 100644 index 0000000..921e171 --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.10.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.4 +R = 3 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.11-ogen.c-check b/qpdf/qtest/qpdf/inline-images.11-ogen.c-check new file mode 100644 index 0000000..ef82b7f --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.11-ogen.c-check @@ -0,0 +1,13 @@ +version: 1.5 +linearized: 1 +encrypted: 1 +user password: +extract for accessibility: 1 +extract for any purpose: 1 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 1 +modify forms: 1 +modify annotations: 1 +modify other: 1 +modify anything: 1 diff --git a/qpdf/qtest/qpdf/inline-images.11-ogen.check b/qpdf/qtest/qpdf/inline-images.11-ogen.check new file mode 100644 index 0000000..aae0b3a --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.11-ogen.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.5 +R = 3 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.11.c-check b/qpdf/qtest/qpdf/inline-images.11.c-check new file mode 100644 index 0000000..a528204 --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.11.c-check @@ -0,0 +1,13 @@ +version: 1.4 +linearized: 1 +encrypted: 1 +user password: +extract for accessibility: 1 +extract for any purpose: 1 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 1 +modify forms: 1 +modify annotations: 1 +modify other: 1 +modify anything: 1 diff --git a/qpdf/qtest/qpdf/inline-images.11.check b/qpdf/qtest/qpdf/inline-images.11.check new file mode 100644 index 0000000..74a360c --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.11.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.4 +R = 3 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.12-ogen.c-check b/qpdf/qtest/qpdf/inline-images.12-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.12-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/inline-images.12-ogen.check b/qpdf/qtest/qpdf/inline-images.12-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.12-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.12.c-check b/qpdf/qtest/qpdf/inline-images.12.c-check new file mode 100644 index 0000000..ca9fbd3 --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.12.c-check @@ -0,0 +1,3 @@ +version: 1.2 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/inline-images.12.check b/qpdf/qtest/qpdf/inline-images.12.check new file mode 100644 index 0000000..cf35ead --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.12.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.2 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.2-ogen.c-check b/qpdf/qtest/qpdf/inline-images.2-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.2-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/inline-images.2-ogen.check b/qpdf/qtest/qpdf/inline-images.2-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.2-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.2.c-check b/qpdf/qtest/qpdf/inline-images.2.c-check new file mode 100644 index 0000000..ca9fbd3 --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.2.c-check @@ -0,0 +1,3 @@ +version: 1.2 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/inline-images.2.check b/qpdf/qtest/qpdf/inline-images.2.check new file mode 100644 index 0000000..cf35ead --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.2.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.2 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.3-ogen.c-check b/qpdf/qtest/qpdf/inline-images.3-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.3-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/inline-images.3-ogen.check b/qpdf/qtest/qpdf/inline-images.3-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.3-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.3.c-check b/qpdf/qtest/qpdf/inline-images.3.c-check new file mode 100644 index 0000000..ca9fbd3 --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.3.c-check @@ -0,0 +1,3 @@ +version: 1.2 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/inline-images.3.check b/qpdf/qtest/qpdf/inline-images.3.check new file mode 100644 index 0000000..cf35ead --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.3.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.2 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.4-ogen.c-check b/qpdf/qtest/qpdf/inline-images.4-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.4-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/inline-images.4-ogen.check b/qpdf/qtest/qpdf/inline-images.4-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.4-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.4.c-check b/qpdf/qtest/qpdf/inline-images.4.c-check new file mode 100644 index 0000000..ca9fbd3 --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.4.c-check @@ -0,0 +1,3 @@ +version: 1.2 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/inline-images.4.check b/qpdf/qtest/qpdf/inline-images.4.check new file mode 100644 index 0000000..cf35ead --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.4.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.2 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.5-ogen.c-check b/qpdf/qtest/qpdf/inline-images.5-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.5-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/inline-images.5-ogen.check b/qpdf/qtest/qpdf/inline-images.5-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.5-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.5.c-check b/qpdf/qtest/qpdf/inline-images.5.c-check new file mode 100644 index 0000000..ca9fbd3 --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.5.c-check @@ -0,0 +1,3 @@ +version: 1.2 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/inline-images.5.check b/qpdf/qtest/qpdf/inline-images.5.check new file mode 100644 index 0000000..cf35ead --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.5.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.2 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.6-ogen.c-check b/qpdf/qtest/qpdf/inline-images.6-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.6-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/inline-images.6-ogen.check b/qpdf/qtest/qpdf/inline-images.6-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.6-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.6.c-check b/qpdf/qtest/qpdf/inline-images.6.c-check new file mode 100644 index 0000000..ca9fbd3 --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.6.c-check @@ -0,0 +1,3 @@ +version: 1.2 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/inline-images.6.check b/qpdf/qtest/qpdf/inline-images.6.check new file mode 100644 index 0000000..cf35ead --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.6.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.2 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.7-ogen.c-check b/qpdf/qtest/qpdf/inline-images.7-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.7-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/inline-images.7-ogen.check b/qpdf/qtest/qpdf/inline-images.7-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.7-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.7.c-check b/qpdf/qtest/qpdf/inline-images.7.c-check new file mode 100644 index 0000000..ca9fbd3 --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.7.c-check @@ -0,0 +1,3 @@ +version: 1.2 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/inline-images.7.check b/qpdf/qtest/qpdf/inline-images.7.check new file mode 100644 index 0000000..cf35ead --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.7.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.2 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.8-ogen.c-check b/qpdf/qtest/qpdf/inline-images.8-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.8-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/inline-images.8-ogen.check b/qpdf/qtest/qpdf/inline-images.8-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.8-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.8.c-check b/qpdf/qtest/qpdf/inline-images.8.c-check new file mode 100644 index 0000000..ca9fbd3 --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.8.c-check @@ -0,0 +1,3 @@ +version: 1.2 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/inline-images.8.check b/qpdf/qtest/qpdf/inline-images.8.check new file mode 100644 index 0000000..cf35ead --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.8.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.2 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.9-ogen.c-check b/qpdf/qtest/qpdf/inline-images.9-ogen.c-check new file mode 100644 index 0000000..0ab1338 --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.9-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 1 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/inline-images.9-ogen.check b/qpdf/qtest/qpdf/inline-images.9-ogen.check new file mode 100644 index 0000000..8c02e64 --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.9-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.9.c-check b/qpdf/qtest/qpdf/inline-images.9.c-check new file mode 100644 index 0000000..4ebb050 --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.9.c-check @@ -0,0 +1,3 @@ +version: 1.2 +linearized: 1 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/inline-images.9.check b/qpdf/qtest/qpdf/inline-images.9.check new file mode 100644 index 0000000..4878f55 --- /dev/null +++ b/qpdf/qtest/qpdf/inline-images.9.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.2 +File is not encrypted +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/inline-images.pdf b/qpdf/qtest/qpdf/inline-images.pdf new file mode 100644 index 0000000..e9c59e2 Binary files /dev/null and b/qpdf/qtest/qpdf/inline-images.pdf differ diff --git a/qpdf/qtest/qpdf/large_file-check-linearized.out b/qpdf/qtest/qpdf/large_file-check-linearized.out new file mode 100644 index 0000000..6d3407b --- /dev/null +++ b/qpdf/qtest/qpdf/large_file-check-linearized.out @@ -0,0 +1,5 @@ +PDF Version: 1.3 +File is not encrypted +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/large_file-check-normal.out b/qpdf/qtest/qpdf/large_file-check-normal.out new file mode 100644 index 0000000..c5cc5b5 --- /dev/null +++ b/qpdf/qtest/qpdf/large_file-check-normal.out @@ -0,0 +1,5 @@ +PDF Version: 1.3 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/large_file-check-ostream-linearized.out b/qpdf/qtest/qpdf/large_file-check-ostream-linearized.out new file mode 100644 index 0000000..079bb65 --- /dev/null +++ b/qpdf/qtest/qpdf/large_file-check-ostream-linearized.out @@ -0,0 +1,5 @@ +PDF Version: 1.5 +File is not encrypted +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/large_file-check-ostream.out b/qpdf/qtest/qpdf/large_file-check-ostream.out new file mode 100644 index 0000000..8ea0e86 --- /dev/null +++ b/qpdf/qtest/qpdf/large_file-check-ostream.out @@ -0,0 +1,5 @@ +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/large_file.out b/qpdf/qtest/qpdf/large_file.out new file mode 100644 index 0000000..b1990d2 --- /dev/null +++ b/qpdf/qtest/qpdf/large_file.out @@ -0,0 +1,200 @@ +page 1 of 200 +page 2 of 200 +page 3 of 200 +page 4 of 200 +page 5 of 200 +page 6 of 200 +page 7 of 200 +page 8 of 200 +page 9 of 200 +page 10 of 200 +page 11 of 200 +page 12 of 200 +page 13 of 200 +page 14 of 200 +page 15 of 200 +page 16 of 200 +page 17 of 200 +page 18 of 200 +page 19 of 200 +page 20 of 200 +page 21 of 200 +page 22 of 200 +page 23 of 200 +page 24 of 200 +page 25 of 200 +page 26 of 200 +page 27 of 200 +page 28 of 200 +page 29 of 200 +page 30 of 200 +page 31 of 200 +page 32 of 200 +page 33 of 200 +page 34 of 200 +page 35 of 200 +page 36 of 200 +page 37 of 200 +page 38 of 200 +page 39 of 200 +page 40 of 200 +page 41 of 200 +page 42 of 200 +page 43 of 200 +page 44 of 200 +page 45 of 200 +page 46 of 200 +page 47 of 200 +page 48 of 200 +page 49 of 200 +page 50 of 200 +page 51 of 200 +page 52 of 200 +page 53 of 200 +page 54 of 200 +page 55 of 200 +page 56 of 200 +page 57 of 200 +page 58 of 200 +page 59 of 200 +page 60 of 200 +page 61 of 200 +page 62 of 200 +page 63 of 200 +page 64 of 200 +page 65 of 200 +page 66 of 200 +page 67 of 200 +page 68 of 200 +page 69 of 200 +page 70 of 200 +page 71 of 200 +page 72 of 200 +page 73 of 200 +page 74 of 200 +page 75 of 200 +page 76 of 200 +page 77 of 200 +page 78 of 200 +page 79 of 200 +page 80 of 200 +page 81 of 200 +page 82 of 200 +page 83 of 200 +page 84 of 200 +page 85 of 200 +page 86 of 200 +page 87 of 200 +page 88 of 200 +page 89 of 200 +page 90 of 200 +page 91 of 200 +page 92 of 200 +page 93 of 200 +page 94 of 200 +page 95 of 200 +page 96 of 200 +page 97 of 200 +page 98 of 200 +page 99 of 200 +page 100 of 200 +page 101 of 200 +page 102 of 200 +page 103 of 200 +page 104 of 200 +page 105 of 200 +page 106 of 200 +page 107 of 200 +page 108 of 200 +page 109 of 200 +page 110 of 200 +page 111 of 200 +page 112 of 200 +page 113 of 200 +page 114 of 200 +page 115 of 200 +page 116 of 200 +page 117 of 200 +page 118 of 200 +page 119 of 200 +page 120 of 200 +page 121 of 200 +page 122 of 200 +page 123 of 200 +page 124 of 200 +page 125 of 200 +page 126 of 200 +page 127 of 200 +page 128 of 200 +page 129 of 200 +page 130 of 200 +page 131 of 200 +page 132 of 200 +page 133 of 200 +page 134 of 200 +page 135 of 200 +page 136 of 200 +page 137 of 200 +page 138 of 200 +page 139 of 200 +page 140 of 200 +page 141 of 200 +page 142 of 200 +page 143 of 200 +page 144 of 200 +page 145 of 200 +page 146 of 200 +page 147 of 200 +page 148 of 200 +page 149 of 200 +page 150 of 200 +page 151 of 200 +page 152 of 200 +page 153 of 200 +page 154 of 200 +page 155 of 200 +page 156 of 200 +page 157 of 200 +page 158 of 200 +page 159 of 200 +page 160 of 200 +page 161 of 200 +page 162 of 200 +page 163 of 200 +page 164 of 200 +page 165 of 200 +page 166 of 200 +page 167 of 200 +page 168 of 200 +page 169 of 200 +page 170 of 200 +page 171 of 200 +page 172 of 200 +page 173 of 200 +page 174 of 200 +page 175 of 200 +page 176 of 200 +page 177 of 200 +page 178 of 200 +page 179 of 200 +page 180 of 200 +page 181 of 200 +page 182 of 200 +page 183 of 200 +page 184 of 200 +page 185 of 200 +page 186 of 200 +page 187 of 200 +page 188 of 200 +page 189 of 200 +page 190 of 200 +page 191 of 200 +page 192 of 200 +page 193 of 200 +page 194 of 200 +page 195 of 200 +page 196 of 200 +page 197 of 200 +page 198 of 200 +page 199 of 200 +page 200 of 200 diff --git a/qpdf/qtest/qpdf/large_file_xref_reconstruct.out b/qpdf/qtest/qpdf/large_file_xref_reconstruct.out new file mode 100644 index 0000000..da5b25b --- /dev/null +++ b/qpdf/qtest/qpdf/large_file_xref_reconstruct.out @@ -0,0 +1,203 @@ +WARNING: a.pdf: file is damaged +WARNING: a.pdf: can't find startxref +WARNING: a.pdf: Attempting to reconstruct cross-reference table +page 1 of 200 +page 2 of 200 +page 3 of 200 +page 4 of 200 +page 5 of 200 +page 6 of 200 +page 7 of 200 +page 8 of 200 +page 9 of 200 +page 10 of 200 +page 11 of 200 +page 12 of 200 +page 13 of 200 +page 14 of 200 +page 15 of 200 +page 16 of 200 +page 17 of 200 +page 18 of 200 +page 19 of 200 +page 20 of 200 +page 21 of 200 +page 22 of 200 +page 23 of 200 +page 24 of 200 +page 25 of 200 +page 26 of 200 +page 27 of 200 +page 28 of 200 +page 29 of 200 +page 30 of 200 +page 31 of 200 +page 32 of 200 +page 33 of 200 +page 34 of 200 +page 35 of 200 +page 36 of 200 +page 37 of 200 +page 38 of 200 +page 39 of 200 +page 40 of 200 +page 41 of 200 +page 42 of 200 +page 43 of 200 +page 44 of 200 +page 45 of 200 +page 46 of 200 +page 47 of 200 +page 48 of 200 +page 49 of 200 +page 50 of 200 +page 51 of 200 +page 52 of 200 +page 53 of 200 +page 54 of 200 +page 55 of 200 +page 56 of 200 +page 57 of 200 +page 58 of 200 +page 59 of 200 +page 60 of 200 +page 61 of 200 +page 62 of 200 +page 63 of 200 +page 64 of 200 +page 65 of 200 +page 66 of 200 +page 67 of 200 +page 68 of 200 +page 69 of 200 +page 70 of 200 +page 71 of 200 +page 72 of 200 +page 73 of 200 +page 74 of 200 +page 75 of 200 +page 76 of 200 +page 77 of 200 +page 78 of 200 +page 79 of 200 +page 80 of 200 +page 81 of 200 +page 82 of 200 +page 83 of 200 +page 84 of 200 +page 85 of 200 +page 86 of 200 +page 87 of 200 +page 88 of 200 +page 89 of 200 +page 90 of 200 +page 91 of 200 +page 92 of 200 +page 93 of 200 +page 94 of 200 +page 95 of 200 +page 96 of 200 +page 97 of 200 +page 98 of 200 +page 99 of 200 +page 100 of 200 +page 101 of 200 +page 102 of 200 +page 103 of 200 +page 104 of 200 +page 105 of 200 +page 106 of 200 +page 107 of 200 +page 108 of 200 +page 109 of 200 +page 110 of 200 +page 111 of 200 +page 112 of 200 +page 113 of 200 +page 114 of 200 +page 115 of 200 +page 116 of 200 +page 117 of 200 +page 118 of 200 +page 119 of 200 +page 120 of 200 +page 121 of 200 +page 122 of 200 +page 123 of 200 +page 124 of 200 +page 125 of 200 +page 126 of 200 +page 127 of 200 +page 128 of 200 +page 129 of 200 +page 130 of 200 +page 131 of 200 +page 132 of 200 +page 133 of 200 +page 134 of 200 +page 135 of 200 +page 136 of 200 +page 137 of 200 +page 138 of 200 +page 139 of 200 +page 140 of 200 +page 141 of 200 +page 142 of 200 +page 143 of 200 +page 144 of 200 +page 145 of 200 +page 146 of 200 +page 147 of 200 +page 148 of 200 +page 149 of 200 +page 150 of 200 +page 151 of 200 +page 152 of 200 +page 153 of 200 +page 154 of 200 +page 155 of 200 +page 156 of 200 +page 157 of 200 +page 158 of 200 +page 159 of 200 +page 160 of 200 +page 161 of 200 +page 162 of 200 +page 163 of 200 +page 164 of 200 +page 165 of 200 +page 166 of 200 +page 167 of 200 +page 168 of 200 +page 169 of 200 +page 170 of 200 +page 171 of 200 +page 172 of 200 +page 173 of 200 +page 174 of 200 +page 175 of 200 +page 176 of 200 +page 177 of 200 +page 178 of 200 +page 179 of 200 +page 180 of 200 +page 181 of 200 +page 182 of 200 +page 183 of 200 +page 184 of 200 +page 185 of 200 +page 186 of 200 +page 187 of 200 +page 188 of 200 +page 189 of 200 +page 190 of 200 +page 191 of 200 +page 192 of 200 +page 193 of 200 +page 194 of 200 +page 195 of 200 +page 196 of 200 +page 197 of 200 +page 198 of 200 +page 199 of 200 +page 200 of 200 diff --git a/qpdf/qtest/qpdf/lin-delete-and-reuse-check.out b/qpdf/qtest/qpdf/lin-delete-and-reuse-check.out new file mode 100644 index 0000000..d0fda8f --- /dev/null +++ b/qpdf/qtest/qpdf/lin-delete-and-reuse-check.out @@ -0,0 +1,6 @@ +checking lin-delete-and-reuse.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-delete-and-reuse.pdf b/qpdf/qtest/qpdf/lin-delete-and-reuse.pdf new file mode 100644 index 0000000..a7b20ae Binary files /dev/null and b/qpdf/qtest/qpdf/lin-delete-and-reuse.pdf differ diff --git a/qpdf/qtest/qpdf/lin-special.1-ogen.c-check b/qpdf/qtest/qpdf/lin-special.1-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.1-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/lin-special.1-ogen.check b/qpdf/qtest/qpdf/lin-special.1-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.1-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.1.c-check b/qpdf/qtest/qpdf/lin-special.1.c-check new file mode 100644 index 0000000..757cc85 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.1.c-check @@ -0,0 +1,3 @@ +version: 1.3 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/lin-special.1.check b/qpdf/qtest/qpdf/lin-special.1.check new file mode 100644 index 0000000..5da27b2 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.1.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.10-ogen.c-check b/qpdf/qtest/qpdf/lin-special.10-ogen.c-check new file mode 100644 index 0000000..963cdba --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.10-ogen.c-check @@ -0,0 +1,13 @@ +version: 1.5 +linearized: 0 +encrypted: 1 +user password: +extract for accessibility: 1 +extract for any purpose: 1 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 1 +modify forms: 1 +modify annotations: 1 +modify other: 1 +modify anything: 1 diff --git a/qpdf/qtest/qpdf/lin-special.10-ogen.check b/qpdf/qtest/qpdf/lin-special.10-ogen.check new file mode 100644 index 0000000..331cd70 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.10-ogen.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.5 +R = 3 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.10.c-check b/qpdf/qtest/qpdf/lin-special.10.c-check new file mode 100644 index 0000000..628b5fa --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.10.c-check @@ -0,0 +1,13 @@ +version: 1.4 +linearized: 0 +encrypted: 1 +user password: +extract for accessibility: 1 +extract for any purpose: 1 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 1 +modify forms: 1 +modify annotations: 1 +modify other: 1 +modify anything: 1 diff --git a/qpdf/qtest/qpdf/lin-special.10.check b/qpdf/qtest/qpdf/lin-special.10.check new file mode 100644 index 0000000..921e171 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.10.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.4 +R = 3 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.11-ogen.c-check b/qpdf/qtest/qpdf/lin-special.11-ogen.c-check new file mode 100644 index 0000000..ef82b7f --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.11-ogen.c-check @@ -0,0 +1,13 @@ +version: 1.5 +linearized: 1 +encrypted: 1 +user password: +extract for accessibility: 1 +extract for any purpose: 1 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 1 +modify forms: 1 +modify annotations: 1 +modify other: 1 +modify anything: 1 diff --git a/qpdf/qtest/qpdf/lin-special.11-ogen.check b/qpdf/qtest/qpdf/lin-special.11-ogen.check new file mode 100644 index 0000000..aae0b3a --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.11-ogen.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.5 +R = 3 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.11.c-check b/qpdf/qtest/qpdf/lin-special.11.c-check new file mode 100644 index 0000000..a528204 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.11.c-check @@ -0,0 +1,13 @@ +version: 1.4 +linearized: 1 +encrypted: 1 +user password: +extract for accessibility: 1 +extract for any purpose: 1 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 1 +modify forms: 1 +modify annotations: 1 +modify other: 1 +modify anything: 1 diff --git a/qpdf/qtest/qpdf/lin-special.11.check b/qpdf/qtest/qpdf/lin-special.11.check new file mode 100644 index 0000000..74a360c --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.11.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.4 +R = 3 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.12-ogen.c-check b/qpdf/qtest/qpdf/lin-special.12-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.12-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/lin-special.12-ogen.check b/qpdf/qtest/qpdf/lin-special.12-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.12-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.12.c-check b/qpdf/qtest/qpdf/lin-special.12.c-check new file mode 100644 index 0000000..757cc85 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.12.c-check @@ -0,0 +1,3 @@ +version: 1.3 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/lin-special.12.check b/qpdf/qtest/qpdf/lin-special.12.check new file mode 100644 index 0000000..5da27b2 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.12.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.2-ogen.c-check b/qpdf/qtest/qpdf/lin-special.2-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.2-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/lin-special.2-ogen.check b/qpdf/qtest/qpdf/lin-special.2-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.2-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.2.c-check b/qpdf/qtest/qpdf/lin-special.2.c-check new file mode 100644 index 0000000..757cc85 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.2.c-check @@ -0,0 +1,3 @@ +version: 1.3 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/lin-special.2.check b/qpdf/qtest/qpdf/lin-special.2.check new file mode 100644 index 0000000..5da27b2 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.2.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.3-ogen.c-check b/qpdf/qtest/qpdf/lin-special.3-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.3-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/lin-special.3-ogen.check b/qpdf/qtest/qpdf/lin-special.3-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.3-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.3.c-check b/qpdf/qtest/qpdf/lin-special.3.c-check new file mode 100644 index 0000000..757cc85 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.3.c-check @@ -0,0 +1,3 @@ +version: 1.3 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/lin-special.3.check b/qpdf/qtest/qpdf/lin-special.3.check new file mode 100644 index 0000000..5da27b2 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.3.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.4-ogen.c-check b/qpdf/qtest/qpdf/lin-special.4-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.4-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/lin-special.4-ogen.check b/qpdf/qtest/qpdf/lin-special.4-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.4-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.4.c-check b/qpdf/qtest/qpdf/lin-special.4.c-check new file mode 100644 index 0000000..757cc85 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.4.c-check @@ -0,0 +1,3 @@ +version: 1.3 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/lin-special.4.check b/qpdf/qtest/qpdf/lin-special.4.check new file mode 100644 index 0000000..5da27b2 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.4.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.5-ogen.c-check b/qpdf/qtest/qpdf/lin-special.5-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.5-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/lin-special.5-ogen.check b/qpdf/qtest/qpdf/lin-special.5-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.5-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.5.c-check b/qpdf/qtest/qpdf/lin-special.5.c-check new file mode 100644 index 0000000..757cc85 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.5.c-check @@ -0,0 +1,3 @@ +version: 1.3 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/lin-special.5.check b/qpdf/qtest/qpdf/lin-special.5.check new file mode 100644 index 0000000..5da27b2 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.5.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.6-ogen.c-check b/qpdf/qtest/qpdf/lin-special.6-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.6-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/lin-special.6-ogen.check b/qpdf/qtest/qpdf/lin-special.6-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.6-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.6.c-check b/qpdf/qtest/qpdf/lin-special.6.c-check new file mode 100644 index 0000000..757cc85 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.6.c-check @@ -0,0 +1,3 @@ +version: 1.3 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/lin-special.6.check b/qpdf/qtest/qpdf/lin-special.6.check new file mode 100644 index 0000000..5da27b2 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.6.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.7-ogen.c-check b/qpdf/qtest/qpdf/lin-special.7-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.7-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/lin-special.7-ogen.check b/qpdf/qtest/qpdf/lin-special.7-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.7-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.7.c-check b/qpdf/qtest/qpdf/lin-special.7.c-check new file mode 100644 index 0000000..757cc85 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.7.c-check @@ -0,0 +1,3 @@ +version: 1.3 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/lin-special.7.check b/qpdf/qtest/qpdf/lin-special.7.check new file mode 100644 index 0000000..5da27b2 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.7.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.8-ogen.c-check b/qpdf/qtest/qpdf/lin-special.8-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.8-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/lin-special.8-ogen.check b/qpdf/qtest/qpdf/lin-special.8-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.8-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.8.c-check b/qpdf/qtest/qpdf/lin-special.8.c-check new file mode 100644 index 0000000..757cc85 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.8.c-check @@ -0,0 +1,3 @@ +version: 1.3 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/lin-special.8.check b/qpdf/qtest/qpdf/lin-special.8.check new file mode 100644 index 0000000..5da27b2 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.8.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.9-ogen.c-check b/qpdf/qtest/qpdf/lin-special.9-ogen.c-check new file mode 100644 index 0000000..0ab1338 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.9-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 1 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/lin-special.9-ogen.check b/qpdf/qtest/qpdf/lin-special.9-ogen.check new file mode 100644 index 0000000..8c02e64 --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.9-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.9.c-check b/qpdf/qtest/qpdf/lin-special.9.c-check new file mode 100644 index 0000000..e76056b --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.9.c-check @@ -0,0 +1,3 @@ +version: 1.3 +linearized: 1 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/lin-special.9.check b/qpdf/qtest/qpdf/lin-special.9.check new file mode 100644 index 0000000..af887be --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.9.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.3 +File is not encrypted +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/lin-special.disable.exp b/qpdf/qtest/qpdf/lin-special.disable.exp new file mode 100644 index 0000000..852c008 Binary files /dev/null and b/qpdf/qtest/qpdf/lin-special.disable.exp differ diff --git a/qpdf/qtest/qpdf/lin-special.generate.exp b/qpdf/qtest/qpdf/lin-special.generate.exp new file mode 100644 index 0000000..c07bab2 Binary files /dev/null and b/qpdf/qtest/qpdf/lin-special.generate.exp differ diff --git a/qpdf/qtest/qpdf/lin-special.pdf b/qpdf/qtest/qpdf/lin-special.pdf new file mode 100644 index 0000000..804e8ed --- /dev/null +++ b/qpdf/qtest/qpdf/lin-special.pdf @@ -0,0 +1,361 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +% +% This file exercises several special conditions in the linearization +% and optimization code including various cases of shared resources, +% inherited page attributes, indirect null objects (resolution of +% which is a qpdf feature), null dictionary keys, and indirect scalar +% objects. +% +% The page tree is +% +% (A)--- page 1 +% | +% +---- page 2 +% | +% +---(B)--- page 3 +% | +% +---- page 4 +% | +% +---- page 5 +% +% Node (A) defines /MediaBox (direct) and /Resources (indirect) +% Node (B) overrides /MediaBox and defines /Rotate +% Node (B) defines /Quack, a non-standard key, which is not inherited +% Page 1 overrides /Resources +% Page 4 overrides /Resources +% Page 5 overrides /MediaBox and /Rotate +% +% Page 5 provides the case of two levels of shadowing on a resource. +% +% Node (B)'s overriding of /Rotate exercises inheriting a scalar. +% +% The /MediaBox defined in node (B) is shared between pages 3 and 4 +% but not page 1. The /MediaBox defined in node (A) is shared between +% pages 1 and 2 only. +% +% The document catalog has two non-standard keys /Moo and /Quack each +% of which contains (directly or indirectly) an indirect null object. +% +% The /Moo object, which is a dictionary, is shared between the +% document level and page 3 where it appears as a resource. +% + +1 0 obj +<< + /Moo 2 0 R + /Pages 3 0 R + /Quack 26 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /Null1 27 0 R + /Null2 null + /One 1 + /Two 28 0 R +>> +endobj + +% Node (A) +3 0 obj +<< + /Count 5 + /Kids [ + 4 0 R + 5 0 R + 6 0 R + ] + /MediaBox [ + 0 + 0 + 576 + 792 + ] + /Resources 7 0 R + /Type /Pages +>> +endobj + +%% Page 1 +4 0 obj +<< + /Contents 8 0 R + /Parent 3 0 R + /Resources 10 0 R + /Type /Page +>> +endobj + +%% Page 2 +5 0 obj +<< + /Contents 11 0 R + /Parent 3 0 R + /Type /Page +>> +endobj + +% Node (B) +6 0 obj +<< + /Count 3 + /Kids [ + 13 0 R + 14 0 R + 15 0 R + ] + /MediaBox [ + 0 + 0 + 576 + 396 + ] + /Parent 3 0 R + /Rotate 0 + /Quack 16059 + /Type /Pages +>> +endobj + +7 0 obj +<< + /Font << + /F1 16 0 R + >> + /ProcSet 17 0 R +>> +endobj + +%% Contents for page 1 +8 0 obj +<< + /Length 9 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 1) Tj +ET +endstream +endobj + +9 0 obj +46 +endobj + +10 0 obj +<< + /Font << + /F1 18 0 R + >> + /ProcSet 17 0 R +>> +endobj + +%% Contents for page 2 +11 0 obj +<< + /Length 12 0 R +>> +stream +BT + /F1 24 Tf + 72 322 Td + (Potato 2) Tj +ET +endstream +endobj + +12 0 obj +46 +endobj + +%% Page 3 +13 0 obj +<< + /Contents 19 0 R + /Moo 2 0 R + /Parent 6 0 R + /Type /Page +>> +endobj + +%% Page 4 +14 0 obj +<< + /Contents 21 0 R + /Parent 6 0 R + /Resources << + /Font << + /F1 23 0 R + >> + /ProcSet 17 0 R + >> + /Type /Page +>> +endobj + +%% Page 5 +15 0 obj +<< + /Contents 24 0 R + /MediaBox [ + 0 + 0 + 306 + 396 + ] + /Rotate 180 + /Parent 6 0 R + /Type /Page +>> +endobj + +16 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +17 0 obj +[ + /PDF + /Text +] +endobj + +18 0 obj +<< + /BaseFont /Courier-Oblique + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Contents for page 3 +19 0 obj +<< + /Length 20 0 R +>> +stream +BT + /F1 24 Tf + 72 322 Td + (Potato 3) Tj +ET +endstream +endobj + +20 0 obj +46 +endobj + +%% Contents for page 4 +21 0 obj +<< + /Length 22 0 R +>> +stream +BT + /F1 24 Tf + 72 322 Td + (Potato 4) Tj +ET +endstream +endobj + +22 0 obj +46 +endobj + +23 0 obj +<< + /BaseFont /Times-Bold + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Contents for page 5 +24 0 obj +<< + /Length 25 0 R +>> +stream +BT + /F1 24 Tf + 72 322 Td + (Potato 5) Tj +ET +endstream +endobj + +25 0 obj +46 +endobj + +26 0 obj +null +endobj + +27 0 obj +null +endobj + +28 0 obj +2 +endobj + +xref +0 29 +0000000000 65535 f +0000001331 00000 n +0000001414 00000 n +0000001500 00000 n +0000001667 00000 n +0000001767 00000 n +0000001849 00000 n +0000002033 00000 n +0000002127 00000 n +0000002228 00000 n +0000002247 00000 n +0000002342 00000 n +0000002445 00000 n +0000002475 00000 n +0000002570 00000 n +0000002730 00000 n +0000002862 00000 n +0000002981 00000 n +0000003017 00000 n +0000003165 00000 n +0000003268 00000 n +0000003311 00000 n +0000003414 00000 n +0000003434 00000 n +0000003577 00000 n +0000003680 00000 n +0000003700 00000 n +0000003722 00000 n +0000003744 00000 n +trailer << + /Root 1 0 R + /Size 29 + /ID [] +>> +startxref +3763 +%%EOF diff --git a/qpdf/qtest/qpdf/lin-special.preserve.exp b/qpdf/qtest/qpdf/lin-special.preserve.exp new file mode 100644 index 0000000..852c008 Binary files /dev/null and b/qpdf/qtest/qpdf/lin-special.preserve.exp differ diff --git a/qpdf/qtest/qpdf/lin0.out b/qpdf/qtest/qpdf/lin0.out new file mode 100644 index 0000000..a6e32e4 --- /dev/null +++ b/qpdf/qtest/qpdf/lin0.out @@ -0,0 +1 @@ +lin0.pdf is not linearized diff --git a/qpdf/qtest/qpdf/lin0.pdf b/qpdf/qtest/qpdf/lin0.pdf new file mode 100644 index 0000000..a7e01f9 --- /dev/null +++ b/qpdf/qtest/qpdf/lin0.pdf @@ -0,0 +1,79 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/lin1.out b/qpdf/qtest/qpdf/lin1.out new file mode 100644 index 0000000..d97842b --- /dev/null +++ b/qpdf/qtest/qpdf/lin1.out @@ -0,0 +1,378 @@ +WARNING: end of first page section (/E) mismatch: /E = 1827; computed = 3889..3891 +WARNING: page 0 has shared identifier entries +WARNING: page 0: shared object 62: in hint table but not computed list +lin1.pdf: linearization data: + +file_size: 13103 +first_page_object: 62 +first_page_end: 1827 +npages: 30 +xref_zero_offset: 11776 +first_page: 0 +H_offset: 1211 +H_length: 203 + +Page Offsets Hint Table + +min_nobjects: 2 +first_page_offset: 1414 +nbits_delta_nobjects: 4 +min_page_length: 259 +nbits_delta_page_length: 12 +min_content_offset: 0 +nbits_delta_content_offset: 0 +min_content_length: 0 +nbits_delta_content_length: 12 +nbits_nshared_objects: 2 +nbits_shared_identifier: 2 +nbits_shared_numerator: 4 +shared_denominator: 8 +Page 0: + nobjects: 16 + length: 2477 + content_offset: 0 + content_length: 2218 + nshared_objects: 2 + identifier 0: 0 + numerator 0: 0 + identifier 1: 0 + numerator 1: 0 +Page 1: + nobjects: 2 + length: 259 + content_offset: 0 + content_length: 0 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 2: + nobjects: 2 + length: 259 + content_offset: 0 + content_length: 0 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 3: + nobjects: 2 + length: 259 + content_offset: 0 + content_length: 0 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 4: + nobjects: 2 + length: 259 + content_offset: 0 + content_length: 0 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 5: + nobjects: 2 + length: 261 + content_offset: 0 + content_length: 2 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 6: + nobjects: 2 + length: 262 + content_offset: 0 + content_length: 3 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 7: + nobjects: 2 + length: 262 + content_offset: 0 + content_length: 3 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 8: + nobjects: 2 + length: 262 + content_offset: 0 + content_length: 3 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 9: + nobjects: 2 + length: 262 + content_offset: 0 + content_length: 3 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 10: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 11: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 12: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 13: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 14: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 15: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 16: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 17: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 18: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 19: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 20: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 21: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 22: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 23: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 24: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 25: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 26: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 27: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 28: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 29: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + +Shared Objects Hint Table + +first_shared_obj: 0 +first_shared_offset: 0 +nshared_first_page: 16 +nshared_total: 16 +nbits_nobjects: 0 +min_group_length: 34 +nbits_delta_group_length: 9 +Shared Object 0: + group length: 157 +Shared Object 1: + group length: 105 +Shared Object 2: + group length: 117 +Shared Object 3: + group length: 34 +Shared Object 4: + group length: 82 +Shared Object 5: + group length: 191 +Shared Object 6: + group length: 144 +Shared Object 7: + group length: 168 +Shared Object 8: + group length: 291 +Shared Object 9: + group length: 165 +Shared Object 10: + group length: 162 +Shared Object 11: + group length: 182 +Shared Object 12: + group length: 201 +Shared Object 13: + group length: 150 +Shared Object 14: + group length: 164 +Shared Object 15: + group length: 164 + +Outlines Hint Table + +first_object: 66 +first_object_offset: 1827 +nobjects: 12 +group_length: 2064 diff --git a/qpdf/qtest/qpdf/lin1.pdf b/qpdf/qtest/qpdf/lin1.pdf new file mode 100644 index 0000000..aac1291 Binary files /dev/null and b/qpdf/qtest/qpdf/lin1.pdf differ diff --git a/qpdf/qtest/qpdf/lin2.out b/qpdf/qtest/qpdf/lin2.out new file mode 100644 index 0000000..4be0881 --- /dev/null +++ b/qpdf/qtest/qpdf/lin2.out @@ -0,0 +1,378 @@ +WARNING: end of first page section (/E) mismatch: /E = 1827; computed = 3889..3891 +WARNING: page 0 has shared identifier entries +WARNING: page 0: shared object 62: in hint table but not computed list +lin2.pdf: linearization data: + +file_size: 13103 +first_page_object: 62 +first_page_end: 1827 +npages: 30 +xref_zero_offset: 11776 +first_page: 0 +H_offset: 1211 +H_length: 203 + +Page Offsets Hint Table + +min_nobjects: 2 +first_page_offset: 1414 +nbits_delta_nobjects: 4 +min_page_length: 259 +nbits_delta_page_length: 12 +min_content_offset: 0 +nbits_delta_content_offset: 0 +min_content_length: 0 +nbits_delta_content_length: 12 +nbits_nshared_objects: 2 +nbits_shared_identifier: 2 +nbits_shared_numerator: 4 +shared_denominator: 8 +Page 0: + nobjects: 16 + length: 2477 + content_offset: 0 + content_length: 2218 + nshared_objects: 2 + identifier 0: 0 + numerator 0: 0 + identifier 1: 0 + numerator 1: 0 +Page 1: + nobjects: 2 + length: 259 + content_offset: 0 + content_length: 0 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 2: + nobjects: 2 + length: 259 + content_offset: 0 + content_length: 0 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 3: + nobjects: 2 + length: 259 + content_offset: 0 + content_length: 0 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 4: + nobjects: 2 + length: 259 + content_offset: 0 + content_length: 0 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 5: + nobjects: 2 + length: 261 + content_offset: 0 + content_length: 2 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 6: + nobjects: 2 + length: 262 + content_offset: 0 + content_length: 3 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 7: + nobjects: 2 + length: 262 + content_offset: 0 + content_length: 3 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 8: + nobjects: 2 + length: 262 + content_offset: 0 + content_length: 3 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 9: + nobjects: 2 + length: 262 + content_offset: 0 + content_length: 3 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 10: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 11: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 12: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 13: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 14: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 15: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 16: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 17: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 18: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 19: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 20: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 21: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 22: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 23: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 24: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 25: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 26: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 27: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 28: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 29: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + +Shared Objects Hint Table + +first_shared_obj: 0 +first_shared_offset: 0 +nshared_first_page: 16 +nshared_total: 16 +nbits_nobjects: 0 +min_group_length: 34 +nbits_delta_group_length: 9 +Shared Object 0: + group length: 157 +Shared Object 1: + group length: 105 +Shared Object 2: + group length: 117 +Shared Object 3: + group length: 34 +Shared Object 4: + group length: 82 +Shared Object 5: + group length: 191 +Shared Object 6: + group length: 144 +Shared Object 7: + group length: 168 +Shared Object 8: + group length: 291 +Shared Object 9: + group length: 165 +Shared Object 10: + group length: 162 +Shared Object 11: + group length: 182 +Shared Object 12: + group length: 201 +Shared Object 13: + group length: 150 +Shared Object 14: + group length: 164 +Shared Object 15: + group length: 164 + +Outlines Hint Table + +first_object: 66 +first_object_offset: 1827 +nobjects: 12 +group_length: 2064 diff --git a/qpdf/qtest/qpdf/lin2.pdf b/qpdf/qtest/qpdf/lin2.pdf new file mode 100644 index 0000000..40cb002 Binary files /dev/null and b/qpdf/qtest/qpdf/lin2.pdf differ diff --git a/qpdf/qtest/qpdf/lin3.out b/qpdf/qtest/qpdf/lin3.out new file mode 100644 index 0000000..468cfa5 --- /dev/null +++ b/qpdf/qtest/qpdf/lin3.out @@ -0,0 +1,318 @@ +WARNING: end of first page section (/E) mismatch: /E = 3978; computed = 3785..3786 +WARNING: page 1: shared object 107: in computed list but not hint table +WARNING: page 1: shared object 109: in computed list but not hint table +WARNING: page 2: shared object 107: in computed list but not hint table +WARNING: page 2: shared object 109: in computed list but not hint table +WARNING: page 3: shared object 107: in computed list but not hint table +WARNING: page 3: shared object 109: in computed list but not hint table +WARNING: page 4: shared object 107: in computed list but not hint table +WARNING: page 4: shared object 109: in computed list but not hint table +WARNING: page 5: shared object 107: in computed list but not hint table +WARNING: page 5: shared object 109: in computed list but not hint table +WARNING: page 6: shared object 107: in computed list but not hint table +WARNING: page 6: shared object 109: in computed list but not hint table +WARNING: page 7: shared object 107: in computed list but not hint table +WARNING: page 7: shared object 109: in computed list but not hint table +WARNING: page 8: shared object 107: in computed list but not hint table +WARNING: page 8: shared object 109: in computed list but not hint table +WARNING: page 9: shared object 107: in computed list but not hint table +WARNING: page 9: shared object 109: in computed list but not hint table +WARNING: page 10: shared object 107: in computed list but not hint table +WARNING: page 10: shared object 109: in computed list but not hint table +WARNING: page 11: shared object 107: in computed list but not hint table +WARNING: page 11: shared object 109: in computed list but not hint table +WARNING: page 12: shared object 107: in computed list but not hint table +WARNING: page 12: shared object 109: in computed list but not hint table +WARNING: page 13: shared object 107: in computed list but not hint table +WARNING: page 13: shared object 109: in computed list but not hint table +WARNING: page 14: shared object 107: in computed list but not hint table +WARNING: page 14: shared object 109: in computed list but not hint table +WARNING: page 15: shared object 107: in computed list but not hint table +WARNING: page 15: shared object 109: in computed list but not hint table +WARNING: page 16: shared object 107: in computed list but not hint table +WARNING: page 16: shared object 109: in computed list but not hint table +WARNING: page 17: shared object 107: in computed list but not hint table +WARNING: page 17: shared object 109: in computed list but not hint table +WARNING: page 18: shared object 107: in computed list but not hint table +WARNING: page 18: shared object 109: in computed list but not hint table +WARNING: page 19: shared object 107: in computed list but not hint table +WARNING: page 19: shared object 109: in computed list but not hint table +WARNING: page 20: shared object 107: in computed list but not hint table +WARNING: page 20: shared object 109: in computed list but not hint table +WARNING: page 21: shared object 107: in computed list but not hint table +WARNING: page 21: shared object 109: in computed list but not hint table +WARNING: page 22: shared object 107: in computed list but not hint table +WARNING: page 22: shared object 109: in computed list but not hint table +WARNING: page 23: shared object 107: in computed list but not hint table +WARNING: page 23: shared object 109: in computed list but not hint table +WARNING: page 24: shared object 107: in computed list but not hint table +WARNING: page 24: shared object 109: in computed list but not hint table +WARNING: page 25: shared object 107: in computed list but not hint table +WARNING: page 25: shared object 109: in computed list but not hint table +WARNING: page 26: shared object 107: in computed list but not hint table +WARNING: page 26: shared object 109: in computed list but not hint table +WARNING: page 27: shared object 107: in computed list but not hint table +WARNING: page 27: shared object 109: in computed list but not hint table +WARNING: page 28: shared object 107: in computed list but not hint table +WARNING: page 28: shared object 109: in computed list but not hint table +WARNING: page 29: shared object 107: in computed list but not hint table +WARNING: page 29: shared object 109: in computed list but not hint table +WARNING: incorrect offset in outlines table: hint table = 1627; computed = 1547 +WARNING: incorrect length in outlines table: hint table = 1988; computed = 1936 +lin3.pdf: linearization data: + +file_size: 16937 +first_page_object: 93 +first_page_end: 3978 +npages: 30 +xref_zero_offset: 14999 +first_page: 0 +H_offset: 1142 +H_length: 210 + +Page Offsets Hint Table + +min_nobjects: 3 +first_page_offset: 1352 +nbits_delta_nobjects: 5 +min_page_length: 339 +nbits_delta_page_length: 12 +min_content_offset: 0 +nbits_delta_content_offset: 0 +min_content_length: 0 +nbits_delta_content_length: 12 +nbits_nshared_objects: 0 +nbits_shared_identifier: 5 +nbits_shared_numerator: 0 +shared_denominator: 8 +Page 0: + nobjects: 17 + length: 2434 + content_offset: 0 + content_length: 2095 + nshared_objects: 0 +Page 1: + nobjects: 3 + length: 339 + content_offset: 0 + content_length: 0 + nshared_objects: 0 +Page 2: + nobjects: 3 + length: 339 + content_offset: 0 + content_length: 0 + nshared_objects: 0 +Page 3: + nobjects: 3 + length: 339 + content_offset: 0 + content_length: 0 + nshared_objects: 0 +Page 4: + nobjects: 3 + length: 344 + content_offset: 0 + content_length: 5 + nshared_objects: 0 +Page 5: + nobjects: 3 + length: 344 + content_offset: 0 + content_length: 5 + nshared_objects: 0 +Page 6: + nobjects: 3 + length: 344 + content_offset: 0 + content_length: 5 + nshared_objects: 0 +Page 7: + nobjects: 3 + length: 344 + content_offset: 0 + content_length: 5 + nshared_objects: 0 +Page 8: + nobjects: 3 + length: 344 + content_offset: 0 + content_length: 5 + nshared_objects: 0 +Page 9: + nobjects: 3 + length: 344 + content_offset: 0 + content_length: 5 + nshared_objects: 0 +Page 10: + nobjects: 3 + length: 345 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 11: + nobjects: 3 + length: 345 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 12: + nobjects: 3 + length: 345 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 13: + nobjects: 3 + length: 345 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 14: + nobjects: 3 + length: 345 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 15: + nobjects: 3 + length: 345 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 16: + nobjects: 3 + length: 345 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 17: + nobjects: 3 + length: 345 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 18: + nobjects: 3 + length: 345 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 19: + nobjects: 3 + length: 345 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 20: + nobjects: 3 + length: 345 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 21: + nobjects: 3 + length: 345 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 22: + nobjects: 3 + length: 345 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 23: + nobjects: 3 + length: 345 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 24: + nobjects: 3 + length: 344 + content_offset: 0 + content_length: 5 + nshared_objects: 0 +Page 25: + nobjects: 3 + length: 345 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 26: + nobjects: 3 + length: 345 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 27: + nobjects: 3 + length: 345 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 28: + nobjects: 3 + length: 345 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 29: + nobjects: 3 + length: 345 + content_offset: 0 + content_length: 6 + nshared_objects: 0 + +Shared Objects Hint Table + +first_shared_obj: 0 +first_shared_offset: 16 +nshared_first_page: 17 +nshared_total: 17 +nbits_nobjects: 0 +min_group_length: 21 +nbits_delta_group_length: 8 +Shared Object 0: + group length: 195 +Shared Object 1: + group length: 80 +Shared Object 2: + group length: 189 +Shared Object 3: + group length: 141 +Shared Object 4: + group length: 167 +Shared Object 5: + group length: 174 +Shared Object 6: + group length: 163 +Shared Object 7: + group length: 160 +Shared Object 8: + group length: 183 +Shared Object 9: + group length: 202 +Shared Object 10: + group length: 149 +Shared Object 11: + group length: 164 +Shared Object 12: + group length: 164 +Shared Object 13: + group length: 132 +Shared Object 14: + group length: 116 +Shared Object 15: + group length: 21 +Shared Object 16: + group length: 34 + +Outlines Hint Table + +first_object: 94 +first_object_offset: 1627 +nobjects: 12 +group_length: 1988 diff --git a/qpdf/qtest/qpdf/lin3.pdf b/qpdf/qtest/qpdf/lin3.pdf new file mode 100644 index 0000000..e33c701 Binary files /dev/null and b/qpdf/qtest/qpdf/lin3.pdf differ diff --git a/qpdf/qtest/qpdf/lin4.out b/qpdf/qtest/qpdf/lin4.out new file mode 100644 index 0000000..42c6282 --- /dev/null +++ b/qpdf/qtest/qpdf/lin4.out @@ -0,0 +1,353 @@ +WARNING: page 0 has shared identifier entries +WARNING: page 0: shared object 74: in hint table but not computed list +lin4.pdf: linearization data: + +file_size: 13055 +first_page_object: 74 +first_page_end: 1539 +npages: 30 +xref_zero_offset: 11488 +first_page: 0 +H_offset: 946 +H_length: 180 + +Page Offsets Hint Table + +min_nobjects: 2 +first_page_offset: 1126 +nbits_delta_nobjects: 2 +min_page_length: 259 +nbits_delta_page_length: 8 +min_content_offset: 0 +nbits_delta_content_offset: 0 +min_content_length: 0 +nbits_delta_content_length: 8 +nbits_nshared_objects: 2 +nbits_shared_identifier: 2 +nbits_shared_numerator: 4 +shared_denominator: 8 +Page 0: + nobjects: 4 + length: 413 + content_offset: 0 + content_length: 154 + nshared_objects: 2 + identifier 0: 0 + numerator 0: 0 + identifier 1: 0 + numerator 1: 0 +Page 1: + nobjects: 2 + length: 259 + content_offset: 0 + content_length: 0 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 2: + nobjects: 2 + length: 259 + content_offset: 0 + content_length: 0 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 3: + nobjects: 2 + length: 259 + content_offset: 0 + content_length: 0 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 4: + nobjects: 2 + length: 259 + content_offset: 0 + content_length: 0 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 5: + nobjects: 2 + length: 261 + content_offset: 0 + content_length: 2 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 6: + nobjects: 2 + length: 262 + content_offset: 0 + content_length: 3 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 7: + nobjects: 2 + length: 262 + content_offset: 0 + content_length: 3 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 8: + nobjects: 2 + length: 262 + content_offset: 0 + content_length: 3 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 9: + nobjects: 2 + length: 262 + content_offset: 0 + content_length: 3 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 10: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 11: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 12: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 13: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 14: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 15: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 16: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 17: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 18: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 19: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 20: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 21: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 22: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 23: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 24: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 25: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 26: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 27: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 28: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 +Page 29: + nobjects: 2 + length: 263 + content_offset: 0 + content_length: 4 + nshared_objects: 2 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + +Shared Objects Hint Table + +first_shared_obj: 0 +first_shared_offset: 0 +nshared_first_page: 4 +nshared_total: 4 +nbits_nobjects: 0 +min_group_length: 34 +nbits_delta_group_length: 7 +Shared Object 0: + group length: 157 +Shared Object 1: + group length: 105 +Shared Object 2: + group length: 117 +Shared Object 3: + group length: 34 + +Outlines Hint Table + +first_object: 60 +first_object_offset: 9413 +nobjects: 12 +group_length: 2064 diff --git a/qpdf/qtest/qpdf/lin4.pdf b/qpdf/qtest/qpdf/lin4.pdf new file mode 100644 index 0000000..4778bd8 Binary files /dev/null and b/qpdf/qtest/qpdf/lin4.pdf differ diff --git a/qpdf/qtest/qpdf/lin5.out b/qpdf/qtest/qpdf/lin5.out new file mode 100644 index 0000000..b2261a1 --- /dev/null +++ b/qpdf/qtest/qpdf/lin5.out @@ -0,0 +1,318 @@ +WARNING: end of first page section (/E) mismatch: /E = 4213; computed = 4004..4005 +WARNING: page 1: shared object 170: in computed list but not hint table +WARNING: page 1: shared object 172: in computed list but not hint table +WARNING: page 2: shared object 170: in computed list but not hint table +WARNING: page 2: shared object 172: in computed list but not hint table +WARNING: page 3: shared object 170: in computed list but not hint table +WARNING: page 3: shared object 172: in computed list but not hint table +WARNING: page 4: shared object 170: in computed list but not hint table +WARNING: page 4: shared object 172: in computed list but not hint table +WARNING: page 5: shared object 170: in computed list but not hint table +WARNING: page 5: shared object 172: in computed list but not hint table +WARNING: page 6: shared object 170: in computed list but not hint table +WARNING: page 6: shared object 172: in computed list but not hint table +WARNING: page 7: shared object 170: in computed list but not hint table +WARNING: page 7: shared object 172: in computed list but not hint table +WARNING: page 8: shared object 170: in computed list but not hint table +WARNING: page 8: shared object 172: in computed list but not hint table +WARNING: page 9: shared object 170: in computed list but not hint table +WARNING: page 9: shared object 172: in computed list but not hint table +WARNING: page 10: shared object 170: in computed list but not hint table +WARNING: page 10: shared object 172: in computed list but not hint table +WARNING: page 11: shared object 170: in computed list but not hint table +WARNING: page 11: shared object 172: in computed list but not hint table +WARNING: page 12: shared object 170: in computed list but not hint table +WARNING: page 12: shared object 172: in computed list but not hint table +WARNING: page 13: shared object 170: in computed list but not hint table +WARNING: page 13: shared object 172: in computed list but not hint table +WARNING: page 14: shared object 170: in computed list but not hint table +WARNING: page 14: shared object 172: in computed list but not hint table +WARNING: page 15: shared object 170: in computed list but not hint table +WARNING: page 15: shared object 172: in computed list but not hint table +WARNING: page 16: shared object 170: in computed list but not hint table +WARNING: page 16: shared object 172: in computed list but not hint table +WARNING: page 17: shared object 170: in computed list but not hint table +WARNING: page 17: shared object 172: in computed list but not hint table +WARNING: page 18: shared object 170: in computed list but not hint table +WARNING: page 18: shared object 172: in computed list but not hint table +WARNING: page 19: shared object 170: in computed list but not hint table +WARNING: page 19: shared object 172: in computed list but not hint table +WARNING: page 20: shared object 170: in computed list but not hint table +WARNING: page 20: shared object 172: in computed list but not hint table +WARNING: page 21: shared object 170: in computed list but not hint table +WARNING: page 21: shared object 172: in computed list but not hint table +WARNING: page 22: shared object 170: in computed list but not hint table +WARNING: page 22: shared object 172: in computed list but not hint table +WARNING: page 23: shared object 170: in computed list but not hint table +WARNING: page 23: shared object 172: in computed list but not hint table +WARNING: page 24: shared object 170: in computed list but not hint table +WARNING: page 24: shared object 172: in computed list but not hint table +WARNING: page 25: shared object 170: in computed list but not hint table +WARNING: page 25: shared object 172: in computed list but not hint table +WARNING: page 26: shared object 170: in computed list but not hint table +WARNING: page 26: shared object 172: in computed list but not hint table +WARNING: page 27: shared object 170: in computed list but not hint table +WARNING: page 27: shared object 172: in computed list but not hint table +WARNING: page 28: shared object 170: in computed list but not hint table +WARNING: page 28: shared object 172: in computed list but not hint table +WARNING: page 29: shared object 170: in computed list but not hint table +WARNING: page 29: shared object 172: in computed list but not hint table +WARNING: incorrect offset in outlines table: hint table = 1710; computed = 1627 +WARNING: incorrect length in outlines table: hint table = 2124; computed = 2075 +lin5.pdf: linearization data: + +file_size: 27464 +first_page_object: 156 +first_page_end: 4213 +npages: 30 +xref_zero_offset: 24265 +first_page: 0 +H_offset: 1149 +H_length: 266 + +Page Offsets Hint Table + +min_nobjects: 3 +first_page_offset: 1415 +nbits_delta_nobjects: 5 +min_page_length: 355 +nbits_delta_page_length: 12 +min_content_offset: 0 +nbits_delta_content_offset: 0 +min_content_length: 0 +nbits_delta_content_length: 12 +nbits_nshared_objects: 0 +nbits_shared_identifier: 5 +nbits_shared_numerator: 0 +shared_denominator: 8 +Page 0: + nobjects: 17 + length: 2590 + content_offset: 0 + content_length: 2235 + nshared_objects: 0 +Page 1: + nobjects: 3 + length: 355 + content_offset: 0 + content_length: 0 + nshared_objects: 0 +Page 2: + nobjects: 3 + length: 355 + content_offset: 0 + content_length: 0 + nshared_objects: 0 +Page 3: + nobjects: 3 + length: 355 + content_offset: 0 + content_length: 0 + nshared_objects: 0 +Page 4: + nobjects: 3 + length: 360 + content_offset: 0 + content_length: 5 + nshared_objects: 0 +Page 5: + nobjects: 3 + length: 360 + content_offset: 0 + content_length: 5 + nshared_objects: 0 +Page 6: + nobjects: 3 + length: 361 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 7: + nobjects: 3 + length: 361 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 8: + nobjects: 3 + length: 361 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 9: + nobjects: 3 + length: 361 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 10: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 7 + nshared_objects: 0 +Page 11: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 7 + nshared_objects: 0 +Page 12: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 7 + nshared_objects: 0 +Page 13: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 7 + nshared_objects: 0 +Page 14: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 7 + nshared_objects: 0 +Page 15: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 7 + nshared_objects: 0 +Page 16: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 7 + nshared_objects: 0 +Page 17: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 7 + nshared_objects: 0 +Page 18: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 7 + nshared_objects: 0 +Page 19: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 7 + nshared_objects: 0 +Page 20: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 7 + nshared_objects: 0 +Page 21: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 7 + nshared_objects: 0 +Page 22: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 7 + nshared_objects: 0 +Page 23: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 7 + nshared_objects: 0 +Page 24: + nobjects: 3 + length: 361 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 25: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 7 + nshared_objects: 0 +Page 26: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 7 + nshared_objects: 0 +Page 27: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 7 + nshared_objects: 0 +Page 28: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 7 + nshared_objects: 0 +Page 29: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 7 + nshared_objects: 0 + +Shared Objects Hint Table + +first_shared_obj: 0 +first_shared_offset: 16 +nshared_first_page: 17 +nshared_total: 17 +nbits_nobjects: 0 +min_group_length: 21 +nbits_delta_group_length: 9 +Shared Object 0: + group length: 212 +Shared Object 1: + group length: 83 +Shared Object 2: + group length: 194 +Shared Object 3: + group length: 144 +Shared Object 4: + group length: 170 +Shared Object 5: + group length: 292 +Shared Object 6: + group length: 165 +Shared Object 7: + group length: 163 +Shared Object 8: + group length: 184 +Shared Object 9: + group length: 203 +Shared Object 10: + group length: 149 +Shared Object 11: + group length: 164 +Shared Object 12: + group length: 164 +Shared Object 13: + group length: 132 +Shared Object 14: + group length: 116 +Shared Object 15: + group length: 21 +Shared Object 16: + group length: 34 + +Outlines Hint Table + +first_object: 157 +first_object_offset: 1710 +nobjects: 12 +group_length: 2124 diff --git a/qpdf/qtest/qpdf/lin5.pdf b/qpdf/qtest/qpdf/lin5.pdf new file mode 100644 index 0000000..a41aa34 Binary files /dev/null and b/qpdf/qtest/qpdf/lin5.pdf differ diff --git a/qpdf/qtest/qpdf/lin6.out b/qpdf/qtest/qpdf/lin6.out new file mode 100644 index 0000000..3ed08aa --- /dev/null +++ b/qpdf/qtest/qpdf/lin6.out @@ -0,0 +1,592 @@ +WARNING: end of first page section (/E) mismatch: /E = 2897; computed = 5005..5007 +WARNING: object count mismatch for page 0: hint table = 19; computed = 16 +WARNING: page 0 has shared identifier entries +WARNING: page 0: shared object 93: in hint table but not computed list +WARNING: object count mismatch for page 1: hint table = 3; computed = 2 +WARNING: page 1: shared object 98: in hint table but not computed list +WARNING: page 1: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 2: hint table = 3; computed = 2 +WARNING: page 2: shared object 98: in hint table but not computed list +WARNING: page 2: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 3: hint table = 3; computed = 2 +WARNING: page 3: shared object 98: in hint table but not computed list +WARNING: page 3: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 4: hint table = 3; computed = 2 +WARNING: page 4: shared object 98: in hint table but not computed list +WARNING: page 4: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 5: hint table = 3; computed = 2 +WARNING: page 5: shared object 98: in hint table but not computed list +WARNING: page 5: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 6: hint table = 3; computed = 2 +WARNING: page 6: shared object 98: in hint table but not computed list +WARNING: page 6: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 7: hint table = 3; computed = 2 +WARNING: page 7: shared object 98: in hint table but not computed list +WARNING: page 7: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 8: hint table = 3; computed = 2 +WARNING: page 8: shared object 98: in hint table but not computed list +WARNING: page 8: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 9: hint table = 3; computed = 2 +WARNING: page 9: shared object 98: in hint table but not computed list +WARNING: page 9: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 10: hint table = 3; computed = 2 +WARNING: page 10: shared object 98: in hint table but not computed list +WARNING: page 10: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 11: hint table = 3; computed = 2 +WARNING: page 11: shared object 98: in hint table but not computed list +WARNING: page 11: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 12: hint table = 3; computed = 2 +WARNING: page 12: shared object 98: in hint table but not computed list +WARNING: page 12: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 13: hint table = 3; computed = 2 +WARNING: page 13: shared object 98: in hint table but not computed list +WARNING: page 13: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 14: hint table = 3; computed = 2 +WARNING: page 14: shared object 98: in hint table but not computed list +WARNING: page 14: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 15: hint table = 3; computed = 2 +WARNING: page 15: shared object 98: in hint table but not computed list +WARNING: page 15: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 16: hint table = 3; computed = 2 +WARNING: page 16: shared object 98: in hint table but not computed list +WARNING: page 16: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 17: hint table = 3; computed = 2 +WARNING: page 17: shared object 98: in hint table but not computed list +WARNING: page 17: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 18: hint table = 3; computed = 2 +WARNING: page 18: shared object 98: in hint table but not computed list +WARNING: page 18: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 19: hint table = 3; computed = 2 +WARNING: page 19: shared object 98: in hint table but not computed list +WARNING: page 19: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 20: hint table = 3; computed = 2 +WARNING: page 20: shared object 98: in hint table but not computed list +WARNING: page 20: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 21: hint table = 3; computed = 2 +WARNING: page 21: shared object 98: in hint table but not computed list +WARNING: page 21: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 22: hint table = 3; computed = 2 +WARNING: page 22: shared object 98: in hint table but not computed list +WARNING: page 22: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 23: hint table = 3; computed = 2 +WARNING: page 23: shared object 98: in hint table but not computed list +WARNING: page 23: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 24: hint table = 3; computed = 2 +WARNING: page 24: shared object 98: in hint table but not computed list +WARNING: page 24: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 25: hint table = 3; computed = 2 +WARNING: page 25: shared object 98: in hint table but not computed list +WARNING: page 25: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 26: hint table = 3; computed = 2 +WARNING: page 26: shared object 98: in hint table but not computed list +WARNING: page 26: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 27: hint table = 3; computed = 2 +WARNING: page 27: shared object 98: in hint table but not computed list +WARNING: page 27: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 28: hint table = 3; computed = 2 +WARNING: page 28: shared object 98: in hint table but not computed list +WARNING: page 28: shared object 99: in hint table but not computed list +WARNING: object count mismatch for page 29: hint table = 3; computed = 2 +WARNING: page 29: shared object 98: in hint table but not computed list +WARNING: page 29: shared object 99: in hint table but not computed list +lin6.pdf: linearization data: + +file_size: 24824 +first_page_object: 93 +first_page_end: 2897 +npages: 30 +xref_zero_offset: 22877 +first_page: 0 +H_offset: 1291 +H_length: 232 + +Page Offsets Hint Table + +min_nobjects: 3 +first_page_offset: 1523 +nbits_delta_nobjects: 5 +min_page_length: 580 +nbits_delta_page_length: 12 +min_content_offset: 0 +nbits_delta_content_offset: 0 +min_content_length: 0 +nbits_delta_content_length: 12 +nbits_nshared_objects: 3 +nbits_shared_identifier: 3 +nbits_shared_numerator: 4 +shared_denominator: 8 +Page 0: + nobjects: 19 + length: 3484 + content_offset: 0 + content_length: 2904 + nshared_objects: 4 + identifier 0: 0 + numerator 0: 0 + identifier 1: 0 + numerator 1: 0 + identifier 2: 0 + numerator 2: 0 + identifier 3: 0 + numerator 3: 0 +Page 1: + nobjects: 3 + length: 580 + content_offset: 0 + content_length: 0 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 2: + nobjects: 3 + length: 580 + content_offset: 0 + content_length: 0 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 3: + nobjects: 3 + length: 584 + content_offset: 0 + content_length: 4 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 4: + nobjects: 3 + length: 591 + content_offset: 0 + content_length: 11 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 5: + nobjects: 3 + length: 583 + content_offset: 0 + content_length: 3 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 6: + nobjects: 3 + length: 589 + content_offset: 0 + content_length: 9 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 7: + nobjects: 3 + length: 583 + content_offset: 0 + content_length: 3 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 8: + nobjects: 3 + length: 591 + content_offset: 0 + content_length: 11 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 9: + nobjects: 3 + length: 584 + content_offset: 0 + content_length: 4 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 10: + nobjects: 3 + length: 589 + content_offset: 0 + content_length: 9 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 11: + nobjects: 3 + length: 588 + content_offset: 0 + content_length: 8 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 12: + nobjects: 3 + length: 590 + content_offset: 0 + content_length: 10 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 13: + nobjects: 3 + length: 590 + content_offset: 0 + content_length: 10 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 14: + nobjects: 3 + length: 590 + content_offset: 0 + content_length: 10 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 15: + nobjects: 3 + length: 589 + content_offset: 0 + content_length: 9 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 16: + nobjects: 3 + length: 590 + content_offset: 0 + content_length: 10 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 17: + nobjects: 3 + length: 589 + content_offset: 0 + content_length: 9 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 18: + nobjects: 3 + length: 590 + content_offset: 0 + content_length: 10 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 19: + nobjects: 3 + length: 589 + content_offset: 0 + content_length: 9 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 20: + nobjects: 3 + length: 589 + content_offset: 0 + content_length: 9 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 21: + nobjects: 3 + length: 588 + content_offset: 0 + content_length: 8 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 22: + nobjects: 3 + length: 590 + content_offset: 0 + content_length: 10 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 23: + nobjects: 3 + length: 590 + content_offset: 0 + content_length: 10 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 24: + nobjects: 3 + length: 589 + content_offset: 0 + content_length: 9 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 25: + nobjects: 3 + length: 589 + content_offset: 0 + content_length: 9 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 26: + nobjects: 3 + length: 590 + content_offset: 0 + content_length: 10 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 27: + nobjects: 3 + length: 589 + content_offset: 0 + content_length: 9 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 28: + nobjects: 3 + length: 590 + content_offset: 0 + content_length: 10 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 29: + nobjects: 3 + length: 589 + content_offset: 0 + content_length: 9 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 + +Shared Objects Hint Table + +first_shared_obj: 0 +first_shared_offset: 0 +nshared_first_page: 19 +nshared_total: 19 +nbits_nobjects: 0 +min_group_length: 34 +nbits_delta_group_length: 10 +Shared Object 0: + group length: 209 +Shared Object 1: + group length: 133 +Shared Object 2: + group length: 117 +Shared Object 3: + group length: 34 +Shared Object 4: + group length: 247 +Shared Object 5: + group length: 54 +Shared Object 6: + group length: 580 +Shared Object 7: + group length: 85 +Shared Object 8: + group length: 197 +Shared Object 9: + group length: 147 +Shared Object 10: + group length: 173 +Shared Object 11: + group length: 296 +Shared Object 12: + group length: 168 +Shared Object 13: + group length: 165 +Shared Object 14: + group length: 187 +Shared Object 15: + group length: 206 +Shared Object 16: + group length: 152 +Shared Object 17: + group length: 167 +Shared Object 18: + group length: 167 + +Outlines Hint Table + +first_object: 100 +first_object_offset: 2897 +nobjects: 12 +group_length: 2110 diff --git a/qpdf/qtest/qpdf/lin6.pdf b/qpdf/qtest/qpdf/lin6.pdf new file mode 100644 index 0000000..d76545f Binary files /dev/null and b/qpdf/qtest/qpdf/lin6.pdf differ diff --git a/qpdf/qtest/qpdf/lin7.out b/qpdf/qtest/qpdf/lin7.out new file mode 100644 index 0000000..c98d172 --- /dev/null +++ b/qpdf/qtest/qpdf/lin7.out @@ -0,0 +1,292 @@ +WARNING: end of first page section (/E) mismatch: /E = 1865; computed = 1655..1656 +WARNING: page 1: shared object 170: in computed list but not hint table +WARNING: page 1: shared object 172: in computed list but not hint table +WARNING: page 2: shared object 170: in computed list but not hint table +WARNING: page 2: shared object 172: in computed list but not hint table +WARNING: page 3: shared object 170: in computed list but not hint table +WARNING: page 3: shared object 172: in computed list but not hint table +WARNING: page 4: shared object 170: in computed list but not hint table +WARNING: page 4: shared object 172: in computed list but not hint table +WARNING: page 5: shared object 170: in computed list but not hint table +WARNING: page 5: shared object 172: in computed list but not hint table +WARNING: page 6: shared object 170: in computed list but not hint table +WARNING: page 6: shared object 172: in computed list but not hint table +WARNING: page 7: shared object 170: in computed list but not hint table +WARNING: page 7: shared object 172: in computed list but not hint table +WARNING: page 8: shared object 170: in computed list but not hint table +WARNING: page 8: shared object 172: in computed list but not hint table +WARNING: page 9: shared object 170: in computed list but not hint table +WARNING: page 9: shared object 172: in computed list but not hint table +WARNING: page 10: shared object 170: in computed list but not hint table +WARNING: page 10: shared object 172: in computed list but not hint table +WARNING: page 11: shared object 170: in computed list but not hint table +WARNING: page 11: shared object 172: in computed list but not hint table +WARNING: page 12: shared object 170: in computed list but not hint table +WARNING: page 12: shared object 172: in computed list but not hint table +WARNING: page 13: shared object 170: in computed list but not hint table +WARNING: page 13: shared object 172: in computed list but not hint table +WARNING: page 14: shared object 170: in computed list but not hint table +WARNING: page 14: shared object 172: in computed list but not hint table +WARNING: page 15: shared object 170: in computed list but not hint table +WARNING: page 15: shared object 172: in computed list but not hint table +WARNING: page 16: shared object 170: in computed list but not hint table +WARNING: page 16: shared object 172: in computed list but not hint table +WARNING: page 17: shared object 170: in computed list but not hint table +WARNING: page 17: shared object 172: in computed list but not hint table +WARNING: page 18: shared object 170: in computed list but not hint table +WARNING: page 18: shared object 172: in computed list but not hint table +WARNING: page 19: shared object 170: in computed list but not hint table +WARNING: page 19: shared object 172: in computed list but not hint table +WARNING: page 20: shared object 170: in computed list but not hint table +WARNING: page 20: shared object 172: in computed list but not hint table +WARNING: page 21: shared object 170: in computed list but not hint table +WARNING: page 21: shared object 172: in computed list but not hint table +WARNING: page 22: shared object 170: in computed list but not hint table +WARNING: page 22: shared object 172: in computed list but not hint table +WARNING: page 23: shared object 170: in computed list but not hint table +WARNING: page 23: shared object 172: in computed list but not hint table +WARNING: page 24: shared object 170: in computed list but not hint table +WARNING: page 24: shared object 172: in computed list but not hint table +WARNING: page 25: shared object 170: in computed list but not hint table +WARNING: page 25: shared object 172: in computed list but not hint table +WARNING: page 26: shared object 170: in computed list but not hint table +WARNING: page 26: shared object 172: in computed list but not hint table +WARNING: page 27: shared object 170: in computed list but not hint table +WARNING: page 27: shared object 172: in computed list but not hint table +WARNING: page 28: shared object 170: in computed list but not hint table +WARNING: page 28: shared object 172: in computed list but not hint table +WARNING: page 29: shared object 170: in computed list but not hint table +WARNING: page 29: shared object 172: in computed list but not hint table +lin7.pdf: linearization data: + +file_size: 27408 +first_page_object: 168 +first_page_end: 1865 +npages: 30 +xref_zero_offset: 23969 +first_page: 0 +H_offset: 905 +H_length: 235 + +Page Offsets Hint Table + +min_nobjects: 3 +first_page_offset: 1140 +nbits_delta_nobjects: 3 +min_page_length: 356 +nbits_delta_page_length: 8 +min_content_offset: 0 +nbits_delta_content_offset: 0 +min_content_length: 0 +nbits_delta_content_length: 8 +nbits_nshared_objects: 0 +nbits_shared_identifier: 3 +nbits_shared_numerator: 0 +shared_denominator: 8 +Page 0: + nobjects: 5 + length: 516 + content_offset: 0 + content_length: 160 + nshared_objects: 0 +Page 1: + nobjects: 3 + length: 356 + content_offset: 0 + content_length: 0 + nshared_objects: 0 +Page 2: + nobjects: 3 + length: 356 + content_offset: 0 + content_length: 0 + nshared_objects: 0 +Page 3: + nobjects: 3 + length: 356 + content_offset: 0 + content_length: 0 + nshared_objects: 0 +Page 4: + nobjects: 3 + length: 361 + content_offset: 0 + content_length: 5 + nshared_objects: 0 +Page 5: + nobjects: 3 + length: 361 + content_offset: 0 + content_length: 5 + nshared_objects: 0 +Page 6: + nobjects: 3 + length: 361 + content_offset: 0 + content_length: 5 + nshared_objects: 0 +Page 7: + nobjects: 3 + length: 361 + content_offset: 0 + content_length: 5 + nshared_objects: 0 +Page 8: + nobjects: 3 + length: 361 + content_offset: 0 + content_length: 5 + nshared_objects: 0 +Page 9: + nobjects: 3 + length: 361 + content_offset: 0 + content_length: 5 + nshared_objects: 0 +Page 10: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 11: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 12: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 13: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 14: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 15: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 16: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 17: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 18: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 19: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 20: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 21: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 22: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 23: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 24: + nobjects: 3 + length: 361 + content_offset: 0 + content_length: 5 + nshared_objects: 0 +Page 25: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 26: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 27: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 28: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 6 + nshared_objects: 0 +Page 29: + nobjects: 3 + length: 362 + content_offset: 0 + content_length: 6 + nshared_objects: 0 + +Shared Objects Hint Table + +first_shared_obj: 0 +first_shared_offset: 16 +nshared_first_page: 5 +nshared_total: 5 +nbits_nobjects: 0 +min_group_length: 21 +nbits_delta_group_length: 8 +Shared Object 0: + group length: 213 +Shared Object 1: + group length: 132 +Shared Object 2: + group length: 116 +Shared Object 3: + group length: 21 +Shared Object 4: + group length: 34 + +Outlines Hint Table + +first_object: 88 +first_object_offset: 12129 +nobjects: 12 +group_length: 2030 diff --git a/qpdf/qtest/qpdf/lin7.pdf b/qpdf/qtest/qpdf/lin7.pdf new file mode 100644 index 0000000..011daa1 Binary files /dev/null and b/qpdf/qtest/qpdf/lin7.pdf differ diff --git a/qpdf/qtest/qpdf/lin8.out b/qpdf/qtest/qpdf/lin8.out new file mode 100644 index 0000000..696b759 --- /dev/null +++ b/qpdf/qtest/qpdf/lin8.out @@ -0,0 +1,568 @@ +WARNING: end of first page section (/E) mismatch: /E = 2656; computed = 1768..1770 +WARNING: object count mismatch for page 0: hint table = 7; computed = 4 +WARNING: page 0 has shared identifier entries +WARNING: page 0: shared object 105: in hint table but not computed list +WARNING: object count mismatch for page 1: hint table = 3; computed = 2 +WARNING: page 1: shared object 110: in hint table but not computed list +WARNING: page 1: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 2: hint table = 3; computed = 2 +WARNING: page 2: shared object 110: in hint table but not computed list +WARNING: page 2: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 3: hint table = 3; computed = 2 +WARNING: page 3: shared object 110: in hint table but not computed list +WARNING: page 3: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 4: hint table = 3; computed = 2 +WARNING: page 4: shared object 110: in hint table but not computed list +WARNING: page 4: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 5: hint table = 3; computed = 2 +WARNING: page 5: shared object 110: in hint table but not computed list +WARNING: page 5: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 6: hint table = 3; computed = 2 +WARNING: page 6: shared object 110: in hint table but not computed list +WARNING: page 6: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 7: hint table = 3; computed = 2 +WARNING: page 7: shared object 110: in hint table but not computed list +WARNING: page 7: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 8: hint table = 3; computed = 2 +WARNING: page 8: shared object 110: in hint table but not computed list +WARNING: page 8: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 9: hint table = 3; computed = 2 +WARNING: page 9: shared object 110: in hint table but not computed list +WARNING: page 9: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 10: hint table = 3; computed = 2 +WARNING: page 10: shared object 110: in hint table but not computed list +WARNING: page 10: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 11: hint table = 3; computed = 2 +WARNING: page 11: shared object 110: in hint table but not computed list +WARNING: page 11: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 12: hint table = 3; computed = 2 +WARNING: page 12: shared object 110: in hint table but not computed list +WARNING: page 12: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 13: hint table = 3; computed = 2 +WARNING: page 13: shared object 110: in hint table but not computed list +WARNING: page 13: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 14: hint table = 3; computed = 2 +WARNING: page 14: shared object 110: in hint table but not computed list +WARNING: page 14: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 15: hint table = 3; computed = 2 +WARNING: page 15: shared object 110: in hint table but not computed list +WARNING: page 15: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 16: hint table = 3; computed = 2 +WARNING: page 16: shared object 110: in hint table but not computed list +WARNING: page 16: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 17: hint table = 3; computed = 2 +WARNING: page 17: shared object 110: in hint table but not computed list +WARNING: page 17: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 18: hint table = 3; computed = 2 +WARNING: page 18: shared object 110: in hint table but not computed list +WARNING: page 18: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 19: hint table = 3; computed = 2 +WARNING: page 19: shared object 110: in hint table but not computed list +WARNING: page 19: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 20: hint table = 3; computed = 2 +WARNING: page 20: shared object 110: in hint table but not computed list +WARNING: page 20: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 21: hint table = 3; computed = 2 +WARNING: page 21: shared object 110: in hint table but not computed list +WARNING: page 21: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 22: hint table = 3; computed = 2 +WARNING: page 22: shared object 110: in hint table but not computed list +WARNING: page 22: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 23: hint table = 3; computed = 2 +WARNING: page 23: shared object 110: in hint table but not computed list +WARNING: page 23: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 24: hint table = 3; computed = 2 +WARNING: page 24: shared object 110: in hint table but not computed list +WARNING: page 24: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 25: hint table = 3; computed = 2 +WARNING: page 25: shared object 110: in hint table but not computed list +WARNING: page 25: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 26: hint table = 3; computed = 2 +WARNING: page 26: shared object 110: in hint table but not computed list +WARNING: page 26: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 27: hint table = 3; computed = 2 +WARNING: page 27: shared object 110: in hint table but not computed list +WARNING: page 27: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 28: hint table = 3; computed = 2 +WARNING: page 28: shared object 110: in hint table but not computed list +WARNING: page 28: shared object 111: in hint table but not computed list +WARNING: object count mismatch for page 29: hint table = 3; computed = 2 +WARNING: page 29: shared object 110: in hint table but not computed list +WARNING: page 29: shared object 111: in hint table but not computed list +lin8.pdf: linearization data: + +file_size: 24875 +first_page_object: 105 +first_page_end: 2656 +npages: 30 +xref_zero_offset: 22687 +first_page: 0 +H_offset: 1052 +H_length: 217 + +Page Offsets Hint Table + +min_nobjects: 3 +first_page_offset: 1269 +nbits_delta_nobjects: 3 +min_page_length: 583 +nbits_delta_page_length: 10 +min_content_offset: 0 +nbits_delta_content_offset: 0 +min_content_length: 0 +nbits_delta_content_length: 10 +nbits_nshared_objects: 3 +nbits_shared_identifier: 3 +nbits_shared_numerator: 4 +shared_denominator: 8 +Page 0: + nobjects: 7 + length: 1387 + content_offset: 0 + content_length: 804 + nshared_objects: 4 + identifier 0: 0 + numerator 0: 0 + identifier 1: 0 + numerator 1: 0 + identifier 2: 0 + numerator 2: 0 + identifier 3: 0 + numerator 3: 0 +Page 1: + nobjects: 3 + length: 583 + content_offset: 0 + content_length: 0 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 2: + nobjects: 3 + length: 583 + content_offset: 0 + content_length: 0 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 3: + nobjects: 3 + length: 587 + content_offset: 0 + content_length: 4 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 4: + nobjects: 3 + length: 594 + content_offset: 0 + content_length: 11 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 5: + nobjects: 3 + length: 586 + content_offset: 0 + content_length: 3 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 6: + nobjects: 3 + length: 592 + content_offset: 0 + content_length: 9 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 7: + nobjects: 3 + length: 586 + content_offset: 0 + content_length: 3 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 8: + nobjects: 3 + length: 594 + content_offset: 0 + content_length: 11 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 9: + nobjects: 3 + length: 587 + content_offset: 0 + content_length: 4 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 10: + nobjects: 3 + length: 592 + content_offset: 0 + content_length: 9 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 11: + nobjects: 3 + length: 591 + content_offset: 0 + content_length: 8 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 12: + nobjects: 3 + length: 593 + content_offset: 0 + content_length: 10 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 13: + nobjects: 3 + length: 593 + content_offset: 0 + content_length: 10 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 14: + nobjects: 3 + length: 593 + content_offset: 0 + content_length: 10 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 15: + nobjects: 3 + length: 592 + content_offset: 0 + content_length: 9 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 16: + nobjects: 3 + length: 593 + content_offset: 0 + content_length: 10 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 17: + nobjects: 3 + length: 592 + content_offset: 0 + content_length: 9 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 18: + nobjects: 3 + length: 593 + content_offset: 0 + content_length: 10 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 19: + nobjects: 3 + length: 592 + content_offset: 0 + content_length: 9 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 20: + nobjects: 3 + length: 592 + content_offset: 0 + content_length: 9 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 21: + nobjects: 3 + length: 591 + content_offset: 0 + content_length: 8 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 22: + nobjects: 3 + length: 593 + content_offset: 0 + content_length: 10 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 23: + nobjects: 3 + length: 593 + content_offset: 0 + content_length: 10 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 24: + nobjects: 3 + length: 592 + content_offset: 0 + content_length: 9 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 25: + nobjects: 3 + length: 592 + content_offset: 0 + content_length: 9 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 26: + nobjects: 3 + length: 593 + content_offset: 0 + content_length: 10 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 27: + nobjects: 3 + length: 592 + content_offset: 0 + content_length: 9 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 28: + nobjects: 3 + length: 593 + content_offset: 0 + content_length: 10 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 +Page 29: + nobjects: 3 + length: 592 + content_offset: 0 + content_length: 9 + nshared_objects: 4 + identifier 0: 2 + numerator 0: 0 + identifier 1: 3 + numerator 1: 0 + identifier 2: 5 + numerator 2: 0 + identifier 3: 6 + numerator 3: 0 + +Shared Objects Hint Table + +first_shared_obj: 0 +first_shared_offset: 0 +nshared_first_page: 7 +nshared_total: 7 +nbits_nobjects: 0 +min_group_length: 35 +nbits_delta_group_length: 10 +Shared Object 0: + group length: 214 +Shared Object 1: + group length: 134 +Shared Object 2: + group length: 118 +Shared Object 3: + group length: 35 +Shared Object 4: + group length: 249 +Shared Object 5: + group length: 56 +Shared Object 6: + group length: 581 + +Outlines Hint Table + +first_object: 89 +first_object_offset: 20067 +nobjects: 12 +group_length: 2069 diff --git a/qpdf/qtest/qpdf/lin8.pdf b/qpdf/qtest/qpdf/lin8.pdf new file mode 100644 index 0000000..388a21a Binary files /dev/null and b/qpdf/qtest/qpdf/lin8.pdf differ diff --git a/qpdf/qtest/qpdf/lin9.out b/qpdf/qtest/qpdf/lin9.out new file mode 100644 index 0000000..6fde844 --- /dev/null +++ b/qpdf/qtest/qpdf/lin9.out @@ -0,0 +1,104 @@ +WARNING: page 0 has shared identifier entries +WARNING: page 0: shared object 19: in hint table but not computed list +lin9.pdf: linearization data: + +file_size: 3316 +first_page_object: 19 +first_page_end: 1323 +npages: 5 +xref_zero_offset: 2849 +first_page: 0 +H_offset: 713 +H_length: 162 + +Page Offsets Hint Table + +min_nobjects: 2 +first_page_offset: 875 +nbits_delta_nobjects: 2 +min_page_length: 221 +nbits_delta_page_length: 8 +min_content_offset: 0 +nbits_delta_content_offset: 0 +min_content_length: 0 +nbits_delta_content_length: 8 +nbits_nshared_objects: 2 +nbits_shared_identifier: 3 +nbits_shared_numerator: 4 +shared_denominator: 8 +Page 0: + nobjects: 5 + length: 448 + content_offset: 0 + content_length: 227 + nshared_objects: 1 + identifier 0: 0 + numerator 0: 0 +Page 1: + nobjects: 2 + length: 221 + content_offset: 0 + content_length: 0 + nshared_objects: 3 + identifier 0: 5 + numerator 0: 0 + identifier 1: 6 + numerator 1: 0 + identifier 2: 4 + numerator 2: 0 +Page 2: + nobjects: 2 + length: 234 + content_offset: 0 + content_length: 13 + nshared_objects: 3 + identifier 0: 5 + numerator 0: 0 + identifier 1: 6 + numerator 1: 0 + identifier 2: 4 + numerator 2: 0 +Page 3: + nobjects: 3 + length: 375 + content_offset: 0 + content_length: 154 + nshared_objects: 1 + identifier 0: 4 + numerator 0: 0 +Page 4: + nobjects: 2 + length: 221 + content_offset: 0 + content_length: 0 + nshared_objects: 3 + identifier 0: 5 + numerator 0: 0 + identifier 1: 6 + numerator 1: 0 + identifier 2: 4 + numerator 2: 0 + +Shared Objects Hint Table + +first_shared_obj: 10 +first_shared_offset: 2374 +nshared_first_page: 5 +nshared_total: 7 +nbits_nobjects: 0 +min_group_length: 34 +nbits_delta_group_length: 7 +Shared Object 0: + group length: 119 +Shared Object 1: + group length: 105 +Shared Object 2: + group length: 67 +Shared Object 3: + group length: 123 +Shared Object 4: + group length: 34 +Shared Object 5: + group length: 67 +Shared Object 6: + group length: 117 diff --git a/qpdf/qtest/qpdf/lin9.pdf b/qpdf/qtest/qpdf/lin9.pdf new file mode 100644 index 0000000..40e7692 Binary files /dev/null and b/qpdf/qtest/qpdf/lin9.pdf differ diff --git a/qpdf/qtest/qpdf/linearized-and-warnings-1.out b/qpdf/qtest/qpdf/linearized-and-warnings-1.out new file mode 100644 index 0000000..954181f --- /dev/null +++ b/qpdf/qtest/qpdf/linearized-and-warnings-1.out @@ -0,0 +1,52 @@ +WARNING: linearized-and-warnings.pdf (object 2 0, file position 1117): empty object treated as null +linearized-and-warnings.pdf: linearization data: + +file_size: 1310 +first_page_object: 6 +first_page_end: 1044 +npages: 1 +xref_zero_offset: 1132 +first_page: 0 +H_offset: 528 +H_length: 118 + +Page Offsets Hint Table + +min_nobjects: 4 +first_page_offset: 646 +nbits_delta_nobjects: 0 +min_page_length: 398 +nbits_delta_page_length: 0 +min_content_offset: 0 +nbits_delta_content_offset: 0 +min_content_length: 398 +nbits_delta_content_length: 0 +nbits_nshared_objects: 0 +nbits_shared_identifier: 3 +nbits_shared_numerator: 0 +shared_denominator: 4 +Page 0: + nobjects: 4 + length: 398 + content_offset: 0 + content_length: 398 + nshared_objects: 0 + +Shared Objects Hint Table + +first_shared_obj: 0 +first_shared_offset: 0 +nshared_first_page: 4 +nshared_total: 4 +nbits_nobjects: 0 +min_group_length: 30 +nbits_delta_group_length: 7 +Shared Object 0: + group length: 143 +Shared Object 1: + group length: 118 +Shared Object 2: + group length: 30 +Shared Object 3: + group length: 107 +test 12 done diff --git a/qpdf/qtest/qpdf/linearized-and-warnings-2.out b/qpdf/qtest/qpdf/linearized-and-warnings-2.out new file mode 100644 index 0000000..d8d17b7 --- /dev/null +++ b/qpdf/qtest/qpdf/linearized-and-warnings-2.out @@ -0,0 +1,54 @@ +---output--- +linearized-and-warnings.pdf: linearization data: + +file_size: 1310 +first_page_object: 6 +first_page_end: 1044 +npages: 1 +xref_zero_offset: 1132 +first_page: 0 +H_offset: 528 +H_length: 118 + +Page Offsets Hint Table + +min_nobjects: 4 +first_page_offset: 646 +nbits_delta_nobjects: 0 +min_page_length: 398 +nbits_delta_page_length: 0 +min_content_offset: 0 +nbits_delta_content_offset: 0 +min_content_length: 398 +nbits_delta_content_length: 0 +nbits_nshared_objects: 0 +nbits_shared_identifier: 3 +nbits_shared_numerator: 0 +shared_denominator: 4 +Page 0: + nobjects: 4 + length: 398 + content_offset: 0 + content_length: 398 + nshared_objects: 0 + +Shared Objects Hint Table + +first_shared_obj: 0 +first_shared_offset: 0 +nshared_first_page: 4 +nshared_total: 4 +nbits_nobjects: 0 +min_group_length: 30 +nbits_delta_group_length: 7 +Shared Object 0: + group length: 143 +Shared Object 1: + group length: 118 +Shared Object 2: + group length: 30 +Shared Object 3: + group length: 107 +---error--- +WARNING: linearized-and-warnings.pdf (object 2 0, file position 1117): empty object treated as null +test 13 done diff --git a/qpdf/qtest/qpdf/linearized-and-warnings.pdf b/qpdf/qtest/qpdf/linearized-and-warnings.pdf new file mode 100644 index 0000000..4403756 Binary files /dev/null and b/qpdf/qtest/qpdf/linearized-and-warnings.pdf differ diff --git a/qpdf/qtest/qpdf/long-id-check.out b/qpdf/qtest/qpdf/long-id-check.out new file mode 100644 index 0000000..e2ffcef --- /dev/null +++ b/qpdf/qtest/qpdf/long-id-check.out @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.3 +R = 2 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/long-id.pdf b/qpdf/qtest/qpdf/long-id.pdf new file mode 100644 index 0000000..9c57568 --- /dev/null +++ b/qpdf/qtest/qpdf/long-id.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /ID [<443A32303130303432333131333433382B303227303027> <443A32303130303432333131333433382B303227303027>] +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/merge-three-files-1.pdf b/qpdf/qtest/qpdf/merge-three-files-1.pdf new file mode 100644 index 0000000..709f21e Binary files /dev/null and b/qpdf/qtest/qpdf/merge-three-files-1.pdf differ diff --git a/qpdf/qtest/qpdf/merge-three-files-2.pdf b/qpdf/qtest/qpdf/merge-three-files-2.pdf new file mode 100644 index 0000000..c8b717e Binary files /dev/null and b/qpdf/qtest/qpdf/merge-three-files-2.pdf differ diff --git a/qpdf/qtest/qpdf/metadata-crypt-filter.pdf b/qpdf/qtest/qpdf/metadata-crypt-filter.pdf new file mode 100644 index 0000000..39ed3d8 --- /dev/null +++ b/qpdf/qtest/qpdf/metadata-crypt-filter.pdf @@ -0,0 +1,411 @@ +%PDF-1.5 +%¿÷¢þ +1 0 obj +<< /Metadata 3 0 R /Outlines 4 0 R /PageLabels << /Nums [ 0 << /P () >> 2 << /S /r /St 1 >> 7 << /P () >> 9 << /S /r /St 6 >> 11 << /P () >> 12 << /S /D /St 2 >> 15 << /S /D /St 6 >> 19 << /P () >> 20 << /S /D /St 12 >> 22 << /S /D /St 16059 >> 23 << /S /r /St 50 >> 29 << /S /r /St 54 >> ] >> /PageMode /UseOutlines /Pages 5 0 R /Type /Catalog >> +endobj +2 0 obj +<< /CreationDate /ModDate >> +endobj +3 0 obj +<< /Subtype /XML /Type /Metadata /DecodeParms << /Name /Identity /Type /CryptFilterDecodeParms >> /Filter /Crypt /Length 770 >> +stream + + + + + + 2003-10-10T18:04:32-03:00 + 2003-10-10T18:04:32-03:00 + + + + 2003-10-10T18:04:32-03:00 + 2003-10-10T18:04:32-03:00 + 2003-10-10T18:04:32-03:00 + + + +endstream +endobj +4 0 obj +<< /Count 6 /First 6 0 R /Last 7 0 R /Type /Outlines >> +endobj +5 0 obj +<< /Count 30 /Kids [ 8 0 R 9 0 R 10 0 R 11 0 R 12 0 R 13 0 R 14 0 R 15 0 R 16 0 R 17 0 R 18 0 R 19 0 R 20 0 R 21 0 R 22 0 R 23 0 R 24 0 R 25 0 R 26 0 R 27 0 R 28 0 R 29 0 R 30 0 R 31 0 R 32 0 R 33 0 R 34 0 R 35 0 R 36 0 R 37 0 R ] /Type /Pages >> +endobj +6 0 obj +<< /Count 4 /Dest [ 13 0 R /XYZ null null null ] /First 38 0 R /Last 39 0 R /Next 7 0 R /Parent 4 0 R /Title <0bace566042e35f13ccb00496b6552b92c0c4c87ca4a8cbe11761a3c9718c8c0> /Type /Outline >> +endobj +7 0 obj +<< /Dest [ 23 0 R /XYZ 66 756 3 ] /Parent 4 0 R /Prev 6 0 R /Title /Type /Outline >> +endobj +8 0 obj +<< /Contents 40 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +9 0 obj +<< /Contents 43 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +10 0 obj +<< /Contents 44 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +11 0 obj +<< /Contents 45 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +12 0 obj +<< /Contents 46 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +13 0 obj +<< /Contents 47 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +14 0 obj +<< /Contents 48 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +15 0 obj +<< /Contents 49 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +16 0 obj +<< /Contents 50 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +17 0 obj +<< /Contents 51 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +18 0 obj +<< /Contents 52 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +19 0 obj +<< /Contents 53 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +20 0 obj +<< /Contents 54 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +21 0 obj +<< /Contents 55 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +22 0 obj +<< /Contents 56 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +23 0 obj +<< /Contents 57 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +24 0 obj +<< /Contents 58 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +25 0 obj +<< /Contents 59 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +26 0 obj +<< /Contents 60 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +27 0 obj +<< /Contents 61 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +28 0 obj +<< /Contents 62 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +29 0 obj +<< /Contents 63 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +30 0 obj +<< /Contents 64 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +31 0 obj +<< /Contents 65 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +32 0 obj +<< /Contents 66 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +33 0 obj +<< /Contents 67 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +34 0 obj +<< /Contents 68 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +35 0 obj +<< /Contents 69 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +36 0 obj +<< /Contents 70 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +37 0 obj +<< /Contents 71 0 R /CropBox [ 0 0 612 792 ] /MediaBox [ 0 0 612 792 ] /Parent 5 0 R /Resources << /Font << /F1 41 0 R >> /ProcSet 42 0 R >> /Rotate 0 /Type /Page >> +endobj +38 0 obj +<< /Count -3 /Dest [ 19 0 R /Fit ] /First 72 0 R /Last 73 0 R /Next 39 0 R /Parent 6 0 R /Title <3fb30ac89234ff057e20814f60a034d2e5025f8cc58e> /Type /Outline >> +endobj +39 0 obj +<< /Count 2 /Dest [ 21 0 R /FitH 792 ] /First 74 0 R /Last 75 0 R /Parent 6 0 R /Prev 38 0 R /Title /Type /Outline >> +endobj +40 0 obj +<< /Length 50 /Filter /FlateDecode >> +stream +íÎ t§v4Rnjø¾©±a¿Ž–Þa-¶êáÀÁX°j½E´«B)s®ˆ¸7DZÈJlendstream +endobj +41 0 obj +<< /BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font >> +endobj +42 0 obj +[ /PDF /Text ] +endobj +43 0 obj +<< /Length 50 /Filter /FlateDecode >> +stream +¼åKõ†þ÷CZ¹â—XÿÝ.ÿ¯W°Zh‚wwží A’ž'v jWYâÇî}íúendstream +endobj +44 0 obj +<< /Length 50 /Filter /FlateDecode >> +stream +¼¸Ä™|¶qsg:/ëIéƸ§Ò ñQöŠè,û…­Vî”;¸U—k”Š€bü{Ôœ,endstream +endobj +45 0 obj +<< /Length 50 /Filter /FlateDecode >> +stream +ÆCv=—JŠ@úVÞ¥I>ëÉàHõt5¾®Öy{öÃ7Ý¢KÙªŸP©y˨¹§h´_endstream +endobj +46 0 obj +<< /Length 50 /Filter /FlateDecode >> +stream +FKñE¦ŒnA·Ê×äõDo¤£‚v8 ,Îæ¨éJ;¹4‘Jì؇a£Ùùm"endstream +endobj +47 0 obj +<< /Length 50 /Filter /FlateDecode >> +stream +1'[1¯õì¼ôfõŠi:l‡:õSï$G“Ê®DƒÇ1‡ƒ:¾]ÒèѨiê±°­Úendstream +endobj +48 0 obj +<< /Length 50 /Filter /FlateDecode >> +stream +2d²Û#âï‚[ß‘ú)OÐŵ€Òå® j˜)¹ÛÀé^ãiNmºOßÊ¢Þfݹµ}endstream +endobj +49 0 obj +<< /Length 50 /Filter /FlateDecode >> +stream +»„Æ&;‚ÊPGîû2fsî@[Ô yÞÒ> +stream +Åá7Û¥ÃsŽ¹I«ØT¤ç!Ý”¿%ƒêÞ¢„XjIáÁdMVÍñÕQ+{­ãð6˜5fendstream +endobj +51 0 obj +<< /Length 50 /Filter /FlateDecode >> +stream +l∿¤q ›k ƒÔÌOæ vѪ[¤¢F3ÃíDÈæ{CèAÙÀÞpÍô,endstream +endobj +52 0 obj +<< /Length 51 /Filter /FlateDecode >> +stream +bšÇ•M+ç|àf˶¢.Ѥ»­À8ÐÍŽ|{oý#¥-&Ät•ë¤%Ëc‹a|Tendstream +endobj +53 0 obj +<< /Length 51 /Filter /FlateDecode >> +stream +ôNc“¹®&fFãçâuy4e¨Í.‡ÉùÔX\÷ÊX"K¯ç¦p;EÁ[ÃhzK¼cbñ‰endstream +endobj +54 0 obj +<< /Length 51 /Filter /FlateDecode >> +stream +º¤›Üò³}×s£‚+8QHŽ}zÃàM¾¯›ø£ñ’ >Çúi|½¾Ñv&£&¡‚Éù|!endstream +endobj +55 0 obj +<< /Length 51 /Filter /FlateDecode >> +stream +®&h·yu8ð”iéÒÍ„qáâSäQ #’.ÖP5“šö£è)äÆI›}÷æÌ+ÒË®endstream +endobj +56 0 obj +<< /Length 51 /Filter /FlateDecode >> +stream +Xðò$QÄ$¾ B‚‰2. ë›Ä`„¾¡e\tùèVƒw'«q#°ÉÑE(~YÞ€d}endstream +endobj +57 0 obj +<< /Length 51 /Filter /FlateDecode >> +stream +_|Yâ§9®¦ç-nŠáþ*£™¿k IAs}¥©ç‘L_9«Ÿ¢ñAéÙs¢Rendstream +endobj +58 0 obj +<< /Length 51 /Filter /FlateDecode >> +stream +íÚ_ZÅ£ôH#ó!Þ¬š©k39$/m?ˆÚ¦ül¥‰/Z/}@×6ã@±Vveσ7endstream +endobj +59 0 obj +<< /Length 51 /Filter /FlateDecode >> +stream +¤¦œF±›lŠ +y¾Æ'Ékæ`2­orÎf°ÌÁâí°ø‰ÑÇY‡à%µÔ1½àŒendstream +endobj +60 0 obj +<< /Length 51 /Filter /FlateDecode >> +stream +Dã%MXe‰=F(Þ ¬ÿI»°Ÿvþé_“eÀnÒ©áÿVb!ë î½ ìËrµ¢™!Iendstream +endobj +61 0 obj +<< /Length 51 /Filter /FlateDecode >> +stream +€}–¤Q[UÍÞLW Ãh]"*Ô¶G¨ŠȨ̈ìt3Žš~¿nŒÄjšoo{ËCD endstream +endobj +62 0 obj +<< /Length 51 /Filter /FlateDecode >> +stream +ŒË!Ó7aJ«8c1Æ[ÛL¸žÜ¼—PQl.Ì£Æáb’S)al L¯·#Û+¼&sendstream +endobj +63 0 obj +<< /Length 51 /Filter /FlateDecode >> +stream +þnqééÒbëÁv0XÁ©Š:V|ˆèb毕šŸ½¼hŽmG0çÛ”> +stream +ÊÊ@UY‰¡Xô‰#¼ïö`²È[øÆs›áSù?÷*Ñf¨( Hu§´h¯±By¦endstream +endobj +65 0 obj +<< /Length 51 /Filter /FlateDecode >> +stream +dq[…€¯!äñ¼rªõ¹09 ‹ùF’™ô)hB®Qc˜GS¤`E)6kÆÕí?mIendstream +endobj +66 0 obj +<< /Length 50 /Filter /FlateDecode >> +stream +¹¨p«€*Œ-ž$ +Å>ÎvŽžÏàåëé_æaýÉ.™–„F!fÄ2‚¨¤û®¸ð%€endstream +endobj +67 0 obj +<< /Length 51 /Filter /FlateDecode >> +stream +WSX\,ëÏ^ÔMʵÀ2ÎîA" p¿]>òö|Æ/ÕXôÀãê¯×õ,¡­ P‹3endstream +endobj +68 0 obj +<< /Length 51 /Filter /FlateDecode >> +stream +ääÖ…U=MÅ¢NSgÏ®ÝXÒÏ +#—°߀}`*ã‡Ò?h¹6Pssî{Vý±å·endstream +endobj +69 0 obj +<< /Length 51 /Filter /FlateDecode >> +stream +!h,÷ì‚s!Í/C†i"Žù#m…C‹¬¦AO$û›9Ⱦhø${ìOÄM”’é'endstream +endobj +70 0 obj +<< /Length 51 /Filter /FlateDecode >> +stream +7ZSü–Lê0=àÆ»—ð.þ‰/ð +ø¡|Ì:¡&ÔÌ_! ‘äöëü’Ô sžÉè*u#endstream +endobj +71 0 obj +<< /Length 51 /Filter /FlateDecode >> +stream +¿¸PþÕê™òí+§Þ@Y( {?­èg]¼lv£±RóÎÏ9®ÍUêÂŒ?Ú-wå“Oendstream +endobj +72 0 obj +<< /Count -2 /Dest [ 20 0 R /FitV 100 ] /First 76 0 R /Last 77 0 R /Next 73 0 R /Parent 38 0 R /Title /Type /Outline >> +endobj +73 0 obj +<< /Count 1 /Dest [ 20 0 R /XYZ null null null ] /First 78 0 R /Last 78 0 R /Parent 38 0 R /Prev 72 0 R /Title (ñ輧Ò:8\226v\)NÒ\(\210\035NT\036ßmvj\tnlõ\212¾½ì;´o¬.ç\211ûñ3±) /Type /Outline >> +endobj +74 0 obj +<< /Dest [ 9 0 R /FitR 66 714 180 770 ] /Next 75 0 R /Parent 39 0 R /Title <498fe6ebfb28be416edddb53c1a63ffee3887fce2a7a2e34043792493f5a7c1f8818fa24a81dbbd055212dae> /Type /Outline >> +endobj +75 0 obj +<< /Dest [ 8 0 R /XYZ null null null ] /Parent 39 0 R /Prev 74 0 R /Title <69fb82b1b1b8833e343e5f401879d3083e0cd738a3f54342e881ead5b6bc1816e7e3b431d48b1c0a14> /Type /Outline >> +endobj +76 0 obj +<< /Dest [ 26 0 R /XYZ null null null ] /Next 77 0 R /Parent 72 0 R /Title <1433a18038fcd41d81200f85f0f942caedcce35a9fddde851dd1b70def5f196aeac27ccf5f5b725ecc89be> /Type /Outline >> +endobj +77 0 obj +<< /Dest [ 27 0 R /XYZ null null null ] /Parent 72 0 R /Prev 76 0 R /Title <9028484736aaf8f0b5eedc521a7169cc9e2295cfd80eed0c2e41c44c26ba7c6ff586a290be701394f7e5ad> /Type /Outline >> +endobj +78 0 obj +<< /Dest [ 30 0 R /XYZ null null null ] /Parent 73 0 R /Title <6c21f1d776e7e20cadb7be7247c9856e4da1fbaded20b1596cc68c35e8c7f5c2ebd4a242796ea858837daa> /Type /Outline >> +endobj +79 0 obj +<< /CF << /StdCF << /AuthEvent /DocOpen /CFM /V2 >> >> /EncryptMetadata false /Filter /Standard /Length 128 /O <566fa873ee33c797cd3b904fdadf814afa34df9a38f6ed41b984e2c6da2aa6f5> /P -4 /R 4 /StmF /StdCF /StrF /StdCF /U <3a40816f776fccd39a9c505a9d4110e60122456a91bae5134273a6db134c87c4> /V 4 >> +endobj +xref +0 80 +0000000000 65535 f +0000000015 00000 n +0000000378 00000 n +0000000520 00000 n +0000001450 00000 n +0000001521 00000 n +0000001783 00000 n +0000001992 00000 n +0000002153 00000 n +0000002334 00000 n +0000002515 00000 n +0000002697 00000 n +0000002879 00000 n +0000003061 00000 n +0000003243 00000 n +0000003425 00000 n +0000003607 00000 n +0000003789 00000 n +0000003971 00000 n +0000004153 00000 n +0000004335 00000 n +0000004517 00000 n +0000004699 00000 n +0000004881 00000 n +0000005063 00000 n +0000005245 00000 n +0000005427 00000 n +0000005609 00000 n +0000005791 00000 n +0000005973 00000 n +0000006155 00000 n +0000006337 00000 n +0000006519 00000 n +0000006701 00000 n +0000006883 00000 n +0000007065 00000 n +0000007247 00000 n +0000007429 00000 n +0000007611 00000 n +0000007788 00000 n +0000007977 00000 n +0000008098 00000 n +0000008206 00000 n +0000008237 00000 n +0000008358 00000 n +0000008479 00000 n +0000008600 00000 n +0000008721 00000 n +0000008842 00000 n +0000008963 00000 n +0000009084 00000 n +0000009205 00000 n +0000009326 00000 n +0000009448 00000 n +0000009570 00000 n +0000009692 00000 n +0000009814 00000 n +0000009936 00000 n +0000010058 00000 n +0000010180 00000 n +0000010302 00000 n +0000010424 00000 n +0000010546 00000 n +0000010668 00000 n +0000010790 00000 n +0000010912 00000 n +0000011034 00000 n +0000011155 00000 n +0000011277 00000 n +0000011399 00000 n +0000011521 00000 n +0000011643 00000 n +0000011765 00000 n +0000011966 00000 n +0000012176 00000 n +0000012376 00000 n +0000012569 00000 n +0000012767 00000 n +0000012965 00000 n +0000013150 00000 n +trailer << /Info 2 0 R /Root 1 0 R /Size 80 /ID [<66d36a30a97e0f16f39955c6221e0c2a><31415926535897932384626433832795>] /Encrypt 79 0 R >> +startxref +13459 +%%EOF diff --git a/qpdf/qtest/qpdf/min-version.out b/qpdf/qtest/qpdf/min-version.out new file mode 100644 index 0000000..0a36ecb --- /dev/null +++ b/qpdf/qtest/qpdf/min-version.out @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.6 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/minimal.pdf b/qpdf/qtest/qpdf/minimal.pdf new file mode 100644 index 0000000..a7e01f9 --- /dev/null +++ b/qpdf/qtest/qpdf/minimal.pdf @@ -0,0 +1,79 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/misc-1.out b/qpdf/qtest/qpdf/misc-1.out new file mode 100644 index 0000000..3cba139 --- /dev/null +++ b/qpdf/qtest/qpdf/misc-1.out @@ -0,0 +1,15 @@ +page 1: + images: + /Im1: 5100 x 6600 + content: + 5 0 R +end page 1 +page 2: + images: + /Im2: 5100 x 6600 + /Im3: 305 x 305 + /Im4: 305 x 305 + content: + 11 0 R +end page 2 +test 5 done diff --git a/qpdf/qtest/qpdf/misc-1.pdf b/qpdf/qtest/qpdf/misc-1.pdf new file mode 100644 index 0000000..dec1d70 Binary files /dev/null and b/qpdf/qtest/qpdf/misc-1.pdf differ diff --git a/qpdf/qtest/qpdf/misc-2.out b/qpdf/qtest/qpdf/misc-2.out new file mode 100644 index 0000000..139d64c --- /dev/null +++ b/qpdf/qtest/qpdf/misc-2.out @@ -0,0 +1,26 @@ +page 1: + images: + /Im1: 5100 x 6600 + content: + 5 0 R +end page 1 +page 2: + images: + /Im2: 5100 x 6600 + /Im3: 305 x 305 + content: + 10 0 R +end page 2 +page 3: + images: + /Im4: 5100 x 6600 + content: + 14 0 R +end page 3 +page 4: + images: + /Im5: 5100 x 6600 + content: + 18 0 R +end page 4 +test 5 done diff --git a/qpdf/qtest/qpdf/misc-2.pdf b/qpdf/qtest/qpdf/misc-2.pdf new file mode 100644 index 0000000..a7a3a93 Binary files /dev/null and b/qpdf/qtest/qpdf/misc-2.pdf differ diff --git a/qpdf/qtest/qpdf/misc-3.out b/qpdf/qtest/qpdf/misc-3.out new file mode 100644 index 0000000..390e9a6 --- /dev/null +++ b/qpdf/qtest/qpdf/misc-3.out @@ -0,0 +1,15 @@ +page 1: + images: + content: + 4 0 R + 6 0 R +end page 1 +QStrings: +No Special Characters +These: ¿÷¢þ and no more +πωτατω +treble clef: ð„ ; sixteenth note: ð…  +QNumbers: +1.000 +3.142 +test 5 done diff --git a/qpdf/qtest/qpdf/misc-3.pdf b/qpdf/qtest/qpdf/misc-3.pdf new file mode 100644 index 0000000..4225d23 --- /dev/null +++ b/qpdf/qtest/qpdf/misc-3.pdf @@ -0,0 +1,128 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /Pages 2 0 R + /QNumbers [ + 1 + 3.14159 + ] + /QStrings [ + (No Special Characters) + (These: ¿÷¢þ and no more) + + + ] + /Type /Catalog +>> +endobj + +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +3 0 obj +<< + /Contents [ + 4 0 R + 6 0 R + ] + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 8 0 R + >> + /ProcSet 9 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +4 0 obj +<< + /Length 5 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +44 +endobj + +%% Contents for page 1 +6 0 obj +<< + /Length 7 0 R +>> +stream +BT + /F1 24 Tf + 72 696 Td + (Salad) Tj +ET +endstream +endobj + +7 0 obj +43 +endobj + +8 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +9 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 10 +0000000000 65535 f +0000000025 00000 n +0000000377 00000 n +0000000459 00000 n +0000000694 00000 n +0000000793 00000 n +0000000835 00000 n +0000000933 00000 n +0000000952 00000 n +0000001070 00000 n +trailer << + /Root 1 0 R + /Size 10 + /ID [<76269ee0b6579446b731e060af8ef436>] +>> +startxref +1105 +%%EOF diff --git a/qpdf/qtest/qpdf/multiple-mods-check.out b/qpdf/qtest/qpdf/multiple-mods-check.out new file mode 100644 index 0000000..103b534 --- /dev/null +++ b/qpdf/qtest/qpdf/multiple-mods-check.out @@ -0,0 +1,6 @@ +checking multiple-mods.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/multiple-mods.pdf b/qpdf/qtest/qpdf/multiple-mods.pdf new file mode 100644 index 0000000..6370cd6 Binary files /dev/null and b/qpdf/qtest/qpdf/multiple-mods.pdf differ diff --git a/qpdf/qtest/qpdf/new-streams.pdf b/qpdf/qtest/qpdf/new-streams.pdf new file mode 100644 index 0000000..d3966a3 --- /dev/null +++ b/qpdf/qtest/qpdf/new-streams.pdf @@ -0,0 +1,54 @@ +%PDF-1.3 +%¿÷¢þ +1 0 obj +<< /Pages 2 0 R /QStream 3 0 R /RStream 4 0 R /Type /Catalog >> +endobj +2 0 obj +<< /Count 1 /Kids [ 5 0 R ] /Type /Pages >> +endobj +3 0 obj +<< /Length 20 >> +stream +data for new stream +endstream +endobj +4 0 obj +<< /Length 22 >> +stream +data for other stream +endstream +endobj +5 0 obj +<< /Contents 6 0 R /MediaBox [ 0 0 612 792 ] /Parent 2 0 R /Resources << /Font << /F1 7 0 R >> /ProcSet 8 0 R >> /Type /Page >> +endobj +6 0 obj +<< /Length 44 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj +7 0 obj +<< /BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font >> +endobj +8 0 obj +[ /PDF /Text ] +endobj +xref +0 9 +0000000000 65535 f +0000000015 00000 n +0000000094 00000 n +0000000153 00000 n +0000000222 00000 n +0000000293 00000 n +0000000436 00000 n +0000000529 00000 n +0000000636 00000 n +trailer << /Root 1 0 R /Size 9 /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] >> +startxref +666 +%%EOF diff --git a/qpdf/qtest/qpdf/obj0-check.out b/qpdf/qtest/qpdf/obj0-check.out new file mode 100644 index 0000000..f0a71b6 --- /dev/null +++ b/qpdf/qtest/qpdf/obj0-check.out @@ -0,0 +1,7 @@ +checking obj0.pdf +PDF Version: 1.3 +File is not encrypted +File is not linearized +WARNING: obj0.pdf: file is damaged +WARNING: obj0.pdf (object 1 0, file position 77): expected n n obj +WARNING: obj0.pdf: Attempting to reconstruct cross-reference table diff --git a/qpdf/qtest/qpdf/obj0.pdf b/qpdf/qtest/qpdf/obj0.pdf new file mode 100644 index 0000000..0865102 Binary files /dev/null and b/qpdf/qtest/qpdf/obj0.pdf differ diff --git a/qpdf/qtest/qpdf/object-stream.1-ogen.c-check b/qpdf/qtest/qpdf/object-stream.1-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.1-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/object-stream.1-ogen.check b/qpdf/qtest/qpdf/object-stream.1-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.1-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.1.c-check b/qpdf/qtest/qpdf/object-stream.1.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.1.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/object-stream.1.check b/qpdf/qtest/qpdf/object-stream.1.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.1.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.10-ogen.c-check b/qpdf/qtest/qpdf/object-stream.10-ogen.c-check new file mode 100644 index 0000000..963cdba --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.10-ogen.c-check @@ -0,0 +1,13 @@ +version: 1.5 +linearized: 0 +encrypted: 1 +user password: +extract for accessibility: 1 +extract for any purpose: 1 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 1 +modify forms: 1 +modify annotations: 1 +modify other: 1 +modify anything: 1 diff --git a/qpdf/qtest/qpdf/object-stream.10-ogen.check b/qpdf/qtest/qpdf/object-stream.10-ogen.check new file mode 100644 index 0000000..331cd70 --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.10-ogen.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.5 +R = 3 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.10.c-check b/qpdf/qtest/qpdf/object-stream.10.c-check new file mode 100644 index 0000000..963cdba --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.10.c-check @@ -0,0 +1,13 @@ +version: 1.5 +linearized: 0 +encrypted: 1 +user password: +extract for accessibility: 1 +extract for any purpose: 1 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 1 +modify forms: 1 +modify annotations: 1 +modify other: 1 +modify anything: 1 diff --git a/qpdf/qtest/qpdf/object-stream.10.check b/qpdf/qtest/qpdf/object-stream.10.check new file mode 100644 index 0000000..331cd70 --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.10.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.5 +R = 3 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.11-ogen.c-check b/qpdf/qtest/qpdf/object-stream.11-ogen.c-check new file mode 100644 index 0000000..ef82b7f --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.11-ogen.c-check @@ -0,0 +1,13 @@ +version: 1.5 +linearized: 1 +encrypted: 1 +user password: +extract for accessibility: 1 +extract for any purpose: 1 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 1 +modify forms: 1 +modify annotations: 1 +modify other: 1 +modify anything: 1 diff --git a/qpdf/qtest/qpdf/object-stream.11-ogen.check b/qpdf/qtest/qpdf/object-stream.11-ogen.check new file mode 100644 index 0000000..aae0b3a --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.11-ogen.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.5 +R = 3 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.11.c-check b/qpdf/qtest/qpdf/object-stream.11.c-check new file mode 100644 index 0000000..ef82b7f --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.11.c-check @@ -0,0 +1,13 @@ +version: 1.5 +linearized: 1 +encrypted: 1 +user password: +extract for accessibility: 1 +extract for any purpose: 1 +print low resolution: 1 +print high resolution: 1 +modify document assembly: 1 +modify forms: 1 +modify annotations: 1 +modify other: 1 +modify anything: 1 diff --git a/qpdf/qtest/qpdf/object-stream.11.check b/qpdf/qtest/qpdf/object-stream.11.check new file mode 100644 index 0000000..aae0b3a --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.11.check @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.5 +R = 3 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.12-ogen.c-check b/qpdf/qtest/qpdf/object-stream.12-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.12-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/object-stream.12-ogen.check b/qpdf/qtest/qpdf/object-stream.12-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.12-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.12.c-check b/qpdf/qtest/qpdf/object-stream.12.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.12.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/object-stream.12.check b/qpdf/qtest/qpdf/object-stream.12.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.12.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.2-ogen.c-check b/qpdf/qtest/qpdf/object-stream.2-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.2-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/object-stream.2-ogen.check b/qpdf/qtest/qpdf/object-stream.2-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.2-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.2.c-check b/qpdf/qtest/qpdf/object-stream.2.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.2.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/object-stream.2.check b/qpdf/qtest/qpdf/object-stream.2.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.2.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.3-ogen.c-check b/qpdf/qtest/qpdf/object-stream.3-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.3-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/object-stream.3-ogen.check b/qpdf/qtest/qpdf/object-stream.3-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.3-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.3.c-check b/qpdf/qtest/qpdf/object-stream.3.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.3.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/object-stream.3.check b/qpdf/qtest/qpdf/object-stream.3.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.3.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.4-ogen.c-check b/qpdf/qtest/qpdf/object-stream.4-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.4-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/object-stream.4-ogen.check b/qpdf/qtest/qpdf/object-stream.4-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.4-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.4.c-check b/qpdf/qtest/qpdf/object-stream.4.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.4.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/object-stream.4.check b/qpdf/qtest/qpdf/object-stream.4.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.4.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.5-ogen.c-check b/qpdf/qtest/qpdf/object-stream.5-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.5-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/object-stream.5-ogen.check b/qpdf/qtest/qpdf/object-stream.5-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.5-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.5.c-check b/qpdf/qtest/qpdf/object-stream.5.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.5.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/object-stream.5.check b/qpdf/qtest/qpdf/object-stream.5.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.5.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.6-ogen.c-check b/qpdf/qtest/qpdf/object-stream.6-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.6-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/object-stream.6-ogen.check b/qpdf/qtest/qpdf/object-stream.6-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.6-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.6.c-check b/qpdf/qtest/qpdf/object-stream.6.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.6.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/object-stream.6.check b/qpdf/qtest/qpdf/object-stream.6.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.6.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.7-ogen.c-check b/qpdf/qtest/qpdf/object-stream.7-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.7-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/object-stream.7-ogen.check b/qpdf/qtest/qpdf/object-stream.7-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.7-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.7.c-check b/qpdf/qtest/qpdf/object-stream.7.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.7.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/object-stream.7.check b/qpdf/qtest/qpdf/object-stream.7.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.7.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.8-ogen.c-check b/qpdf/qtest/qpdf/object-stream.8-ogen.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.8-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/object-stream.8-ogen.check b/qpdf/qtest/qpdf/object-stream.8-ogen.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.8-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.8.c-check b/qpdf/qtest/qpdf/object-stream.8.c-check new file mode 100644 index 0000000..7fc743a --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.8.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/object-stream.8.check b/qpdf/qtest/qpdf/object-stream.8.check new file mode 100644 index 0000000..f95a8ec --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.8.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.9-ogen.c-check b/qpdf/qtest/qpdf/object-stream.9-ogen.c-check new file mode 100644 index 0000000..0ab1338 --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.9-ogen.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 1 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/object-stream.9-ogen.check b/qpdf/qtest/qpdf/object-stream.9-ogen.check new file mode 100644 index 0000000..8c02e64 --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.9-ogen.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.9.c-check b/qpdf/qtest/qpdf/object-stream.9.c-check new file mode 100644 index 0000000..0ab1338 --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.9.c-check @@ -0,0 +1,3 @@ +version: 1.5 +linearized: 1 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/object-stream.9.check b/qpdf/qtest/qpdf/object-stream.9.check new file mode 100644 index 0000000..8c02e64 --- /dev/null +++ b/qpdf/qtest/qpdf/object-stream.9.check @@ -0,0 +1,6 @@ +checking a.pdf +PDF Version: 1.5 +File is not encrypted +File is linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/object-stream.disable.exp b/qpdf/qtest/qpdf/object-stream.disable.exp new file mode 100644 index 0000000..e2ee713 Binary files /dev/null and b/qpdf/qtest/qpdf/object-stream.disable.exp differ diff --git a/qpdf/qtest/qpdf/object-stream.generate.exp b/qpdf/qtest/qpdf/object-stream.generate.exp new file mode 100644 index 0000000..87e2f5d Binary files /dev/null and b/qpdf/qtest/qpdf/object-stream.generate.exp differ diff --git a/qpdf/qtest/qpdf/object-stream.pdf b/qpdf/qtest/qpdf/object-stream.pdf new file mode 100644 index 0000000..1a46820 Binary files /dev/null and b/qpdf/qtest/qpdf/object-stream.pdf differ diff --git a/qpdf/qtest/qpdf/object-stream.preserve.exp b/qpdf/qtest/qpdf/object-stream.preserve.exp new file mode 100644 index 0000000..87e2f5d Binary files /dev/null and b/qpdf/qtest/qpdf/object-stream.preserve.exp differ diff --git a/qpdf/qtest/qpdf/old-and-complex-c-check.out b/qpdf/qtest/qpdf/old-and-complex-c-check.out new file mode 100644 index 0000000..f55decb --- /dev/null +++ b/qpdf/qtest/qpdf/old-and-complex-c-check.out @@ -0,0 +1,3 @@ +version: 1.1 +linearized: 0 +encrypted: 0 diff --git a/qpdf/qtest/qpdf/old-and-complex-check.out b/qpdf/qtest/qpdf/old-and-complex-check.out new file mode 100644 index 0000000..2c65151 --- /dev/null +++ b/qpdf/qtest/qpdf/old-and-complex-check.out @@ -0,0 +1,6 @@ +checking old-and-complex.pdf +PDF Version: 1.1 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/old-and-complex.pdf b/qpdf/qtest/qpdf/old-and-complex.pdf new file mode 100644 index 0000000..74b8c25 Binary files /dev/null and b/qpdf/qtest/qpdf/old-and-complex.pdf differ diff --git a/qpdf/qtest/qpdf/p1-a-p2-a.pdf b/qpdf/qtest/qpdf/p1-a-p2-a.pdf new file mode 100644 index 0000000..b8256cb --- /dev/null +++ b/qpdf/qtest/qpdf/p1-a-p2-a.pdf @@ -0,0 +1,138 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /Count 2 + /Kids [ + 3 0 R + 4 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +3 0 obj +<< + /Contents 5 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 7 0 R + >> + /ProcSet 8 0 R + >> + /Type /Page +>> +endobj + +%% Page 2 +4 0 obj +<< + /Contents 9 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 7 0 R + >> + /ProcSet 8 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +5 0 obj +<< + /Length 6 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (A) Tj +ET +endstream +endobj + +6 0 obj +39 +endobj + +7 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +8 0 obj +[ + /PDF + /Text +] +endobj + +%% Contents for page 2 +9 0 obj +<< + /Length 10 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (A) Tj +ET +endstream +endobj + +10 0 obj +39 +endobj + +xref +0 11 +0000000000 65535 f +0000000025 00000 n +0000000079 00000 n +0000000171 00000 n +0000000373 00000 n +0000000588 00000 n +0000000682 00000 n +0000000701 00000 n +0000000819 00000 n +0000000877 00000 n +0000000972 00000 n +trailer << + /Root 1 0 R + /Size 11 + /ID [<36b07232d7657658c548006151d4c57c><6de1f48ca16def200b3b655a24fa1b48>] +>> +startxref +992 +%%EOF diff --git a/qpdf/qtest/qpdf/p1-a-p2-b.pdf b/qpdf/qtest/qpdf/p1-a-p2-b.pdf new file mode 100644 index 0000000..4e05d88 --- /dev/null +++ b/qpdf/qtest/qpdf/p1-a-p2-b.pdf @@ -0,0 +1,138 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /Count 2 + /Kids [ + 3 0 R + 4 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +3 0 obj +<< + /Contents 5 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 7 0 R + >> + /ProcSet 8 0 R + >> + /Type /Page +>> +endobj + +%% Page 2 +4 0 obj +<< + /Contents 9 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 7 0 R + >> + /ProcSet 8 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +5 0 obj +<< + /Length 6 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (A) Tj +ET +endstream +endobj + +6 0 obj +39 +endobj + +7 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +8 0 obj +[ + /PDF + /Text +] +endobj + +%% Contents for page 2 +9 0 obj +<< + /Length 10 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (B) Tj +ET +endstream +endobj + +10 0 obj +39 +endobj + +xref +0 11 +0000000000 65535 f +0000000025 00000 n +0000000079 00000 n +0000000171 00000 n +0000000373 00000 n +0000000588 00000 n +0000000682 00000 n +0000000701 00000 n +0000000819 00000 n +0000000877 00000 n +0000000972 00000 n +trailer << + /Root 1 0 R + /Size 11 + /ID [<36b07232d7657658c548006151d4c57c><6de1f48ca16def200b3b655a24fa1b48>] +>> +startxref +992 +%%EOF diff --git a/qpdf/qtest/qpdf/p1-a.pdf b/qpdf/qtest/qpdf/p1-a.pdf new file mode 100644 index 0000000..8cb349c --- /dev/null +++ b/qpdf/qtest/qpdf/p1-a.pdf @@ -0,0 +1,95 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +3 0 obj +<< + /Contents 4 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 6 0 R + >> + /ProcSet 7 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +4 0 obj +<< + /Length 5 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (A) Tj +ET +endstream +endobj + +5 0 obj +39 +endobj + +6 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +7 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 8 +0000000000 65535 f +0000000025 00000 n +0000000079 00000 n +0000000161 00000 n +0000000376 00000 n +0000000470 00000 n +0000000489 00000 n +0000000607 00000 n +trailer << + /Root 1 0 R + /Size 8 + /ID [<36b07232d7657658c548006151d4c57c><36b07232d7657658c548006151d4c57c>] +>> +startxref +642 +%%EOF diff --git a/qpdf/qtest/qpdf/p1-b.pdf b/qpdf/qtest/qpdf/p1-b.pdf new file mode 100644 index 0000000..833e808 --- /dev/null +++ b/qpdf/qtest/qpdf/p1-b.pdf @@ -0,0 +1,95 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +3 0 obj +<< + /Contents 4 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 6 0 R + >> + /ProcSet 7 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +4 0 obj +<< + /Length 5 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (B) Tj +ET +endstream +endobj + +5 0 obj +39 +endobj + +6 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +7 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 8 +0000000000 65535 f +0000000025 00000 n +0000000079 00000 n +0000000161 00000 n +0000000376 00000 n +0000000470 00000 n +0000000489 00000 n +0000000607 00000 n +trailer << + /Root 1 0 R + /Size 8 + /ID [<36b07232d7657658c548006151d4c57c><36b07232d7657658c548006151d4c57c>] +>> +startxref +642 +%%EOF diff --git a/qpdf/qtest/qpdf/page-labels-and-outlines.pdf b/qpdf/qtest/qpdf/page-labels-and-outlines.pdf new file mode 100644 index 0000000..a0b0103 --- /dev/null +++ b/qpdf/qtest/qpdf/page-labels-and-outlines.pdf @@ -0,0 +1,1503 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /PageLabels << /Nums [ + 0 << /P () >> + 2 << /S /r /St 1 >> + 7 << /P () >> + 9 << /S /r /St 6 >> + 11 << /P () >> + 12 << /S /D /St 2 >> + 15 << /S /D /St 6 >> + 19 << /P () >> + 20 << /S /D /St 12 >> + 22 << /S /D /St 16059 >> + 23 << /S /r /St 50 >> + 29 << /S /r /St 54 >> + ] >> + /Pages 2 0 R + /Type /Catalog + /PageMode /UseOutlines + /Outlines 95 0 R +>> +endobj + +2 0 obj +<< + /Count 30 + /Kids [ + 3 0 R + 4 0 R + 5 0 R + 6 0 R + 7 0 R + 8 0 R + 9 0 R + 10 0 R + 11 0 R + 12 0 R + 13 0 R + 14 0 R + 15 0 R + 16 0 R + 17 0 R + 18 0 R + 19 0 R + 20 0 R + 21 0 R + 22 0 R + 23 0 R + 24 0 R + 25 0 R + 26 0 R + 27 0 R + 28 0 R + 29 0 R + 30 0 R + 31 0 R + 32 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +3 0 obj +<< + /Contents 33 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 2 +4 0 obj +<< + /Contents 37 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 3 +5 0 obj +<< + /Contents 39 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 4 +6 0 obj +<< + /Contents 41 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 5 +7 0 obj +<< + /Contents 43 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 6 +8 0 obj +<< + /Contents 45 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 7 +9 0 obj +<< + /Contents 47 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 8 +10 0 obj +<< + /Contents 49 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 9 +11 0 obj +<< + /Contents 51 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 10 +12 0 obj +<< + /Contents 53 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 11 +13 0 obj +<< + /Contents 55 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 12 +14 0 obj +<< + /Contents 57 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 13 +15 0 obj +<< + /Contents 59 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 14 +16 0 obj +<< + /Contents 61 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 15 +17 0 obj +<< + /Contents 63 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 16 +18 0 obj +<< + /Contents 65 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 17 +19 0 obj +<< + /Contents 67 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 18 +20 0 obj +<< + /Contents 69 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 19 +21 0 obj +<< + /Contents 71 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 20 +22 0 obj +<< + /Contents 73 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 21 +23 0 obj +<< + /Contents 75 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 22 +24 0 obj +<< + /Contents 77 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 23 +25 0 obj +<< + /Contents 79 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 24 +26 0 obj +<< + /Contents 81 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 25 +27 0 obj +<< + /Contents 83 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 26 +28 0 obj +<< + /Contents 85 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 27 +29 0 obj +<< + /Contents 87 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 28 +30 0 obj +<< + /Contents 89 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 29 +31 0 obj +<< + /Contents 91 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Page 30 +32 0 obj +<< + /Contents 93 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 35 0 R + >> + /ProcSet 36 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +33 0 obj +<< + /Length 34 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 0) Tj +ET +endstream +endobj + +34 0 obj +46 +endobj + +35 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +36 0 obj +[ + /PDF + /Text +] +endobj + +%% Contents for page 2 +37 0 obj +<< + /Length 38 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 1) Tj +ET +endstream +endobj + +38 0 obj +46 +endobj + +%% Contents for page 3 +39 0 obj +<< + /Length 40 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 2) Tj +ET +endstream +endobj + +40 0 obj +46 +endobj + +%% Contents for page 4 +41 0 obj +<< + /Length 42 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 3) Tj +ET +endstream +endobj + +42 0 obj +46 +endobj + +%% Contents for page 5 +43 0 obj +<< + /Length 44 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 4) Tj +ET +endstream +endobj + +44 0 obj +46 +endobj + +%% Contents for page 6 +45 0 obj +<< + /Length 46 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 5) Tj +ET +endstream +endobj + +46 0 obj +46 +endobj + +%% Contents for page 7 +47 0 obj +<< + /Length 48 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 6) Tj +ET +endstream +endobj + +48 0 obj +46 +endobj + +%% Contents for page 8 +49 0 obj +<< + /Length 50 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 7) Tj +ET +endstream +endobj + +50 0 obj +46 +endobj + +%% Contents for page 9 +51 0 obj +<< + /Length 52 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 8) Tj +ET +endstream +endobj + +52 0 obj +46 +endobj + +%% Contents for page 10 +53 0 obj +<< + /Length 54 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 9) Tj +ET +endstream +endobj + +54 0 obj +46 +endobj + +%% Contents for page 11 +55 0 obj +<< + /Length 56 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 10) Tj +ET +endstream +endobj + +56 0 obj +47 +endobj + +%% Contents for page 12 +57 0 obj +<< + /Length 58 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 11) Tj +ET +endstream +endobj + +58 0 obj +47 +endobj + +%% Contents for page 13 +59 0 obj +<< + /Length 60 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 12) Tj +ET +endstream +endobj + +60 0 obj +47 +endobj + +%% Contents for page 14 +61 0 obj +<< + /Length 62 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 13) Tj +ET +endstream +endobj + +62 0 obj +47 +endobj + +%% Contents for page 15 +63 0 obj +<< + /Length 64 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 14) Tj +ET +endstream +endobj + +64 0 obj +47 +endobj + +%% Contents for page 16 +65 0 obj +<< + /Length 66 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 15) Tj +ET +endstream +endobj + +66 0 obj +47 +endobj + +%% Contents for page 17 +67 0 obj +<< + /Length 68 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 16) Tj +ET +endstream +endobj + +68 0 obj +47 +endobj + +%% Contents for page 18 +69 0 obj +<< + /Length 70 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 17) Tj +ET +endstream +endobj + +70 0 obj +47 +endobj + +%% Contents for page 19 +71 0 obj +<< + /Length 72 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 18) Tj +ET +endstream +endobj + +72 0 obj +47 +endobj + +%% Contents for page 20 +73 0 obj +<< + /Length 74 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 19) Tj +ET +endstream +endobj + +74 0 obj +47 +endobj + +%% Contents for page 21 +75 0 obj +<< + /Length 76 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 20) Tj +ET +endstream +endobj + +76 0 obj +47 +endobj + +%% Contents for page 22 +77 0 obj +<< + /Length 78 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 21) Tj +ET +endstream +endobj + +78 0 obj +47 +endobj + +%% Contents for page 23 +79 0 obj +<< + /Length 80 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 22) Tj +ET +endstream +endobj + +80 0 obj +47 +endobj + +%% Contents for page 24 +81 0 obj +<< + /Length 82 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 23) Tj +ET +endstream +endobj + +82 0 obj +47 +endobj + +%% Contents for page 25 +83 0 obj +<< + /Length 84 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 24) Tj +ET +endstream +endobj + +84 0 obj +47 +endobj + +%% Contents for page 26 +85 0 obj +<< + /Length 86 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 25) Tj +ET +endstream +endobj + +86 0 obj +47 +endobj + +%% Contents for page 27 +87 0 obj +<< + /Length 88 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 26) Tj +ET +endstream +endobj + +88 0 obj +47 +endobj + +%% Contents for page 28 +89 0 obj +<< + /Length 90 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 27) Tj +ET +endstream +endobj + +90 0 obj +47 +endobj + +%% Contents for page 29 +91 0 obj +<< + /Length 92 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 28) Tj +ET +endstream +endobj + +92 0 obj +47 +endobj + +%% Contents for page 30 +93 0 obj +<< + /Length 94 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 29) Tj +ET +endstream +endobj + +94 0 obj +47 +endobj + +95 0 obj +<< + /Type /Outlines + /First 96 0 R + /Last 97 0 R + /Count 6 +>> +endobj + +96 0 obj +<< + /Type /Outline + /Title (Isís 1 -> 5: /XYZ null null null) + /Parent 95 0 R + /Count 4 + /Next 97 0 R + /First 98 0 R + /Last 99 0 R + /Dest [ 8 0 R /XYZ null null null ] +>> +endobj + +97 0 obj +<< + /Type /Outline + /Title (Trepak 2 -> 15: /XYZ 66 756 3) + /Parent 95 0 R + /Prev 96 0 R + /Dest [ 18 0 R /XYZ 66 756 3 ] +>> +endobj + +98 0 obj +<< + /Type /Outline + /Title (Amanda 1.1 -> 11: /Fit) + /Parent 96 0 R + /Next 99 0 R + /First 100 0 R + /Last 101 0 R + /Count -3 + /Dest [ 14 0 R /Fit ] +>> +endobj + +99 0 obj +<< + /Type /Outline + % /Title (Sandy (Sandy [Greek]) 1.2 -> 13: /FitH 792) + /Title + /Parent 96 0 R + /Prev 98 0 R + /First 105 0 R + /Last 106 0 R + /Count 2 + /Dest [ 16 0 R /FitH 792 ] +>> +endobj + +100 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.1 -> 12: /FitV 100) + /Parent 98 0 R + /Next 101 0 R + /First 102 0 R + /Last 103 0 R + /Count -2 + /Dest [ 15 0 R /FitV 100 ] +>> +endobj + +101 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.2 -> 12: /XYZ null null null) + /Parent 98 0 R + /Prev 100 0 R + /First 104 0 R + /Last 104 0 R + /Count 1 + /Dest [ 15 0 R /XYZ null null null ] +>> +endobj + +102 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.1.1 -> 18: /XYZ null null null) + /Parent 100 0 R + /Next 103 0 R + /Dest [ 21 0 R /XYZ null null null ] +>> +endobj + +103 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.1.2 -> 19: /XYZ null null null) + /Parent 100 0 R + /Prev 102 0 R + /Dest [ 22 0 R /XYZ null null null ] +>> +endobj + +104 0 obj +<< + /Type /Outline + /Title (Isosicle 1.1.2.1 -> 22: /XYZ null null null) + /Parent 101 0 R + /Dest [ 25 0 R /XYZ null null null ] +>> +endobj + +105 0 obj +<< + /Type /Outline + /Title (Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770) + /Parent 99 0 R + /Next 106 0 R + /Dest [ 4 0 R /FitR 66 714 180 770 ] +>> +endobj + +106 0 obj +<< + /Type /Outline + /Title (Trepsicle 1.2.2 -> 0: /XYZ null null null) + /Parent 99 0 R + /Prev 105 0 R + /Dest [ 3 0 R /XYZ null null null ] +>> +endobj + +xref +0 107 +0000000000 65535 f +0000000025 00000 n +0000000434 00000 n +0000000830 00000 n +0000001035 00000 n +0000001240 00000 n +0000001445 00000 n +0000001650 00000 n +0000001855 00000 n +0000002060 00000 n +0000002265 00000 n +0000002471 00000 n +0000002678 00000 n +0000002885 00000 n +0000003092 00000 n +0000003299 00000 n +0000003506 00000 n +0000003713 00000 n +0000003920 00000 n +0000004127 00000 n +0000004334 00000 n +0000004541 00000 n +0000004748 00000 n +0000004955 00000 n +0000005162 00000 n +0000005369 00000 n +0000005576 00000 n +0000005783 00000 n +0000005990 00000 n +0000006197 00000 n +0000006404 00000 n +0000006611 00000 n +0000006818 00000 n +0000007037 00000 n +0000007140 00000 n +0000007160 00000 n +0000007279 00000 n +0000007338 00000 n +0000007441 00000 n +0000007484 00000 n +0000007587 00000 n +0000007630 00000 n +0000007733 00000 n +0000007776 00000 n +0000007879 00000 n +0000007922 00000 n +0000008025 00000 n +0000008068 00000 n +0000008171 00000 n +0000008214 00000 n +0000008317 00000 n +0000008360 00000 n +0000008463 00000 n +0000008507 00000 n +0000008610 00000 n +0000008654 00000 n +0000008758 00000 n +0000008802 00000 n +0000008906 00000 n +0000008950 00000 n +0000009054 00000 n +0000009098 00000 n +0000009202 00000 n +0000009246 00000 n +0000009350 00000 n +0000009394 00000 n +0000009498 00000 n +0000009542 00000 n +0000009646 00000 n +0000009690 00000 n +0000009794 00000 n +0000009838 00000 n +0000009942 00000 n +0000009986 00000 n +0000010090 00000 n +0000010134 00000 n +0000010238 00000 n +0000010282 00000 n +0000010386 00000 n +0000010430 00000 n +0000010534 00000 n +0000010578 00000 n +0000010682 00000 n +0000010726 00000 n +0000010830 00000 n +0000010874 00000 n +0000010978 00000 n +0000011022 00000 n +0000011126 00000 n +0000011170 00000 n +0000011274 00000 n +0000011318 00000 n +0000011422 00000 n +0000011466 00000 n +0000011570 00000 n +0000011590 00000 n +0000011677 00000 n +0000011873 00000 n +0000012019 00000 n +0000012194 00000 n +0000012547 00000 n +0000012738 00000 n +0000012948 00000 n +0000013117 00000 n +0000013286 00000 n +0000013439 00000 n +0000013608 00000 n +trailer << + /Root 1 0 R + /Size 107 +>> +startxref +13773 +%%EOF diff --git a/qpdf/qtest/qpdf/page_api_1-out.pdf b/qpdf/qtest/qpdf/page_api_1-out.pdf new file mode 100644 index 0000000..b543971 --- /dev/null +++ b/qpdf/qtest/qpdf/page_api_1-out.pdf @@ -0,0 +1,168 @@ +%PDF-1.3 +%¿÷¢þ +1 0 obj +<< /Pages 3 0 R /Type /Catalog >> +endobj +2 0 obj +<< /CreationDate (D:20120621111522) /Producer (Apex PDFWriter) >> +endobj +3 0 obj +<< /Count 13 /Kids [ 4 0 R 5 0 R 6 0 R 7 0 R 8 0 R 9 0 R 10 0 R 11 0 R 12 0 R 13 0 R 14 0 R 15 0 R 16 0 R ] /Type /Pages >> +endobj +4 0 obj +<< /Contents 17 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 18 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +5 0 obj +<< /Contents 19 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 18 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +6 0 obj +<< /Contents 20 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 18 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +7 0 obj +<< /Contents 21 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 18 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +8 0 obj +<< /Contents 22 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 18 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +9 0 obj +<< /Contents 23 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 18 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +10 0 obj +<< /Contents 24 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 18 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +11 0 obj +<< /Contents 25 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 18 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +12 0 obj +<< /Contents 26 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 18 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +13 0 obj +<< /Contents 27 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 18 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +14 0 obj +<< /Contents 28 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 18 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +15 0 obj +<< /Contents 29 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 18 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +16 0 obj +<< /Contents 30 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 18 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +17 0 obj +<< /Length 42 >> +stream +BT /F1 15 Tf 72 720 Td (New page 0) Tj ET +endstream +endobj +18 0 obj +<< /BaseFont /Times-Roman /Encoding /WinAnsiEncoding /Subtype /Type1 /Type /Font >> +endobj +19 0 obj +<< /Length 42 >> +stream +BT /F1 15 Tf 72 720 Td (New page 1) Tj ET +endstream +endobj +20 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 1) Tj ET +endstream +endobj +21 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 2) Tj ET +endstream +endobj +22 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 3) Tj ET +endstream +endobj +23 0 obj +<< /Length 42 >> +stream +BT /F1 15 Tf 72 720 Td (New page 5) Tj ET +endstream +endobj +24 0 obj +<< /Length 42 >> +stream +BT /F1 15 Tf 72 720 Td (New page 6) Tj ET +endstream +endobj +25 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 4) Tj ET +endstream +endobj +26 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 6) Tj ET +endstream +endobj +27 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 7) Tj ET +endstream +endobj +28 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 8) Tj ET +endstream +endobj +29 0 obj +<< /Length 43 >> +stream +BT /F1 15 Tf 72 720 Td (New page 11) Tj ET +endstream +endobj +30 0 obj +<< /Length 43 >> +stream +BT /F1 15 Tf 72 720 Td (New page 12) Tj ET +endstream +endobj +xref +0 31 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000145 00000 n +0000000284 00000 n +0000000438 00000 n +0000000592 00000 n +0000000746 00000 n +0000000900 00000 n +0000001054 00000 n +0000001208 00000 n +0000001363 00000 n +0000001518 00000 n +0000001673 00000 n +0000001828 00000 n +0000001983 00000 n +0000002138 00000 n +0000002293 00000 n +0000002385 00000 n +0000002485 00000 n +0000002577 00000 n +0000002674 00000 n +0000002771 00000 n +0000002868 00000 n +0000002960 00000 n +0000003052 00000 n +0000003149 00000 n +0000003246 00000 n +0000003343 00000 n +0000003440 00000 n +0000003533 00000 n +trailer << /Info 2 0 R /Root 1 0 R /Size 31 /ID [<21f7a6fb083dab8e29743918a08bfa31><31415926535897932384626433832795>] >> +startxref +3626 +%%EOF diff --git a/qpdf/qtest/qpdf/page_api_1-out2.pdf b/qpdf/qtest/qpdf/page_api_1-out2.pdf new file mode 100644 index 0000000..7ec2142 --- /dev/null +++ b/qpdf/qtest/qpdf/page_api_1-out2.pdf @@ -0,0 +1,146 @@ +%PDF-1.3 +%¿÷¢þ +1 0 obj +<< /Pages 3 0 R /Type /Catalog >> +endobj +2 0 obj +<< /CreationDate (D:20120621111522) /Producer (Apex PDFWriter) >> +endobj +3 0 obj +<< /Count 11 /Kids [ 4 0 R 5 0 R 6 0 R 7 0 R 8 0 R 9 0 R 10 0 R 11 0 R 12 0 R 13 0 R 14 0 R ] /Type /Pages >> +endobj +4 0 obj +<< /Contents 15 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 16 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +5 0 obj +<< /Contents 17 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 16 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +6 0 obj +<< /Contents 18 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 16 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +7 0 obj +<< /Contents 19 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 16 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +8 0 obj +<< /Contents 20 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 16 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +9 0 obj +<< /Contents 21 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 16 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +10 0 obj +<< /Contents 22 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 16 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +11 0 obj +<< /Contents 23 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 16 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +12 0 obj +<< /Contents 24 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 16 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +13 0 obj +<< /Contents 25 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 16 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +14 0 obj +<< /Contents 26 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 16 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +15 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 0) Tj ET +endstream +endobj +16 0 obj +<< /BaseFont /Times-Roman /Encoding /WinAnsiEncoding /Subtype /Type1 /Type /Font >> +endobj +17 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 1) Tj ET +endstream +endobj +18 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 2) Tj ET +endstream +endobj +19 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 3) Tj ET +endstream +endobj +20 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 4) Tj ET +endstream +endobj +21 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 5) Tj ET +endstream +endobj +22 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 6) Tj ET +endstream +endobj +23 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 7) Tj ET +endstream +endobj +24 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 8) Tj ET +endstream +endobj +25 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 9) Tj ET +endstream +endobj +26 0 obj +<< /Length 43 >> +stream +BT /F1 15 Tf 72 720 Td (New page 10) Tj ET +endstream +endobj +xref +0 27 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000145 00000 n +0000000270 00000 n +0000000424 00000 n +0000000578 00000 n +0000000732 00000 n +0000000886 00000 n +0000001040 00000 n +0000001194 00000 n +0000001349 00000 n +0000001504 00000 n +0000001659 00000 n +0000001814 00000 n +0000001969 00000 n +0000002066 00000 n +0000002166 00000 n +0000002263 00000 n +0000002360 00000 n +0000002457 00000 n +0000002554 00000 n +0000002651 00000 n +0000002748 00000 n +0000002845 00000 n +0000002942 00000 n +0000003039 00000 n +trailer << /Info 2 0 R /Root 1 0 R /Size 27 /ID [<21f7a6fb083dab8e29743918a08bfa31><31415926535897932384626433832795>] >> +startxref +3132 +%%EOF diff --git a/qpdf/qtest/qpdf/page_api_1-out3.pdf b/qpdf/qtest/qpdf/page_api_1-out3.pdf new file mode 100644 index 0000000..74a9cb4 --- /dev/null +++ b/qpdf/qtest/qpdf/page_api_1-out3.pdf @@ -0,0 +1,135 @@ +%PDF-1.3 +%¿÷¢þ +1 0 obj +<< /Pages 3 0 R /Type /Catalog >> +endobj +2 0 obj +<< /CreationDate (D:20120621111522) /Producer (Apex PDFWriter) >> +endobj +3 0 obj +<< /Count 10 /Kids [ 4 0 R 5 0 R 6 0 R 7 0 R 8 0 R 9 0 R 10 0 R 11 0 R 12 0 R 13 0 R ] /Type /Pages >> +endobj +4 0 obj +<< /Contents 14 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 15 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +5 0 obj +<< /Contents 16 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 15 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +6 0 obj +<< /Contents 17 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 15 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +7 0 obj +<< /Contents 18 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 15 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +8 0 obj +<< /Contents 19 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 15 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +9 0 obj +<< /Contents 20 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 15 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +10 0 obj +<< /Contents 21 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 15 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +11 0 obj +<< /Contents 22 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 15 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +12 0 obj +<< /Contents 23 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 15 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +13 0 obj +<< /Contents 24 0 R /MediaBox [ 0 0 612 792 ] /Parent 3 0 R /Resources << /Font << /F1 15 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> +endobj +14 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 0) Tj ET +endstream +endobj +15 0 obj +<< /BaseFont /Times-Roman /Encoding /WinAnsiEncoding /Subtype /Type1 /Type /Font >> +endobj +16 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 1) Tj ET +endstream +endobj +17 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 2) Tj ET +endstream +endobj +18 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 3) Tj ET +endstream +endobj +19 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 4) Tj ET +endstream +endobj +20 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 6) Tj ET +endstream +endobj +21 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 7) Tj ET +endstream +endobj +22 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 8) Tj ET +endstream +endobj +23 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 9) Tj ET +endstream +endobj +24 0 obj +<< /Length 47 >> +stream +BT /F1 15 Tf 72 720 Td (Original page 5) Tj ET +endstream +endobj +xref +0 25 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000145 00000 n +0000000263 00000 n +0000000417 00000 n +0000000571 00000 n +0000000725 00000 n +0000000879 00000 n +0000001033 00000 n +0000001187 00000 n +0000001342 00000 n +0000001497 00000 n +0000001652 00000 n +0000001807 00000 n +0000001904 00000 n +0000002004 00000 n +0000002101 00000 n +0000002198 00000 n +0000002295 00000 n +0000002392 00000 n +0000002489 00000 n +0000002586 00000 n +0000002683 00000 n +0000002780 00000 n +trailer << /Info 2 0 R /Root 1 0 R /Size 25 /ID [<21f7a6fb083dab8e29743918a08bfa31><31415926535897932384626433832795>] >> +startxref +2877 +%%EOF diff --git a/qpdf/qtest/qpdf/page_api_1.out b/qpdf/qtest/qpdf/page_api_1.out new file mode 100644 index 0000000..f705b88 --- /dev/null +++ b/qpdf/qtest/qpdf/page_api_1.out @@ -0,0 +1 @@ +page_api_1.pdf (page 10 (numbered from zero): object 9 0): duplicate page reference found; this would cause loss of data diff --git a/qpdf/qtest/qpdf/page_api_1.out2 b/qpdf/qtest/qpdf/page_api_1.out2 new file mode 100644 index 0000000..c945f0e --- /dev/null +++ b/qpdf/qtest/qpdf/page_api_1.out2 @@ -0,0 +1 @@ +page_api_1.pdf (page object: object 4 0): page object not referenced in /Pages tree diff --git a/qpdf/qtest/qpdf/page_api_1.pdf b/qpdf/qtest/qpdf/page_api_1.pdf new file mode 100644 index 0000000..8abe106 --- /dev/null +++ b/qpdf/qtest/qpdf/page_api_1.pdf @@ -0,0 +1,472 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /Pages 3 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /CreationDate (D:20120621111522) + /Producer (Apex PDFWriter) +>> +endobj + +3 0 obj +<< + /Count 10 + /Kids [ + 4 0 R + 5 0 R + 6 0 R + 7 0 R + 8 0 R + 9 0 R + 10 0 R + 11 0 R + 12 0 R + 13 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +4 0 obj +<< + /Contents 14 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 16 0 R + >> + /ProcSet [ + /PDF + /Text + ] + >> + /Type /Page +>> +endobj + +%% Page 2 +5 0 obj +<< + /Contents 17 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 16 0 R + >> + /ProcSet [ + /PDF + /Text + ] + >> + /Type /Page +>> +endobj + +%% Page 3 +6 0 obj +<< + /Contents 19 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 16 0 R + >> + /ProcSet [ + /PDF + /Text + ] + >> + /Type /Page +>> +endobj + +%% Page 4 +7 0 obj +<< + /Contents 21 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 16 0 R + >> + /ProcSet [ + /PDF + /Text + ] + >> + /Type /Page +>> +endobj + +%% Page 5 +8 0 obj +<< + /Contents 23 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 16 0 R + >> + /ProcSet [ + /PDF + /Text + ] + >> + /Type /Page +>> +endobj + +%% Page 6 +9 0 obj +<< + /Contents 25 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 16 0 R + >> + /ProcSet [ + /PDF + /Text + ] + >> + /Type /Page +>> +endobj + +%% Page 7 +10 0 obj +<< + /Contents 27 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 16 0 R + >> + /ProcSet [ + /PDF + /Text + ] + >> + /Type /Page +>> +endobj + +%% Page 8 +11 0 obj +<< + /Contents 29 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 16 0 R + >> + /ProcSet [ + /PDF + /Text + ] + >> + /Type /Page +>> +endobj + +%% Page 9 +12 0 obj +<< + /Contents 31 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 16 0 R + >> + /ProcSet [ + /PDF + /Text + ] + >> + /Type /Page +>> +endobj + +%% Page 10 +13 0 obj +<< + /Contents 33 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 16 0 R + >> + /ProcSet [ + /PDF + /Text + ] + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +14 0 obj +<< + /Length 15 0 R +>> +stream +BT /F1 15 Tf 72 720 Td (Original page 0) Tj ET +endstream +endobj + +15 0 obj +47 +endobj + +16 0 obj +<< + /BaseFont /Times-Roman + /Encoding /WinAnsiEncoding + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Contents for page 2 +17 0 obj +<< + /Length 18 0 R +>> +stream +BT /F1 15 Tf 72 720 Td (Original page 1) Tj ET +endstream +endobj + +18 0 obj +47 +endobj + +%% Contents for page 3 +19 0 obj +<< + /Length 20 0 R +>> +stream +BT /F1 15 Tf 72 720 Td (Original page 2) Tj ET +endstream +endobj + +20 0 obj +47 +endobj + +%% Contents for page 4 +21 0 obj +<< + /Length 22 0 R +>> +stream +BT /F1 15 Tf 72 720 Td (Original page 3) Tj ET +endstream +endobj + +22 0 obj +47 +endobj + +%% Contents for page 5 +23 0 obj +<< + /Length 24 0 R +>> +stream +BT /F1 15 Tf 72 720 Td (Original page 4) Tj ET +endstream +endobj + +24 0 obj +47 +endobj + +%% Contents for page 6 +25 0 obj +<< + /Length 26 0 R +>> +stream +BT /F1 15 Tf 72 720 Td (Original page 5) Tj ET +endstream +endobj + +26 0 obj +47 +endobj + +%% Contents for page 7 +27 0 obj +<< + /Length 28 0 R +>> +stream +BT /F1 15 Tf 72 720 Td (Original page 6) Tj ET +endstream +endobj + +28 0 obj +47 +endobj + +%% Contents for page 8 +29 0 obj +<< + /Length 30 0 R +>> +stream +BT /F1 15 Tf 72 720 Td (Original page 7) Tj ET +endstream +endobj + +30 0 obj +47 +endobj + +%% Contents for page 9 +31 0 obj +<< + /Length 32 0 R +>> +stream +BT /F1 15 Tf 72 720 Td (Original page 8) Tj ET +endstream +endobj + +32 0 obj +47 +endobj + +%% Contents for page 10 +33 0 obj +<< + /Length 34 0 R +>> +stream +BT /F1 15 Tf 72 720 Td (Original page 9) Tj ET +endstream +endobj + +34 0 obj +47 +endobj + +xref +0 35 +0000000000 65535 f +0000000025 00000 n +0000000079 00000 n +0000000165 00000 n +0000000342 00000 n +0000000571 00000 n +0000000800 00000 n +0000001029 00000 n +0000001258 00000 n +0000001487 00000 n +0000001716 00000 n +0000001946 00000 n +0000002176 00000 n +0000002407 00000 n +0000002650 00000 n +0000002754 00000 n +0000002774 00000 n +0000002906 00000 n +0000003010 00000 n +0000003053 00000 n +0000003157 00000 n +0000003200 00000 n +0000003304 00000 n +0000003347 00000 n +0000003451 00000 n +0000003494 00000 n +0000003598 00000 n +0000003641 00000 n +0000003745 00000 n +0000003788 00000 n +0000003892 00000 n +0000003935 00000 n +0000004039 00000 n +0000004083 00000 n +0000004187 00000 n +trailer << + /Info 2 0 R + /Root 1 0 R + /Size 35 + /ID [<21f7a6fb083dab8e29743918a08bfa31><21f7a6fb083dab8e29743918a08bfa31>] +>> +startxref +4207 +%%EOF diff --git a/qpdf/qtest/qpdf/page_api_2.out b/qpdf/qtest/qpdf/page_api_2.out new file mode 100644 index 0000000..9fc019c --- /dev/null +++ b/qpdf/qtest/qpdf/page_api_2.out @@ -0,0 +1 @@ +page_api_2.pdf (page 1 (numbered from zero): object 4 0): duplicate page reference found; this would cause loss of data diff --git a/qpdf/qtest/qpdf/page_api_2.pdf b/qpdf/qtest/qpdf/page_api_2.pdf new file mode 100644 index 0000000..f3d6eaa --- /dev/null +++ b/qpdf/qtest/qpdf/page_api_2.pdf @@ -0,0 +1,137 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /Pages 3 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /CreationDate (D:20120621124041) + /Producer (Apex PDFWriter) +>> +endobj + +3 0 obj +<< + /Count 3 + /Kids [ + 4 0 R + 4 0 R + 5 0 R + ] + /Type /Pages +>> +endobj + +%% Page 2 +4 0 obj +<< + /Contents 6 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 8 0 R + >> + /ProcSet [ + /PDF + /Text + ] + >> + /Type /Page +>> +endobj + +%% Page 3 +5 0 obj +<< + /Contents 9 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 8 0 R + >> + /ProcSet [ + /PDF + /Text + ] + >> + /Type /Page +>> +endobj + +%% Contents for page 2 +6 0 obj +<< + /Length 7 0 R +>> +stream +BT /F1 15 Tf 72 720 Td (Original page 0) Tj ET +endstream +endobj + +7 0 obj +47 +endobj + +8 0 obj +<< + /BaseFont /Times-Roman + /Encoding /WinAnsiEncoding + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Contents for page 3 +9 0 obj +<< + /Length 10 0 R +>> +stream +BT /F1 15 Tf 72 720 Td (Original page 2) Tj ET +endstream +endobj + +10 0 obj +47 +endobj + +xref +0 11 +0000000000 65535 f +0000000025 00000 n +0000000079 00000 n +0000000165 00000 n +0000000267 00000 n +0000000494 00000 n +0000000734 00000 n +0000000836 00000 n +0000000855 00000 n +0000000986 00000 n +0000001089 00000 n +trailer << + /Info 2 0 R + /Root 1 0 R + /Size 11 + /ID [] +>> +startxref +1109 +%%EOF diff --git a/qpdf/qtest/qpdf/pages-copy-encryption.pdf b/qpdf/qtest/qpdf/pages-copy-encryption.pdf new file mode 100644 index 0000000..4028064 Binary files /dev/null and b/qpdf/qtest/qpdf/pages-copy-encryption.pdf differ diff --git a/qpdf/qtest/qpdf/pages-warning.out b/qpdf/qtest/qpdf/pages-warning.out new file mode 100644 index 0000000..219390a --- /dev/null +++ b/qpdf/qtest/qpdf/pages-warning.out @@ -0,0 +1,2 @@ +WARNING: lin-special.pdf (Pages object: object 6 0): Unknown key /Quack in /Pages object is being discarded as a result of flattening the /Pages tree +test 23 done diff --git a/qpdf/qtest/qpdf/parse-object.out b/qpdf/qtest/qpdf/parse-object.out new file mode 100644 index 0000000..456e2f8 --- /dev/null +++ b/qpdf/qtest/qpdf/parse-object.out @@ -0,0 +1,4 @@ +[ /name 16059 3.14159 false << /key true /other [ (string1) (string2) ] >> null ] +logic error parsing indirect: QPDFObjectHandle::parse called without context on an object with indirect references +trailing data: parsed object (trailing test): trailing data found parsing object from string +test 31 done diff --git a/qpdf/qtest/qpdf/qstream.pdf b/qpdf/qtest/qpdf/qstream.pdf new file mode 100644 index 0000000..6398945 --- /dev/null +++ b/qpdf/qtest/qpdf/qstream.pdf @@ -0,0 +1,90 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R + /QStream 7 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +7 0 obj +<< + /Length 29 +>> +stream +This is the old stream data. +endstream +endobj + +xref +0 8 +0000000000 65535 f +0000000009 00000 n +0000000080 00000 n +0000000152 00000 n +0000000324 00000 n +0000000420 00000 n +0000000455 00000 n +0000000573 00000 n +trailer << + /Size 8 + /Root 1 0 R +>> +startxref +654 +%%EOF diff --git a/qpdf/qtest/qpdf/replaced-stream-data-flate.pdf b/qpdf/qtest/qpdf/replaced-stream-data-flate.pdf new file mode 100644 index 0000000..0293117 Binary files /dev/null and b/qpdf/qtest/qpdf/replaced-stream-data-flate.pdf differ diff --git a/qpdf/qtest/qpdf/replaced-stream-data.pdf b/qpdf/qtest/qpdf/replaced-stream-data.pdf new file mode 100644 index 0000000..14b2dea --- /dev/null +++ b/qpdf/qtest/qpdf/replaced-stream-data.pdf @@ -0,0 +1,47 @@ +%PDF-1.3 +%¿÷¢þ +1 0 obj +<< /Pages 2 0 R /QStream 3 0 R /Type /Catalog >> +endobj +2 0 obj +<< /Count 1 /Kids [ 4 0 R ] /Type /Pages >> +endobj +3 0 obj +<< /Length 20 >> +stream +new data for stream +endstream +endobj +4 0 obj +<< /Contents 5 0 R /MediaBox [ 0 0 612 792 ] /Parent 2 0 R /Resources << /Font << /F1 6 0 R >> /ProcSet 7 0 R >> /Type /Page >> +endobj +5 0 obj +<< /Length 44 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj +6 0 obj +<< /BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font >> +endobj +7 0 obj +[ /PDF /Text ] +endobj +xref +0 8 +0000000000 65535 f +0000000015 00000 n +0000000079 00000 n +0000000138 00000 n +0000000207 00000 n +0000000350 00000 n +0000000443 00000 n +0000000550 00000 n +trailer << /Root 1 0 R /Size 8 /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] >> +startxref +580 +%%EOF diff --git a/qpdf/qtest/qpdf/reserved-objects.out b/qpdf/qtest/qpdf/reserved-objects.out new file mode 100644 index 0000000..a1611e1 --- /dev/null +++ b/qpdf/qtest/qpdf/reserved-objects.out @@ -0,0 +1,8 @@ +res1 is still reserved after checking if array +res1 is no longer reserved +res1 is an array +logic error: QPDFObjectHandle: attempting to unparse a reserved object +logic error: QPDFObjectHandle: attempting to make a reserved object handle direct +res2 is an array +circular access and lazy resolution worked +test 24 done diff --git a/qpdf/qtest/qpdf/reserved-objects.pdf b/qpdf/qtest/qpdf/reserved-objects.pdf new file mode 100644 index 0000000..592a51d --- /dev/null +++ b/qpdf/qtest/qpdf/reserved-objects.pdf @@ -0,0 +1,48 @@ +%PDF-1.3 +%¿÷¢þ +1 0 obj +<< /Pages 4 0 R /Type /Catalog >> +endobj +2 0 obj +[ 3 0 R 1 ] +endobj +3 0 obj +[ 2 0 R 2 ] +endobj +4 0 obj +<< /Count 1 /Kids [ 5 0 R ] /Type /Pages >> +endobj +5 0 obj +<< /Contents 6 0 R /MediaBox [ 0 0 612 792 ] /Parent 4 0 R /Resources << /Font << /F1 7 0 R >> /ProcSet 8 0 R >> /Type /Page >> +endobj +6 0 obj +<< /Length 44 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj +7 0 obj +<< /BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font >> +endobj +8 0 obj +[ /PDF /Text ] +endobj +xref +0 9 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000091 00000 n +0000000118 00000 n +0000000177 00000 n +0000000320 00000 n +0000000413 00000 n +0000000520 00000 n +trailer << /Root 1 0 R /Size 9 Array1 2 0 R Array2 3 0 R /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] >> +startxref +550 +%%EOF diff --git a/qpdf/qtest/qpdf/shallow_array-out.pdf b/qpdf/qtest/qpdf/shallow_array-out.pdf new file mode 100644 index 0000000..31d86ec --- /dev/null +++ b/qpdf/qtest/qpdf/shallow_array-out.pdf @@ -0,0 +1,40 @@ +%PDF-1.3 +%¿÷¢þ +1 0 obj +<< /Pages 2 0 R /Type /Catalog >> +endobj +2 0 obj +<< /Count 1 /Kids [ 3 0 R ] /Type /Pages >> +endobj +3 0 obj +<< /Contents 4 0 R /MediaBox [ 0 0 612 792 ] /Parent 2 0 R /Resources << /Font << /F1 5 0 R >> /ProcSet 6 0 R >> /Type /Page >> +endobj +4 0 obj +<< /Length 44 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj +5 0 obj +<< /BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font >> +endobj +6 0 obj +[ /PDF /Text ] +endobj +xref +0 7 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000123 00000 n +0000000266 00000 n +0000000359 00000 n +0000000466 00000 n +trailer << /QTest [ /A 1 0 R /B ] /QTest2 [ /A 1 0 R /B 7 ] /Root 1 0 R /Size 7 /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] >> +startxref +496 +%%EOF diff --git a/qpdf/qtest/qpdf/shallow_array.pdf b/qpdf/qtest/qpdf/shallow_array.pdf new file mode 100644 index 0000000..63c39b0 --- /dev/null +++ b/qpdf/qtest/qpdf/shallow_array.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /QTest [ /A 1 0 R /B ] +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/shallow_stream.out b/qpdf/qtest/qpdf/shallow_stream.out new file mode 100644 index 0000000..fec1aa8 --- /dev/null +++ b/qpdf/qtest/qpdf/shallow_stream.out @@ -0,0 +1 @@ +attempt to make a shallow copy of a stream diff --git a/qpdf/qtest/qpdf/short-id-check.out b/qpdf/qtest/qpdf/short-id-check.out new file mode 100644 index 0000000..e2ffcef --- /dev/null +++ b/qpdf/qtest/qpdf/short-id-check.out @@ -0,0 +1,17 @@ +checking a.pdf +PDF Version: 1.3 +R = 2 +P = -4 +User password = +extract for accessibility: allowed +extract for any purpose: allowed +print low resolution: allowed +print high resolution: allowed +modify document assembly: allowed +modify forms: allowed +modify annotations: allowed +modify other: allowed +modify anything: allowed +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/short-id.pdf b/qpdf/qtest/qpdf/short-id.pdf new file mode 100644 index 0000000..e068f84 --- /dev/null +++ b/qpdf/qtest/qpdf/short-id.pdf @@ -0,0 +1,80 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R + /ID [<443A32303130303432333131> <443A32303130303432333131>] +>> +startxref +556 +%%EOF diff --git a/qpdf/qtest/qpdf/show-page-1-content-filtered.out b/qpdf/qtest/qpdf/show-page-1-content-filtered.out new file mode 100644 index 0000000..633a5c1 --- /dev/null +++ b/qpdf/qtest/qpdf/show-page-1-content-filtered.out @@ -0,0 +1 @@ +q 222 0 0 240 28.5 96 cm /Im1 Do Q q 185 0 0 200 313.5 296 cm /Im2 Do Q \ No newline at end of file diff --git a/qpdf/qtest/qpdf/show-page-1-content-normalized.out b/qpdf/qtest/qpdf/show-page-1-content-normalized.out new file mode 100644 index 0000000..32c115c --- /dev/null +++ b/qpdf/qtest/qpdf/show-page-1-content-normalized.out @@ -0,0 +1,8 @@ +q +222 0 0 240 28.5 96 cm +/Im1 Do +Q +q +185 0 0 200 313.5 296 cm +/Im2 Do +Q diff --git a/qpdf/qtest/qpdf/show-page-1-content-raw.out b/qpdf/qtest/qpdf/show-page-1-content-raw.out new file mode 100644 index 0000000..22440b5 Binary files /dev/null and b/qpdf/qtest/qpdf/show-page-1-content-raw.out differ diff --git a/qpdf/qtest/qpdf/show-page-1-image.out b/qpdf/qtest/qpdf/show-page-1-image.out new file mode 100644 index 0000000..c2a3483 Binary files /dev/null and b/qpdf/qtest/qpdf/show-page-1-image.out differ diff --git a/qpdf/qtest/qpdf/show-page-1.out b/qpdf/qtest/qpdf/show-page-1.out new file mode 100644 index 0000000..f12237c --- /dev/null +++ b/qpdf/qtest/qpdf/show-page-1.out @@ -0,0 +1 @@ +<< /Contents 7 0 R /MediaBox [ 0 0 612 792 ] /Parent 4 0 R /Resources << /ProcSet [ /PDF /ImageC ] /XObject << /Im1 8 0 R /Im2 9 0 R >> >> /Type /Page >> diff --git a/qpdf/qtest/qpdf/show-pages-images.out b/qpdf/qtest/qpdf/show-pages-images.out new file mode 100644 index 0000000..6d54e9f --- /dev/null +++ b/qpdf/qtest/qpdf/show-pages-images.out @@ -0,0 +1,11 @@ +page 1: 5 0 R + images: + /Im1: 8 0 R, 555 x 600 + /Im2: 9 0 R, 185 x 200 + content: + 7 0 R +page 2: 6 0 R + images: + /Im2: 9 0 R, 185 x 200 + content: + 10 0 R diff --git a/qpdf/qtest/qpdf/show-pages.out b/qpdf/qtest/qpdf/show-pages.out new file mode 100644 index 0000000..01e0ea0 --- /dev/null +++ b/qpdf/qtest/qpdf/show-pages.out @@ -0,0 +1,6 @@ +page 1: 5 0 R + content: + 7 0 R +page 2: 6 0 R + content: + 10 0 R diff --git a/qpdf/qtest/qpdf/show-unfilterable.out b/qpdf/qtest/qpdf/show-unfilterable.out new file mode 100644 index 0000000..464ca2c --- /dev/null +++ b/qpdf/qtest/qpdf/show-unfilterable.out @@ -0,0 +1 @@ +Unable to filter stream data. diff --git a/qpdf/qtest/qpdf/show-xref-by-id-filtered.out b/qpdf/qtest/qpdf/show-xref-by-id-filtered.out new file mode 100644 index 0000000..3ecf4ed Binary files /dev/null and b/qpdf/qtest/qpdf/show-xref-by-id-filtered.out differ diff --git a/qpdf/qtest/qpdf/show-xref-by-id.out b/qpdf/qtest/qpdf/show-xref-by-id.out new file mode 100644 index 0000000..025a282 --- /dev/null +++ b/qpdf/qtest/qpdf/show-xref-by-id.out @@ -0,0 +1,2 @@ +Object is stream. Dictionary: +<< /DecodeParms << /Columns 4 /Predictor 12 >> /Encrypt 11 0 R /Filter /FlateDecode /ID [ ] /Info 3 0 R /Length 52 /Root 1 0 R /Size 13 /Type /XRef /W [ 1 2 1 ] >> diff --git a/qpdf/qtest/qpdf/show-xref.out b/qpdf/qtest/qpdf/show-xref.out new file mode 100644 index 0000000..a0bb72d --- /dev/null +++ b/qpdf/qtest/qpdf/show-xref.out @@ -0,0 +1,12 @@ +1/0: uncompressed; offset = 15 +2/0: uncompressed; offset = 64 +3/0: compressed; stream = 2, index = 0 +4/0: compressed; stream = 2, index = 1 +5/0: compressed; stream = 2, index = 2 +6/0: compressed; stream = 2, index = 3 +7/0: uncompressed; offset = 390 +8/0: uncompressed; offset = 521 +9/0: uncompressed; offset = 39802 +10/0: uncompressed; offset = 49559 +11/0: uncompressed; offset = 49672 +12/0: uncompressed; offset = 49880 diff --git a/qpdf/qtest/qpdf/stream-data.pdf b/qpdf/qtest/qpdf/stream-data.pdf new file mode 100644 index 0000000..6110086 --- /dev/null +++ b/qpdf/qtest/qpdf/stream-data.pdf @@ -0,0 +1,112 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /Pages 2 0 R + /QStream 3 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /Count 1 + /Kids [ + 5 0 R + ] + /Type /Pages +>> +endobj + +3 0 obj +<< + /Length 4 0 R + /Filter /ASCIIHexDecode +>> +stream +706F7461746F0A +endstream +endobj + +4 0 obj +15 +endobj + +%% Page 1 +5 0 obj +<< + /Contents 6 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 8 0 R + >> + /ProcSet 9 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +6 0 obj +<< + /Length 7 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +7 0 obj +44 +endobj + +8 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +9 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 10 +0000000000 65535 f +0000000025 00000 n +0000000096 00000 n +0000000168 00000 n +0000000264 00000 n +0000000293 00000 n +0000000508 00000 n +0000000607 00000 n +0000000626 00000 n +0000000744 00000 n +trailer << + /Root 1 0 R + /Size 10 + /ID [<422061d5d2701ad547ece6eb89b05b77><422061d5d2701ad547ece6eb89b05b77>] +>> +startxref +779 +%%EOF diff --git a/qpdf/qtest/qpdf/stream-line-enders.out b/qpdf/qtest/qpdf/stream-line-enders.out new file mode 100644 index 0000000..b7a7513 --- /dev/null +++ b/qpdf/qtest/qpdf/stream-line-enders.out @@ -0,0 +1,3 @@ +WARNING: stream-line-enders.pdf (object 5 0, file position 378): stream keyword followed by carriage return only +WARNING: stream-line-enders.pdf (object 6 0, file position 437): stream keyword not followed by proper line terminator +qpdf: operation succeeded with warnings; resulting file may have some problems diff --git a/qpdf/qtest/qpdf/stream-line-enders.pdf b/qpdf/qtest/qpdf/stream-line-enders.pdf new file mode 100644 index 0000000..e623888 --- /dev/null +++ b/qpdf/qtest/qpdf/stream-line-enders.pdf @@ -0,0 +1,50 @@ +%PDF-1.3 +%¿÷¢þ +1 0 obj +<< /Pages 2 0 R /Type /Catalog >> +endobj +2 0 obj +<< /Count 1 /Kids [ 3 0 R ] /Type /Pages >> +endobj +3 0 obj +<< /Contents [ 4 0 R 5 0 R 6 0 R ] /MediaBox [ 0 0 612 792 ] /Parent 2 0 R /Resources << /Font << /F1 7 0 R >> /ProcSet 8 0 R >> /Type /Page >> +endobj +4 0 obj +<< /Length 14 >> +stream +BT + /F1 24 Tf +endstream +endobj +5 0 obj +<< /Length 10 >> +stream 72 720 Td +endstream +endobj +6 0 obj +<< /Length 15 >> +stream (Potato) Tj +ET +endstream +endobj +7 0 obj +<< /BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font >> +endobj +8 0 obj +[ /PDF /Text ] +endobj +xref +0 9 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000123 00000 n +0000000282 00000 n +0000000346 00000 n +0000000405 00000 n +0000000469 00000 n +0000000576 00000 n +trailer << /Root 1 0 R /Size 9 /ID [<08aa98c73f8a7262d77c8328772c3989><7b1f32865e2165debe277f27ee790092>] >> +startxref +606 +%%EOF diff --git a/qpdf/qtest/qpdf/stream-line-enders.qdf b/qpdf/qtest/qpdf/stream-line-enders.qdf new file mode 100644 index 0000000..3353602 --- /dev/null +++ b/qpdf/qtest/qpdf/stream-line-enders.qdf @@ -0,0 +1,137 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +%% Original object ID: 2 0 +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +%% Original object ID: 3 0 +3 0 obj +<< + /Contents [ + 4 0 R + 6 0 R + 8 0 R + ] + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 10 0 R + >> + /ProcSet 11 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +%% Original object ID: 4 0 +4 0 obj +<< + /Length 5 0 R +>> +stream +BT + /F1 24 Tf +endstream +endobj + +5 0 obj +14 +endobj + +%% Contents for page 1 +%% Original object ID: 5 0 +6 0 obj +<< + /Length 7 0 R +>> +stream +72 720 Td +endstream +endobj + +7 0 obj +10 +endobj + +%% Contents for page 1 +%% Original object ID: 6 0 +8 0 obj +<< + /Length 9 0 R +>> +stream +(Potato) Tj +ET +endstream +endobj + +9 0 obj +15 +endobj + +%% Original object ID: 7 0 +10 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 8 0 +11 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 12 +0000000000 65535 f +0000000052 00000 n +0000000133 00000 n +0000000242 00000 n +0000000516 00000 n +0000000585 00000 n +0000000654 00000 n +0000000719 00000 n +0000000788 00000 n +0000000858 00000 n +0000000904 00000 n +0000001050 00000 n +trailer << + /Root 1 0 R + /Size 12 + /ID [<08aa98c73f8a7262d77c8328772c3989><31415926535897932384626433832795>] +>> +startxref +1086 +%%EOF diff --git a/qpdf/qtest/qpdf/test-32.out b/qpdf/qtest/qpdf/test-32.out new file mode 100644 index 0000000..ff8d922 --- /dev/null +++ b/qpdf/qtest/qpdf/test-32.out @@ -0,0 +1,13 @@ +file: a.pdf +linearized: no +newline: no +file: b.pdf +linearized: yes +newline: no +file: c.pdf +linearized: no +newline: yes +file: d.pdf +linearized: yes +newline: yes +test 32 done diff --git a/qpdf/qtest/qpdf/test11.out b/qpdf/qtest/qpdf/test11.out new file mode 100644 index 0000000..170f6b3 --- /dev/null +++ b/qpdf/qtest/qpdf/test11.out @@ -0,0 +1,3 @@ +filtered stream data okay +raw stream data okay +test 11 done diff --git a/qpdf/qtest/qpdf/test14-in.pdf b/qpdf/qtest/qpdf/test14-in.pdf new file mode 100644 index 0000000..4d76102 --- /dev/null +++ b/qpdf/qtest/qpdf/test14-in.pdf @@ -0,0 +1,264 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /Pages 4 0 R + /Type /Catalog +>> +endobj + +2 0 obj +[ + /Array +] +endobj + +3 0 obj +<< + /Dict 1 +>> +endobj + +4 0 obj +<< + /Count 4 + /Kids [ + 5 0 R + 6 0 R + 7 0 R + 8 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +5 0 obj +<< + /Contents 9 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 11 0 R + >> + /ProcSet 12 0 R + >> + /Type /Page +>> +endobj + +%% Page 2 +6 0 obj +<< + /Contents 13 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 11 0 R + >> + /ProcSet 15 0 R + >> + /Type /Page +>> +endobj + +%% Page 3 +7 0 obj +<< + /Contents 16 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 11 0 R + >> + /ProcSet 18 0 R + >> + /Type /Page +>> +endobj + +%% Page 4 +8 0 obj +<< + /Contents 19 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 11 0 R + >> + /ProcSet 21 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +9 0 obj +<< + /Length 10 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 1) Tj +ET +endstream +endobj + +10 0 obj +46 +endobj + +11 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +12 0 obj +[ + /PDF + /Text +] +endobj + +%% Contents for page 2 +13 0 obj +<< + /Length 14 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 2) Tj +ET +endstream +endobj + +14 0 obj +46 +endobj + +15 0 obj +[ + /PDF + /Text +] +endobj + +%% Contents for page 3 +16 0 obj +<< + /Length 17 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 3) Tj +ET +endstream +endobj + +17 0 obj +46 +endobj + +18 0 obj +[ + /PDF + /Text +] +endobj + +%% Contents for page 4 +19 0 obj +<< + /Length 20 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 4) Tj +ET +endstream +endobj + +20 0 obj +46 +endobj + +21 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 22 +0000000000 65535 f +0000000025 00000 n +0000000079 00000 n +0000000108 00000 n +0000000140 00000 n +0000000252 00000 n +0000000456 00000 n +0000000661 00000 n +0000000866 00000 n +0000001084 00000 n +0000001186 00000 n +0000001206 00000 n +0000001325 00000 n +0000001384 00000 n +0000001487 00000 n +0000001507 00000 n +0000001566 00000 n +0000001669 00000 n +0000001689 00000 n +0000001748 00000 n +0000001851 00000 n +0000001871 00000 n +trailer << + /QArray 2 0 R + /QDict 3 0 R + /Root 1 0 R + /Size 22 + /ID [<20eb74876a3e8212c1b4fd43153860b0><1bb7a926da191c58f675435d77997d21>] +>> +startxref +1907 +%%EOF diff --git a/qpdf/qtest/qpdf/test14-out.pdf b/qpdf/qtest/qpdf/test14-out.pdf new file mode 100644 index 0000000..315d174 --- /dev/null +++ b/qpdf/qtest/qpdf/test14-out.pdf @@ -0,0 +1,105 @@ +%PDF-1.3 +%¿÷¢þ +1 0 obj +<< /Pages 4 0 R /Type /Catalog >> +endobj +2 0 obj +<< /NewDict 2 >> +endobj +3 0 obj +[ /Array ] +endobj +4 0 obj +<< /Count 4 /Kids [ 5 0 R 6 0 R 7 0 R 8 0 R ] /Type /Pages >> +endobj +5 0 obj +<< /Contents 9 0 R /MediaBox [ 0 0 612 792 ] /Parent 4 0 R /Resources << /Font << /F1 10 0 R >> /ProcSet 11 0 R >> /Type /Page >> +endobj +6 0 obj +<< /Contents 12 0 R /MediaBox [ 0 0 612 792 ] /Parent 4 0 R /Resources << /Font << /F1 10 0 R >> /ProcSet 13 0 R >> /Type /Page >> +endobj +7 0 obj +<< /Contents 14 0 R /MediaBox [ 0 0 612 792 ] /Parent 4 0 R /Resources << /Font << /F1 10 0 R >> /ProcSet 15 0 R >> /Type /Page >> +endobj +8 0 obj +<< /Contents 16 0 R /MediaBox [ 0 0 612 792 ] /Parent 4 0 R /Resources << /Font << /F1 10 0 R >> /ProcSet 17 0 R >> /Type /Page >> +endobj +9 0 obj +<< /Length 46 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 1) Tj +ET +endstream +endobj +10 0 obj +<< /BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font >> +endobj +11 0 obj +[ /PDF /Text ] +endobj +12 0 obj +<< /Length 46 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 3) Tj +ET +endstream +endobj +13 0 obj +[ /PDF /Text ] +endobj +14 0 obj +<< /Length 46 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 2) Tj +ET +endstream +endobj +15 0 obj +[ /PDF /Text ] +endobj +16 0 obj +<< /Length 46 >> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato 4) Tj +ET +endstream +endobj +17 0 obj +[ /PDF /Text ] +endobj +xref +0 18 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000096 00000 n +0000000122 00000 n +0000000199 00000 n +0000000344 00000 n +0000000490 00000 n +0000000636 00000 n +0000000782 00000 n +0000000877 00000 n +0000000985 00000 n +0000001016 00000 n +0000001112 00000 n +0000001143 00000 n +0000001239 00000 n +0000001270 00000 n +0000001366 00000 n +trailer << /QArray 2 0 R /QDict 3 0 R /Root 1 0 R /Size 18 /ID [<20eb74876a3e8212c1b4fd43153860b0><31415926535897932384626433832795>] >> +startxref +1397 +%%EOF diff --git a/qpdf/qtest/qpdf/test14.out b/qpdf/qtest/qpdf/test14.out new file mode 100644 index 0000000..65b640b --- /dev/null +++ b/qpdf/qtest/qpdf/test14.out @@ -0,0 +1,7 @@ +caught logic error as expected +old dict: 1 +old dict: 1 +new dict: 2 +swapped array: /Array +array and dictionary contents are correct +test 14 done diff --git a/qpdf/qtest/qpdf/test4-1.pdf b/qpdf/qtest/qpdf/test4-1.pdf new file mode 100644 index 0000000..9f4f980 --- /dev/null +++ b/qpdf/qtest/qpdf/test4-1.pdf @@ -0,0 +1,126 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +3 0 obj +<< + /Contents 4 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 6 0 R + >> + /ProcSet 7 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +4 0 obj +<< + /Length 5 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +44 +endobj + +6 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +7 0 obj +[ + /PDF + /Text +] +endobj + +8 0 obj +<< + /Title 9 0 R + /Subject 10 0 R + /A 11 0 R + /B 12 0 R +>> +endobj + +9 0 obj +(Some Title Is Here) +endobj + +10 0 obj +(Subject) +endobj + +11 0 obj +[ 1 2 3 ] +endobj + +12 0 obj +<< /A 11 0 R /B (B) >> +endobj + +xref +0 13 +0000000000 65535 f +0000000025 00000 n +0000000079 00000 n +0000000161 00000 n +0000000376 00000 n +0000000475 00000 n +0000000494 00000 n +0000000612 00000 n +0000000647 00000 n +0000000726 00000 n +0000000763 00000 n +0000000790 00000 n +0000000817 00000 n +trailer << + /Root 1 0 R + /Size 13 + /QTest 8 0 R + /ID [] +>> +startxref +857 +%%EOF diff --git a/qpdf/qtest/qpdf/test4-1.qdf b/qpdf/qtest/qpdf/test4-1.qdf new file mode 100644 index 0000000..b22fd6f --- /dev/null +++ b/qpdf/qtest/qpdf/test4-1.qdf @@ -0,0 +1,158 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /Pages 4 0 R + /Type /Catalog +>> +endobj + +%% Original object ID: 13 0 +2 0 obj +<< + /A [ + 9 + 1 + 5 + 10 + 12 + 6 + ] + /Author (Mr. Potato Head) + /B << + /A [ + 1 + 2 + 3 + ] + /B (B) + >> + /Title (Some Title Is Here) +>> +endobj + +%% Original object ID: 8 0 +3 0 obj +<< + /A 5 0 R + /B 6 0 R + /Subject (Subject) + /Title (Some Title Is Here) +>> +endobj + +%% Original object ID: 2 0 +4 0 obj +<< + /Count 1 + /Kids [ + 7 0 R + ] + /Type /Pages +>> +endobj + +%% Original object ID: 11 0 +5 0 obj +[ + 1 + 2 + 3 +] +endobj + +%% Original object ID: 12 0 +6 0 obj +<< + /A 5 0 R + /B (B) +>> +endobj + +%% Page 1 +%% Original object ID: 3 0 +7 0 obj +<< + /Contents 8 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 10 0 R + >> + /ProcSet 11 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +%% Original object ID: 4 0 +8 0 obj +<< + /Length 9 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +9 0 obj +44 +endobj + +%% Original object ID: 6 0 +10 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 7 0 +11 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 12 +0000000000 65535 f +0000000052 00000 n +0000000134 00000 n +0000000353 00000 n +0000000475 00000 n +0000000575 00000 n +0000000635 00000 n +0000000714 00000 n +0000000958 00000 n +0000001057 00000 n +0000001103 00000 n +0000001249 00000 n +trailer << + /Info 2 0 R + /QTest 3 0 R + /Root 1 0 R + /Size 12 + /ID [<31415926535897932384626433832795>] +>> +startxref +1285 +%%EOF diff --git a/qpdf/qtest/qpdf/test4-2.out b/qpdf/qtest/qpdf/test4-2.out new file mode 100644 index 0000000..e5e5176 --- /dev/null +++ b/qpdf/qtest/qpdf/test4-2.out @@ -0,0 +1 @@ +attempt to make a stream into a direct object diff --git a/qpdf/qtest/qpdf/test4-2.pdf b/qpdf/qtest/qpdf/test4-2.pdf new file mode 100644 index 0000000..0acf592 --- /dev/null +++ b/qpdf/qtest/qpdf/test4-2.pdf @@ -0,0 +1,104 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +3 0 obj +<< + /Contents 4 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 6 0 R + >> + /ProcSet 7 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +4 0 obj +<< + /Length 5 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +44 +endobj + +6 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +7 0 obj +[ + /PDF + /Text +] +endobj + +8 0 obj +<< + % stream + /A 4 0 R +>> +endobj + +xref +0 9 +0000000000 65535 f +0000000025 00000 n +0000000079 00000 n +0000000161 00000 n +0000000376 00000 n +0000000475 00000 n +0000000494 00000 n +0000000612 00000 n +0000000647 00000 n +trailer << + /Root 1 0 R + /Size 9 + /QTest 8 0 R + /ID [] +>> +startxref +691 +%%EOF diff --git a/qpdf/qtest/qpdf/test4-3.out b/qpdf/qtest/qpdf/test4-3.out new file mode 100644 index 0000000..b0deab1 --- /dev/null +++ b/qpdf/qtest/qpdf/test4-3.out @@ -0,0 +1 @@ +loop detected while converting object from indirect to direct diff --git a/qpdf/qtest/qpdf/test4-3.pdf b/qpdf/qtest/qpdf/test4-3.pdf new file mode 100644 index 0000000..6e21261 --- /dev/null +++ b/qpdf/qtest/qpdf/test4-3.pdf @@ -0,0 +1,109 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +3 0 obj +<< + /Contents 4 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 6 0 R + >> + /ProcSet 7 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +4 0 obj +<< + /Length 5 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +44 +endobj + +6 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +7 0 obj +[ + /PDF + /Text +] +endobj + +8 0 obj +<< + % loop + /A [ 1 2 9 0 R ] +>> +endobj + +9 0 obj +[ 4 5 8 0 R ] +endobj + +xref +0 10 +0000000000 65535 f +0000000025 00000 n +0000000079 00000 n +0000000161 00000 n +0000000376 00000 n +0000000475 00000 n +0000000494 00000 n +0000000612 00000 n +0000000647 00000 n +0000000699 00000 n +trailer << + /Root 1 0 R + /Size 10 + /QTest 8 0 R + /ID [] +>> +startxref +730 +%%EOF diff --git a/qpdf/qtest/qpdf/test4-4.pdf b/qpdf/qtest/qpdf/test4-4.pdf new file mode 100644 index 0000000..5b91020 --- /dev/null +++ b/qpdf/qtest/qpdf/test4-4.pdf @@ -0,0 +1,123 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +1 0 obj +<< + /Pages 3 0 R + /Type /Catalog +>> +endobj + +2 0 obj +<< + /A 4 0 R + /B 5 0 R + /Subject (Subject) + /Title (Some Title Is Here) +>> +endobj + +3 0 obj +<< + /Count 1 + /Kids [ + 6 0 R + ] + /Type /Pages +>> +endobj + +4 0 obj +[ + 100 + 2 + 3 +] +endobj + +5 0 obj +<< + /A 4 0 R + /B (B) +>> +endobj + +%% Page 1 +6 0 obj +<< + /Contents 7 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 3 0 R + /Resources << + /Font << + /F1 9 0 R + >> + /ProcSet 10 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +7 0 obj +<< + /Length 8 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +8 0 obj +44 +endobj + +9 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +10 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 11 +0000000000 65535 f +0000000025 00000 n +0000000079 00000 n +0000000174 00000 n +0000000246 00000 n +0000000280 00000 n +0000000332 00000 n +0000000548 00000 n +0000000647 00000 n +0000000666 00000 n +0000000784 00000 n +trailer << + /QTest 2 0 R + /Root 1 0 R + /Size 11 + /ID [] +>> +startxref +820 +%%EOF diff --git a/qpdf/qtest/qpdf/test4-4.qdf b/qpdf/qtest/qpdf/test4-4.qdf new file mode 100644 index 0000000..930bf43 --- /dev/null +++ b/qpdf/qtest/qpdf/test4-4.qdf @@ -0,0 +1,155 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /Pages 4 0 R + /Type /Catalog +>> +endobj + +%% Original object ID: 11 0 +2 0 obj +<< + /A [ + 14 + 15 + 9 + ] + /Author (Mr. Potato Head) + /B << + /A [ + 100 + 2 + 3 + ] + /B (B) + >> + /Title (Some Title Is Here) +>> +endobj + +%% Original object ID: 2 0 +3 0 obj +<< + /A 5 0 R + /B 6 0 R + /Subject (Subject) + /Title (Some Title Is Here) +>> +endobj + +%% Original object ID: 3 0 +4 0 obj +<< + /Count 1 + /Kids [ + 7 0 R + ] + /Type /Pages +>> +endobj + +%% Original object ID: 4 0 +5 0 obj +[ + 100 + 2 + 3 +] +endobj + +%% Original object ID: 5 0 +6 0 obj +<< + /A 5 0 R + /B (B) +>> +endobj + +%% Page 1 +%% Original object ID: 6 0 +7 0 obj +<< + /Contents 8 0 R + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 4 0 R + /Resources << + /Font << + /F1 10 0 R + >> + /ProcSet 11 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +%% Original object ID: 7 0 +8 0 obj +<< + /Length 9 0 R +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +9 0 obj +44 +endobj + +%% Original object ID: 9 0 +10 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 10 0 +11 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 12 +0000000000 65535 f +0000000052 00000 n +0000000134 00000 n +0000000337 00000 n +0000000459 00000 n +0000000558 00000 n +0000000619 00000 n +0000000698 00000 n +0000000942 00000 n +0000001041 00000 n +0000001087 00000 n +0000001234 00000 n +trailer << + /Info 2 0 R + /QTest 3 0 R + /Root 1 0 R + /Size 12 + /ID [<31415926535897932384626433832795>] +>> +startxref +1270 +%%EOF diff --git a/qpdf/qtest/qpdf/test8.out b/qpdf/qtest/qpdf/test8.out new file mode 100644 index 0000000..0311b38 --- /dev/null +++ b/qpdf/qtest/qpdf/test8.out @@ -0,0 +1,2 @@ +exception: stream data provider for 7 0 provided 29 bytes instead of expected 28 bytes +test 8 done diff --git a/qpdf/qtest/qpdf/test9.out b/qpdf/qtest/qpdf/test9.out new file mode 100644 index 0000000..3489ba0 --- /dev/null +++ b/qpdf/qtest/qpdf/test9.out @@ -0,0 +1,2 @@ +exception: pipeStreamData called for stream with no data +test 9 done diff --git a/qpdf/qtest/qpdf/unreferenced-indirect-scalar.out b/qpdf/qtest/qpdf/unreferenced-indirect-scalar.out new file mode 100644 index 0000000..c1bf4a9 Binary files /dev/null and b/qpdf/qtest/qpdf/unreferenced-indirect-scalar.out differ diff --git a/qpdf/qtest/qpdf/unreferenced-indirect-scalar.pdf b/qpdf/qtest/qpdf/unreferenced-indirect-scalar.pdf new file mode 100644 index 0000000..e1be631 Binary files /dev/null and b/qpdf/qtest/qpdf/unreferenced-indirect-scalar.pdf differ diff --git a/qpdf/qtest/qpdf/xref-with-short-size-new.out b/qpdf/qtest/qpdf/xref-with-short-size-new.out new file mode 100644 index 0000000..9396e6c --- /dev/null +++ b/qpdf/qtest/qpdf/xref-with-short-size-new.out @@ -0,0 +1,13 @@ +1/0: uncompressed; offset = 15 +2/0: compressed; stream = 1, index = 0 +3/0: compressed; stream = 1, index = 1 +4/0: compressed; stream = 1, index = 2 +5/0: compressed; stream = 1, index = 3 +6/0: compressed; stream = 1, index = 4 +7/0: compressed; stream = 1, index = 5 +8/0: compressed; stream = 1, index = 6 +9/0: compressed; stream = 1, index = 7 +10/0: compressed; stream = 1, index = 8 +11/0: uncompressed; offset = 674 +12/0: uncompressed; offset = 801 +13/0: uncompressed; offset = 16194 diff --git a/qpdf/qtest/qpdf/xref-with-short-size-recover.out b/qpdf/qtest/qpdf/xref-with-short-size-recover.out new file mode 100644 index 0000000..b57333b --- /dev/null +++ b/qpdf/qtest/qpdf/xref-with-short-size-recover.out @@ -0,0 +1,2 @@ +WARNING: xref-with-short-size.pdf (xref stream, file position 16227): Cross-reference stream data has the wrong size; expected = 52; actual = 56 +qpdf: operation succeeded with warnings; resulting file may have some problems diff --git a/qpdf/qtest/qpdf/xref-with-short-size.out b/qpdf/qtest/qpdf/xref-with-short-size.out new file mode 100644 index 0000000..12f20e6 --- /dev/null +++ b/qpdf/qtest/qpdf/xref-with-short-size.out @@ -0,0 +1,14 @@ +WARNING: xref-with-short-size.pdf (xref stream, file position 16227): Cross-reference stream data has the wrong size; expected = 52; actual = 56 +1/0: compressed; stream = 5, index = 1 +2/0: compressed; stream = 5, index = 0 +3/0: uncompressed; offset = 15 +4/0: compressed; stream = 5, index = 5 +5/0: uncompressed; offset = 15548 +6/0: compressed; stream = 5, index = 6 +7/0: compressed; stream = 5, index = 4 +8/0: compressed; stream = 5, index = 2 +9/0: uncompressed; offset = 150 +10/0: compressed; stream = 5, index = 3 +11/0: compressed; stream = 5, index = 7 +12/0: compressed; stream = 5, index = 8 +qpdf: operation succeeded with warnings; resulting file may have some problems diff --git a/qpdf/qtest/qpdf/xref-with-short-size.pdf b/qpdf/qtest/qpdf/xref-with-short-size.pdf new file mode 100644 index 0000000..3ef4dcd Binary files /dev/null and b/qpdf/qtest/qpdf/xref-with-short-size.pdf differ diff --git a/qpdf/test_driver.cc b/qpdf/test_driver.cc new file mode 100644 index 0000000..311097f --- /dev/null +++ b/qpdf/test_driver.cc @@ -0,0 +1,1164 @@ +// This program tests miscellaneous functionality in the qpdf library +// that we don't want to pollute the qpdf program with. + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static char const* whoami = 0; + +void usage() +{ + std::cerr << "Usage: " << whoami << " n filename1 [filename2]" + << std::endl; + exit(2); +} + +class Provider: public QPDFObjectHandle::StreamDataProvider +{ + public: + Provider(PointerHolder b) : + b(b), + bad_length(false) + { + } + virtual ~Provider() + { + } + virtual void provideStreamData(int objid, int generation, + Pipeline* p) + { + p->write(b->getBuffer(), b->getSize()); + if (this->bad_length) + { + unsigned char ch = ' '; + p->write(&ch, 1); + } + p->finish(); + } + void badLength(bool v) + { + this->bad_length = v; + } + + private: + PointerHolder b; + bool bad_length; +}; + +static std::string getPageContents(QPDFObjectHandle page) +{ + PointerHolder b1 = + page.getKey("/Contents").getStreamData(); + return std::string((char *)(b1->getBuffer()), b1->getSize()) + "\0"; +} + +static void checkPageContents(QPDFObjectHandle page, + std::string const& wanted_string) +{ + std::string contents = getPageContents(page); + if (contents.find(wanted_string) == std::string::npos) + { + std::cout << "didn't find " << wanted_string << " in " + << contents << std::endl; + } +} + +static QPDFObjectHandle createPageContents(QPDF& pdf, std::string const& text) +{ + std::string contents = "BT /F1 15 Tf 72 720 Td (" + text + ") Tj ET\n"; + return QPDFObjectHandle::newStream(&pdf, contents); +} + +void runtest(int n, char const* filename1, char const* filename2) +{ + // Most tests here are crafted to work on specific files. Look at + // the test suite to see how the test is invoked to find the file + // that the test is supposed to operate on. + + QPDF pdf; + PointerHolder file_buf; + FILE* filep = 0; + if (n == 0) + { + pdf.setAttemptRecovery(false); + } + if (n % 2 == 0) + { + if (n % 4 == 0) + { + QTC::TC("qpdf", "exercise processFile(name)"); + pdf.processFile(filename1); + } + else + { + QTC::TC("qpdf", "exercise processFile(FILE*)"); + filep = QUtil::fopen_wrapper(std::string("open ") + filename1, + fopen(filename1, "rb")); + pdf.processFile(filename1, filep, false); + } + } + else + { + QTC::TC("qpdf", "exercise processMemoryFile"); + FILE* f = QUtil::fopen_wrapper(std::string("open ") + filename1, + fopen(filename1, "rb")); + fseek(f, 0, SEEK_END); + size_t size = (size_t) QUtil::tell(f); + fseek(f, 0, SEEK_SET); + file_buf = PointerHolder(true, new char[size]); + char* buf_p = file_buf.getPointer(); + size_t bytes_read = 0; + size_t len = 0; + while ((len = fread(buf_p + bytes_read, 1, size - bytes_read, f)) > 0) + { + bytes_read += len; + } + if (bytes_read != size) + { + if (ferror(f)) + { + throw std::runtime_error( + std::string("failure reading file ") + filename1 + + " into memory: read " + + QUtil::int_to_string(bytes_read) + "; wanted " + + QUtil::int_to_string(size)); + } + else + { + throw std::logic_error( + std::string("premature eof reading file ") + filename1 + + " into memory: read " + + QUtil::int_to_string(bytes_read) + "; wanted " + + QUtil::int_to_string(size)); + } + } + fclose(f); + pdf.processMemoryFile(filename1, buf_p, size); + } + + if ((n == 0) || (n == 1)) + { + QPDFObjectHandle trailer = pdf.getTrailer(); + QPDFObjectHandle qtest = trailer.getKey("/QTest"); + + if (! trailer.hasKey("/QTest")) + { + // This will always happen when /QTest is null because + // hasKey returns false for null keys regardless of + // whether the key exists or not. That way there's never + // any difference between a key that is present and null + // and a key that is absent. + QTC::TC("qpdf", "main QTest implicit"); + std::cout << "/QTest is implicit" << std::endl; + } + + QTC::TC("qpdf", "main QTest indirect", + qtest.isIndirect() ? 1 : 0); + std::cout << "/QTest is " + << (qtest.isIndirect() ? "in" : "") + << "direct" << std::endl; + + if (qtest.isNull()) + { + QTC::TC("qpdf", "main QTest null"); + std::cout << "/QTest is null" << std::endl; + } + else if (qtest.isBool()) + { + QTC::TC("qpdf", "main QTest bool", + qtest.getBoolValue() ? 1 : 0); + std::cout << "/QTest is Boolean with value " + << (qtest.getBoolValue() ? "true" : "false") + << std::endl; + } + else if (qtest.isInteger()) + { + QTC::TC("qpdf", "main QTest int"); + std::cout << "/QTest is an integer with value " + << qtest.getIntValue() << std::endl; + } + else if (qtest.isReal()) + { + QTC::TC("qpdf", "main QTest real"); + std::cout << "/QTest is a real number with value " + << qtest.getRealValue() << std::endl; + } + else if (qtest.isName()) + { + QTC::TC("qpdf", "main QTest name"); + std::cout << "/QTest is a name with value " + << qtest.getName() << std::endl; + } + else if (qtest.isString()) + { + QTC::TC("qpdf", "main QTest string"); + std::cout << "/QTest is a string with value " + << qtest.getStringValue() << std::endl; + } + else if (qtest.isArray()) + { + QTC::TC("qpdf", "main QTest array"); + int n = qtest.getArrayNItems(); + std::cout << "/QTest is an array with " + << n << " items" << std::endl; + for (int i = 0; i < n; ++i) + { + QTC::TC("qpdf", "main QTest array indirect", + qtest.getArrayItem(i).isIndirect() ? 1 : 0); + std::cout << " item " << i << " is " + << (qtest.getArrayItem(i).isIndirect() ? "in" : "") + << "direct" << std::endl; + } + } + else if (qtest.isDictionary()) + { + QTC::TC("qpdf", "main QTest dictionary"); + std::cout << "/QTest is a dictionary" << std::endl; + std::set keys = qtest.getKeys(); + for (std::set::iterator iter = keys.begin(); + iter != keys.end(); ++iter) + { + QTC::TC("qpdf", "main QTest dictionary indirect", + (qtest.getKey(*iter).isIndirect() ? 1 : 0)); + std::cout << " " << *iter << " is " + << (qtest.getKey(*iter).isIndirect() ? "in" : "") + << "direct" << std::endl; + } + } + else if (qtest.isStream()) + { + QTC::TC("qpdf", "main QTest stream"); + std::cout << "/QTest is a stream. Dictionary: " + << qtest.getDict().unparse() << std::endl; + + std::cout << "Raw stream data:" << std::endl; + std::cout.flush(); + QUtil::binary_stdout(); + PointerHolder out = new Pl_StdioFile("raw", stdout); + qtest.pipeStreamData(out.getPointer(), false, false, false); + + std::cout << std::endl << "Uncompressed stream data:" << std::endl; + if (qtest.pipeStreamData(0, true, false, false)) + { + std::cout.flush(); + QUtil::binary_stdout(); + out = new Pl_StdioFile("filtered", stdout); + qtest.pipeStreamData(out.getPointer(), true, false, false); + std::cout << std::endl << "End of stream data" << std::endl; + } + else + { + std::cout << "Stream data is not filterable." << std::endl; + } + } + else + { + // Should not happen! + std::cout << "/QTest is an unknown object" << std::endl; + } + + std::cout << "unparse: " << qtest.unparse() << std::endl + << "unparseResolved: " << qtest.unparseResolved() + << std::endl; + } + else if (n == 2) + { + // Encrypted file. This test case is designed for a specific + // PDF file. + + QPDFObjectHandle trailer = pdf.getTrailer(); + std::cout << trailer.getKey("/Info"). + getKey("/CreationDate").getStringValue() << std::endl; + std::cout << trailer.getKey("/Info"). + getKey("/Producer").getStringValue() << std::endl; + + QPDFObjectHandle encrypt = trailer.getKey("/Encrypt"); + std::cout << encrypt.getKey("/O").unparse() << std::endl; + std::cout << encrypt.getKey("/U").unparse() << std::endl; + + QPDFObjectHandle root = pdf.getRoot(); + QPDFObjectHandle pages = root.getKey("/Pages"); + QPDFObjectHandle kids = pages.getKey("/Kids"); + QPDFObjectHandle page = kids.getArrayItem(1); // second page + QPDFObjectHandle contents = page.getKey("/Contents"); + QUtil::binary_stdout(); + PointerHolder out = new Pl_StdioFile("filtered", stdout); + contents.pipeStreamData(out.getPointer(), true, false, false); + } + else if (n == 3) + { + QPDFObjectHandle streams = pdf.getTrailer().getKey("/QStreams"); + for (int i = 0; i < streams.getArrayNItems(); ++i) + { + QPDFObjectHandle stream = streams.getArrayItem(i); + std::cout << "-- stream " << i << " --" << std::endl; + std::cout.flush(); + QUtil::binary_stdout(); + PointerHolder out = + new Pl_StdioFile("tokenized stream", stdout); + stream.pipeStreamData(out.getPointer(), true, true, false); + } + } + else if (n == 4) + { + // Mutability testing: Make /QTest direct recursively, then + // copy to /Info. Also make some other mutations so we can + // tell the difference and ensure that the original /QTest + // isn't effected. + QPDFObjectHandle trailer = pdf.getTrailer(); + QPDFObjectHandle qtest = trailer.getKey("/QTest"); + qtest.makeDirect(); + qtest.removeKey("/Subject"); + qtest.replaceKey("/Author", + QPDFObjectHandle::newString("Mr. Potato Head")); + // qtest.A and qtest.B.A were originally the same object. + // They no longer are after makeDirect(). Mutate one of them + // and ensure the other is not changed. These test cases are + // crafted around a specific set of input files. + QPDFObjectHandle A = qtest.getKey("/A"); + if (A.getArrayItem(0).getIntValue() == 1) + { + // Test mutators + A.setArrayItem(1, QPDFObjectHandle::newInteger(5)); // 1 5 3 + A.insertItem(2, QPDFObjectHandle::newInteger(10)); // 1 5 10 3 + A.appendItem(QPDFObjectHandle::newInteger(12)); // 1 5 10 3 12 + A.eraseItem(3); // 1 5 10 12 + A.insertItem(4, QPDFObjectHandle::newInteger(6)); // 1 5 10 12 6 + A.insertItem(0, QPDFObjectHandle::newInteger(9)); // 9 1 5 10 12 6 + } + else + { + std::vector items; + items.push_back(QPDFObjectHandle::newInteger(14)); + items.push_back(QPDFObjectHandle::newInteger(15)); + items.push_back(QPDFObjectHandle::newInteger(9)); + A.setArrayFromVector(items); + } + + trailer.replaceKey("/Info", pdf.makeIndirectObject(qtest)); + QPDFWriter w(pdf, 0); + w.setQDFMode(true); + w.setStaticID(true); + w.write(); + + // Prevent "done" message from getting appended + exit(0); + } + else if (n == 5) + { + std::vector pages = pdf.getAllPages(); + int pageno = 0; + for (std::vector::iterator iter = pages.begin(); + iter != pages.end(); ++iter) + { + QPDFObjectHandle& page = *iter; + ++pageno; + + std::cout << "page " << pageno << ":" << std::endl; + + std::cout << " images:" << std::endl; + std::map images = + page.getPageImages(); + for (std::map::iterator iter = + images.begin(); iter != images.end(); ++iter) + { + std::string const& name = (*iter).first; + QPDFObjectHandle image = (*iter).second; + QPDFObjectHandle dict = image.getDict(); + int width = dict.getKey("/Width").getIntValue(); + int height = dict.getKey("/Height").getIntValue(); + std::cout << " " << name + << ": " << width << " x " << height + << std::endl; + } + + std::cout << " content:" << std::endl; + std::vector content = page.getPageContents(); + for (std::vector::iterator iter = content.begin(); + iter != content.end(); ++iter) + { + std::cout << " " << (*iter).unparse() << std::endl; + } + + std::cout << "end page " << pageno << std::endl; + } + + QPDFObjectHandle root = pdf.getRoot(); + QPDFObjectHandle qstrings = root.getKey("/QStrings"); + if (qstrings.isArray()) + { + std::cout << "QStrings:" << std::endl; + int n = qstrings.getArrayNItems(); + for (int i = 0; i < n; ++i) + { + std::cout << qstrings.getArrayItem(i).getUTF8Value() + << std::endl; + } + } + + QPDFObjectHandle qnumbers = root.getKey("/QNumbers"); + if (qnumbers.isArray()) + { + std::cout << "QNumbers:" << std::endl; + int n = qnumbers.getArrayNItems(); + for (int i = 0; i < n; ++i) + { + std::cout << QUtil::double_to_string( + qnumbers.getArrayItem(i).getNumericValue(), 3) + << std::endl; + } + } + } + else if (n == 6) + { + QPDFObjectHandle root = pdf.getRoot(); + QPDFObjectHandle metadata = root.getKey("/Metadata"); + if (! metadata.isStream()) + { + throw std::logic_error("test 6 run on file with no metadata"); + } + Pl_Buffer bufpl("buffer"); + metadata.pipeStreamData(&bufpl, false, false, false); + Buffer* buf = bufpl.getBuffer(); + unsigned char const* data = buf->getBuffer(); + bool cleartext = false; + if ((buf->getSize() > 9) && + (strncmp((char const*)data, " b = p1.getBuffer(); + // This is a bogus way to use StreamDataProvider, but it does + // adequately test its functionality. + Provider* provider = new Provider(b); + PointerHolder p = provider; + qstream.replaceStreamData( + p, QPDFObjectHandle::newName("/FlateDecode"), + QPDFObjectHandle::newNull()); + provider->badLength(false); + QPDFWriter w(pdf, "a.pdf"); + w.setStaticID(true); + // Linearize to force the provider to be called multiple times. + w.setLinearization(true); + w.setStreamDataMode(qpdf_s_preserve); + w.write(); + + // Every time a provider pipes stream data, it has to provide + // the same amount of data. + provider->badLength(true); + try + { + qstream.getStreamData(); + std::cout << "oops -- getStreamData didn't throw" << std::endl; + } + catch (std::logic_error const& e) + { + std::cout << "exception: " << e.what() << std::endl; + } + } + else if (n == 9) + { + QPDFObjectHandle root = pdf.getRoot(); + // Explicitly exercise the Buffer version of newStream + PointerHolder buf = new Buffer(20); + unsigned char* bp = buf->getBuffer(); + memcpy(bp, (char*)"data for new stream\n", 20); // no null! + QPDFObjectHandle qstream = QPDFObjectHandle::newStream( + &pdf, buf); + QPDFObjectHandle rstream = QPDFObjectHandle::newStream(&pdf); + try + { + rstream.getStreamData(); + std::cout << "oops -- getStreamData didn't throw" << std::endl; + } + catch (std::logic_error const& e) + { + std::cout << "exception: " << e.what() << std::endl; + } + rstream.replaceStreamData( + "data for other stream\n", + QPDFObjectHandle::newNull(), QPDFObjectHandle::newNull()); + root.replaceKey("/QStream", qstream); + root.replaceKey("/RStream", rstream); + QPDFWriter w(pdf, "a.pdf"); + w.setStaticID(true); + w.setStreamDataMode(qpdf_s_preserve); + w.write(); + } + else if (n == 10) + { + std::vector pages = pdf.getAllPages(); + pages[0].addPageContents( + QPDFObjectHandle::newStream( + &pdf, "BT /F1 12 Tf 72 620 Td (Baked) Tj ET\n"), true); + pages[0].addPageContents( + QPDFObjectHandle::newStream( + &pdf, "BT /F1 18 Tf 72 520 Td (Mashed) Tj ET\n"), false); + + QPDFWriter w(pdf, "a.pdf"); + w.setStaticID(true); + w.setStreamDataMode(qpdf_s_preserve); + w.write(); + } + else if (n == 11) + { + QPDFObjectHandle root = pdf.getRoot(); + QPDFObjectHandle qstream = root.getKey("/QStream"); + PointerHolder b1 = qstream.getStreamData(); + PointerHolder b2 = qstream.getRawStreamData(); + if ((b1->getSize() == 7) && + (memcmp(b1->getBuffer(), "potato\n", 7) == 0)) + { + std::cout << "filtered stream data okay" << std::endl; + } + if ((b2->getSize() == 15) && + (memcmp(b2->getBuffer(), "706F7461746F0A\n", 15) == 0)) + { + std::cout << "raw stream data okay" << std::endl; + } + } + else if (n == 12) + { + pdf.setOutputStreams(0, 0); + pdf.showLinearizationData(); + } + else if (n == 13) + { + std::ostringstream out; + std::ostringstream err; + pdf.setOutputStreams(&out, &err); + pdf.showLinearizationData(); + std::cout << "---output---" << std::endl + << out.str() + << "---error---" << std::endl + << err.str(); + } + else if (n == 14) + { + // Exercise swap and replace. This test case is designed for + // a specific file. + std::vector pages = pdf.getAllPages(); + if (pages.size() != 4) + { + throw std::logic_error("test " + QUtil::int_to_string(n) + + " not called 4-page file"); + } + // Swap pages 2 and 3 + pdf.swapObjects(pages[1].getObjectID(), pages[1].getGeneration(), + pages[2].getObjectID(), pages[2].getGeneration()); + // Replace object and swap objects + QPDFObjectHandle trailer = pdf.getTrailer(); + QPDFObjectHandle qdict = trailer.getKey("/QDict"); + QPDFObjectHandle qarray = trailer.getKey("/QArray"); + // Force qdict but not qarray to resolve + qdict.isDictionary(); + QPDFObjectHandle new_dict = QPDFObjectHandle::newDictionary(); + new_dict.replaceKey("/NewDict", QPDFObjectHandle::newInteger(2)); + try + { + // Do it wrong first... + pdf.replaceObject(qdict.getObjectID(), qdict.getGeneration(), + qdict); + } + catch (std::logic_error) + { + std::cout << "caught logic error as expected" << std::endl; + } + pdf.replaceObject(qdict.getObjectID(), qdict.getGeneration(), + new_dict); + // Now qdict still points to the old dictionary + std::cout << "old dict: " << qdict.getKey("/Dict").getIntValue() + << std::endl; + // Swap dict and array + pdf.swapObjects(qdict.getObjectID(), qdict.getGeneration(), + qarray.getObjectID(), qarray.getGeneration()); + // Now qarray will resolve to new object but qdict is still + // the old object + std::cout << "old dict: " << qdict.getKey("/Dict").getIntValue() + << std::endl; + std::cout << "new dict: " << qarray.getKey("/NewDict").getIntValue() + << std::endl; + // Reread qdict, now pointing to an array + qdict = pdf.getObjectByID(qdict.getObjectID(), qdict.getGeneration()); + std::cout << "swapped array: " << qdict.getArrayItem(0).getName() + << std::endl; + + // Exercise getAsMap and getAsArray + std::vector array_elements = + qdict.getArrayAsVector(); + std::map dict_items = + qarray.getDictAsMap(); + if ((array_elements.size() == 1) && + (array_elements[0].getName() == "/Array") && + (dict_items.size() == 1) && + (dict_items["/NewDict"].getIntValue() == 2)) + { + std::cout << "array and dictionary contents are correct" + << std::endl; + } + + // Exercise writing to memory buffer + for (int i = 0; i < 2; ++i) + { + QPDFWriter w(pdf); + w.setOutputMemory(); + // Exercise setOutputMemory with and without static ID + w.setStaticID(i == 0); + w.setStreamDataMode(qpdf_s_preserve); + w.write(); + Buffer* b = w.getBuffer(); + std::string const filename = (i == 0 ? "a.pdf" : "b.pdf"); + FILE* f = QUtil::fopen_wrapper("open " + filename, + fopen(filename.c_str(), "wb")); + fwrite(b->getBuffer(), b->getSize(), 1, f); + fclose(f); + delete b; + } + } + else if (n == 15) + { + std::vector const& pages = pdf.getAllPages(); + // Reference to original page numbers for this test case are + // numbered from 0. + + // Remove pages from various places, checking to make sure + // that our pages reference is getting updated. + assert(pages.size() == 10); + pdf.removePage(pages.back()); // original page 9 + assert(pages.size() == 9); + pdf.removePage(*pages.begin()); // original page 0 + assert(pages.size() == 8); + checkPageContents(pages[4], "Original page 5"); + pdf.removePage(pages[4]); // original page 5 + assert(pages.size() == 7); + checkPageContents(pages[4], "Original page 6"); + checkPageContents(pages[0], "Original page 1"); + checkPageContents(pages[6], "Original page 8"); + + // Insert pages + + // Create some content streams. + std::vector contents; + contents.push_back(createPageContents(pdf, "New page 1")); + contents.push_back(createPageContents(pdf, "New page 0")); + contents.push_back(createPageContents(pdf, "New page 5")); + contents.push_back(createPageContents(pdf, "New page 6")); + contents.push_back(createPageContents(pdf, "New page 11")); + contents.push_back(createPageContents(pdf, "New page 12")); + + // Create some page objects. Start with an existing + // dictionary and modify it. Using the results of + // getDictAsMap to create a new dictionary effectively creates + // a shallow copy. + QPDFObjectHandle page_template = pages[0]; + std::vector new_pages; + for (std::vector::iterator iter = contents.begin(); + iter != contents.end(); ++iter) + { + // We will retain indirect object references to other + // indirect objects other than page content. + QPDFObjectHandle page = page_template.shallowCopy(); + page.replaceKey("/Contents", *iter); + if (iter == contents.begin()) + { + // leave direct + new_pages.push_back(page); + } + else + { + new_pages.push_back(pdf.makeIndirectObject(page)); + } + } + + // Now insert the pages + pdf.addPage(new_pages[0], true); + checkPageContents(pages[0], "New page 1"); + pdf.addPageAt(new_pages[1], true, pages[0]); + assert(pages[0].getObjectID() == new_pages[1].getObjectID()); + pdf.addPageAt(new_pages[2], true, pages[5]); + assert(pages[5].getObjectID() == new_pages[2].getObjectID()); + pdf.addPageAt(new_pages[3], false, pages[5]); + assert(pages[6].getObjectID() == new_pages[3].getObjectID()); + assert(pages.size() == 11); + pdf.addPage(new_pages[4], false); + assert(pages[11].getObjectID() == new_pages[4].getObjectID()); + pdf.addPageAt(new_pages[5], false, pages.back()); + assert(pages.size() == 13); + checkPageContents(pages[0], "New page 0"); + checkPageContents(pages[1], "New page 1"); + checkPageContents(pages[5], "New page 5"); + checkPageContents(pages[6], "New page 6"); + checkPageContents(pages[11], "New page 11"); + checkPageContents(pages[12], "New page 12"); + + // Exercise writing to FILE* + FILE* out = QUtil::fopen_wrapper(std::string("open a.pdf"), + fopen("a.pdf", "wb")); + QPDFWriter w(pdf, "FILE* a.pdf", out, true); + w.setStaticID(true); + w.setStreamDataMode(qpdf_s_preserve); + w.write(); + } + else if (n == 16) + { + // Insert a page manually and then update the cache. + std::vector const& all_pages = pdf.getAllPages(); + + QPDFObjectHandle contents = createPageContents(pdf, "New page 10"); + QPDFObjectHandle page = + pdf.makeIndirectObject( + QPDFObjectHandle(all_pages[0]).shallowCopy()); + page.replaceKey("/Contents", contents); + + // Insert the page manually. + QPDFObjectHandle root = pdf.getRoot(); + QPDFObjectHandle pages = root.getKey("/Pages"); + QPDFObjectHandle kids = pages.getKey("/Kids"); + page.replaceKey("/Parent", pages); + pages.replaceKey( + "/Count", + QPDFObjectHandle::newInteger(1 + (int)all_pages.size())); + kids.appendItem(page); + assert(all_pages.size() == 10); + pdf.updateAllPagesCache(); + assert(all_pages.size() == 11); + assert(all_pages.back().getObjectID() == page.getObjectID()); + + QPDFWriter w(pdf, "a.pdf"); + w.setStaticID(true); + w.setStreamDataMode(qpdf_s_preserve); + w.write(); + } + else if (n == 17) + { + // The input file to this test case is broken to exercise an + // error condition. + std::vector const& pages = pdf.getAllPages(); + pdf.removePage(pages[0]); + std::cout << "you can't see this" << std::endl; + } + else if (n == 18) + { + // Remove a page and re-insert it in the same file. + std::vector const& pages = pdf.getAllPages(); + + // Remove pages from various places, checking to make sure + // that our pages reference is getting updated. + assert(pages.size() == 10); + QPDFObjectHandle page5 = pages[5]; + pdf.removePage(page5); + pdf.addPage(page5, false); + assert(pages.size() == 10); + assert(pages.back().getObjectID() == page5.getObjectID()); + + QPDFWriter w(pdf, "a.pdf"); + w.setStaticID(true); + w.setStreamDataMode(qpdf_s_preserve); + w.write(); + } + else if (n == 19) + { + // Remove a page and re-insert it in the same file. + std::vector const& pages = pdf.getAllPages(); + + // Try to insert a page that's already there. + pdf.addPage(pages[5], false); + std::cout << "you can't see this" << std::endl; + } + else if (n == 20) + { + // Shallow copy an array + QPDFObjectHandle trailer = pdf.getTrailer(); + QPDFObjectHandle qtest = trailer.getKey("/QTest"); + QPDFObjectHandle copy = qtest.shallowCopy(); + // Append shallow copy of a scalar + copy.appendItem(trailer.getKey("/Size").shallowCopy()); + trailer.replaceKey("/QTest2", copy); + + QPDFWriter w(pdf, "a.pdf"); + w.setStaticID(true); + w.setStreamDataMode(qpdf_s_preserve); + w.write(); + } + else if (n == 21) + { + // Try to shallow copy a stream + std::vector const& pages = pdf.getAllPages(); + QPDFObjectHandle page = pages[0]; + QPDFObjectHandle contents = page.getKey("/Contents"); + contents.shallowCopy(); + std::cout << "you can't see this" << std::endl; + } + else if (n == 22) + { + // Try to remove a page we don't have + std::vector const& pages = pdf.getAllPages(); + QPDFObjectHandle page = pages[0]; + pdf.removePage(page); + pdf.removePage(page); + std::cout << "you can't see this" << std::endl; + } + else if (n == 23) + { + std::vector const& pages = pdf.getAllPages(); + pdf.removePage(pages.back()); + } + else if (n == 24) + { + // Test behavior of reserved objects + QPDFObjectHandle res1 = QPDFObjectHandle::newReserved(&pdf); + QPDFObjectHandle res2 = QPDFObjectHandle::newReserved(&pdf); + QPDFObjectHandle trailer = pdf.getTrailer(); + trailer.replaceKey("Array1", res1); + trailer.replaceKey("Array2", res2); + + QPDFObjectHandle array1 = QPDFObjectHandle::newArray(); + QPDFObjectHandle array2 = QPDFObjectHandle::newArray(); + array1.appendItem(res2); + array1.appendItem(QPDFObjectHandle::newInteger(1)); + array2.appendItem(res1); + array2.appendItem(QPDFObjectHandle::newInteger(2)); + // Make sure trying to ask questions about a reserved object + // doesn't break it. + if (res1.isArray()) + { + std::cout << "oops -- res1 is an array" << std::endl; + } + if (res1.isReserved()) + { + std::cout << "res1 is still reserved after checking if array" + << std::endl; + } + pdf.replaceReserved(res1, array1); + if (res1.isReserved()) + { + std::cout << "oops -- res1 is still reserved" << std::endl; + } + else + { + std::cout << "res1 is no longer reserved" << std::endl; + } + res1.assertArray(); + std::cout << "res1 is an array" << std::endl; + + try + { + res2.unparseResolved(); + std::cout << "oops -- didn't throw" << std::endl; + } + catch (std::logic_error e) + { + std::cout << "logic error: " << e.what() << std::endl; + } + try + { + res2.makeDirect(); + std::cout << "oops -- didn't throw" << std::endl; + } + catch (std::logic_error e) + { + std::cout << "logic error: " << e.what() << std::endl; + } + + pdf.replaceReserved(res2, array2); + + res2.assertArray(); + std::cout << "res2 is an array" << std::endl; + + // Verify that the previously added reserved keys can be + // dereferenced properly now + int i1 = res1.getArrayItem(0).getArrayItem(1).getIntValue(); + int i2 = res2.getArrayItem(0).getArrayItem(1).getIntValue(); + if ((i1 == 2) && (i2 == 1)) + { + std::cout << "circular access and lazy resolution worked" << std::endl; + } + + QPDFWriter w(pdf, "a.pdf"); + w.setStaticID(true); + w.setStreamDataMode(qpdf_s_preserve); + w.write(); + } + else if (n == 25) + { + // The copy object tests are designed to work with a specific + // file. Look at the test suite for the file, and look at the + // file for comments about the file's structure. + + // Copy qtest without crossing page boundaries. Should get O1 + // and O2 and their streams but not O3 or any other pages. + + assert(filename2 != 0); + QPDF newpdf; + newpdf.processFile(filename2); + QPDFObjectHandle qtest = pdf.getTrailer().getKey("/QTest"); + newpdf.getTrailer().replaceKey( + "/QTest", newpdf.copyForeignObject(qtest)); + + QPDFWriter w(newpdf, "a.pdf"); + w.setStaticID(true); + w.setStreamDataMode(qpdf_s_preserve); + w.write(); + } + else if (n == 26) + { + // Copy the O3 page using addPage. Copy qtest without + // crossing page boundaries. In addition to previous results, + // should get page O3 but no other pages including the page + // that O3 points to. Also, inherited object will have been + // pushed down and will be preserved. + + assert(filename2 != 0); + QPDF newpdf; + newpdf.processFile(filename2); + QPDFObjectHandle qtest = pdf.getTrailer().getKey("/QTest"); + QPDFObjectHandle O3 = qtest.getKey("/O3"); + newpdf.addPage(O3, false); + newpdf.getTrailer().replaceKey( + "/QTest", newpdf.copyForeignObject(qtest)); + + QPDFWriter w(newpdf, "a.pdf"); + w.setStaticID(true); + w.setStreamDataMode(qpdf_s_preserve); + w.write(); + } + else if (n == 27) + { + // Copy O3 and the page O3 refers to before copying qtest. + // Should get qtest plus only the O3 page and the page that O3 + // points to. Inherited objects should be preserved. + + assert(filename2 != 0); + QPDF newpdf; + newpdf.processFile(filename2); + QPDFObjectHandle qtest = pdf.getTrailer().getKey("/QTest"); + QPDFObjectHandle O3 = qtest.getKey("/O3"); + newpdf.addPage(O3.getKey("/OtherPage"), false); + newpdf.addPage(O3, false); + newpdf.getTrailer().replaceKey( + "/QTest", newpdf.copyForeignObject(qtest)); + + QPDFWriter w(newpdf, "a.pdf"); + w.setStaticID(true); + w.setStreamDataMode(qpdf_s_preserve); + w.write(); + } + else if (n == 28) + { + // Copy foreign object errors + try + { + pdf.copyForeignObject(pdf.getTrailer().getKey("/QTest")); + std::cout << "oops -- didn't throw" << std::endl; + } + catch (std::logic_error e) + { + std::cout << "logic error: " << e.what() << std::endl; + } + try + { + pdf.copyForeignObject(QPDFObjectHandle::newInteger(1)); + std::cout << "oops -- didn't throw" << std::endl; + } + catch (std::logic_error e) + { + std::cout << "logic error: " << e.what() << std::endl; + } + } + else if (n == 29) + { + // Detect mixed objects in QPDFWriter + assert(filename2 != 0); + QPDF other; + other.processFile(filename2); + // Should use copyForeignObject instead + other.getTrailer().replaceKey( + "/QTest", pdf.getTrailer().getKey("/QTest")); + + try + { + QPDFWriter w(other, "a.pdf"); + w.write(); + std::cout << "oops -- didn't throw" << std::endl; + } + catch (std::logic_error e) + { + std::cout << "logic error: " << e.what() << std::endl; + } + } + else if (n == 30) + { + assert(filename2 != 0); + QPDF encrypted; + encrypted.processFile(filename2, "user"); + QPDFWriter w(pdf, "b.pdf"); + w.setStreamDataMode(qpdf_s_preserve); + w.copyEncryptionParameters(encrypted); + w.write(); + + // Make sure the contents are actually the same + QPDF final; + final.processFile("b.pdf", "user"); + std::vector pages = pdf.getAllPages(); + std::string orig_contents = getPageContents(pages[0]); + pages = final.getAllPages(); + std::string new_contents = getPageContents(pages[0]); + if (orig_contents != new_contents) + { + std::cout << "oops -- page contents don't match" << std::endl + << "original:\n" << orig_contents + << "new:\n" << new_contents + << std::endl; + } + } + else if (n == 31) + { + // Test object parsing from a string. The input file is not used. + + QPDFObjectHandle o1 = + QPDFObjectHandle::parse( + "[/name 16059 3.14159 false\n" + " << /key true /other [ (string1) (string2) ] >> null]"); + std::cout << o1.unparse() << std::endl; + QPDFObjectHandle o2 = QPDFObjectHandle::parse(" 12345 \f "); + assert(o2.isInteger() && (o2.getIntValue() == 12345)); + try + { + QPDFObjectHandle::parse("[1 0 R]", "indirect test"); + std::cout << "oops -- didn't throw" << std::endl; + } + catch (std::logic_error e) + { + std::cout << "logic error parsing indirect: " << e.what() + << std::endl; + } + try + { + QPDFObjectHandle::parse("0 trailing", "trailing test"); + std::cout << "oops -- didn't throw" << std::endl; + } + catch (std::runtime_error e) + { + std::cout << "trailing data: " << e.what() + << std::endl; + } + } + else if (n == 32) + { + // Extra header text + char const* filenames[] = {"a.pdf", "b.pdf", "c.pdf", "d.pdf"}; + for (int i = 0; i < 4; ++i) + { + bool linearized = ((i & 1) != 0); + bool newline = ((i & 2) != 0); + QPDFWriter w(pdf, filenames[i]); + w.setStaticID(true); + std::cout + << "file: " << filenames[i] << std::endl + << "linearized: " << (linearized ? "yes" : "no") << std::endl + << "newline: " << (newline ? "yes" : "no") << std::endl; + w.setLinearization(linearized); + w.setExtraHeaderText(newline + ? "%% Comment with newline\n" + : "%% Comment\n% No newline"); + w.write(); + } + } + else + { + throw std::runtime_error(std::string("invalid test ") + + QUtil::int_to_string(n)); + } + + if (filep) + { + fclose(filep); + } + std::cout << "test " << n << " done" << std::endl; +} + +int main(int argc, char* argv[]) +{ + QUtil::setLineBuf(stdout); + if ((whoami = strrchr(argv[0], '/')) == NULL) + { + whoami = argv[0]; + } + else + { + ++whoami; + } + // For libtool's sake.... + if (strncmp(whoami, "lt-", 3) == 0) + { + whoami += 3; + } + + if ((argc < 3) || (argc > 4)) + { + usage(); + } + + try + { + int n = atoi(argv[1]); + char const* filename1 = argv[2]; + char const* filename2 = argv[3]; + runtest(n, filename1, filename2); + } + catch (std::exception& e) + { + std::cerr << e.what() << std::endl; + exit(2); + } + + return 0; +} diff --git a/qpdf/test_large_file.cc b/qpdf/test_large_file.cc new file mode 100644 index 0000000..f54adb3 --- /dev/null +++ b/qpdf/test_large_file.cc @@ -0,0 +1,362 @@ +// NOTE: This test program doesn't do anything special to enable large +// file support. This is important since it verifies that programs +// don't have to do anything special -- all the work is done +// internally by the library as long as they don't do their own file +// I/O. + +#include +#include +#include +#include +#include +#include +#include +#include + +// Run "test_large_file write small a.pdf" to get a PDF file that you +// can look at in a reader. + +// This program reads and writes specially crafted files for testing +// large file support. In write mode, write a file of npages pages +// where each page contains unique text and a unique image. The image +// is a binary representation of the page number. The image contains +// horizontal stripes with light stripes representing 1, dark stripes +// representing 0, and the high bit on top. In read mode, read the +// file back checking to make sure all the image data and page +// contents are as expected. + +// Running this is small mode produces a small file that is easy to +// look at in any viewer. Since there is no question about proper +// functionality for small files, writing and reading the small file +// allows the qpdf library to test this test program. Writing and +// reading the large file then allows us to verify large file support +// with confidence. + +static char const* whoami = 0; + +// Height should be a multiple of 10 +static int const nstripes = 10; +static int const stripesize_large = 500; +static int const stripesize_small = 5; +static int const npages = 200; + +// initialized in main +int stripesize = 0; +int width = 0; +int height = 0; +static unsigned char* buf = 0; + +static inline unsigned char get_pixel_color(int n, size_t row) +{ + return (n & (1 << (nstripes - 1 - row))) ? '\xc0' : '\x40'; +} + +class ImageChecker: public Pipeline +{ + public: + ImageChecker(int n); + virtual ~ImageChecker(); + virtual void write(unsigned char* data, size_t len); + virtual void finish(); + + private: + int n; + size_t offset; + bool okay; +}; + +ImageChecker::ImageChecker(int n) : + Pipeline("image checker", 0), + n(n), + offset(0), + okay(true) +{ +} + +ImageChecker::~ImageChecker() +{ +} + +void +ImageChecker::write(unsigned char* data, size_t len) +{ + for (size_t i = 0; i < len; ++i) + { + size_t y = (this->offset + i) / width / stripesize; + unsigned char color = get_pixel_color(n, y); + if (data[i] != color) + { + okay = false; + } + } + this->offset += len; +} + +void +ImageChecker::finish() +{ + if (! okay) + { + std::cout << "errors found checking image data for page " << n + << std::endl; + } +} + +class ImageProvider: public QPDFObjectHandle::StreamDataProvider +{ + public: + ImageProvider(int n); + virtual ~ImageProvider(); + virtual void provideStreamData(int objid, int generation, + Pipeline* pipeline); + + private: + int n; +}; + +ImageProvider::ImageProvider(int n) : + n(n) +{ +} + +ImageProvider::~ImageProvider() +{ +} + +void +ImageProvider::provideStreamData(int objid, int generation, + Pipeline* pipeline) +{ + if (buf == 0) + { + buf = new unsigned char[width * stripesize]; + } + std::cout << "page " << n << " of " << npages << std::endl; + for (int y = 0; y < nstripes; ++y) + { + unsigned char color = get_pixel_color(n, y); + memset(buf, (int) color, width * stripesize); + pipeline->write(buf, width * stripesize); + } + pipeline->finish(); +} + +void usage() +{ + std::cerr << "Usage: " << whoami << " {read|write} {large|small} outfile" + << std::endl; + exit(2); +} + +static void set_parameters(bool large) +{ + stripesize = large ? stripesize_large : stripesize_small; + height = nstripes * stripesize; + width = height; +} + +std::string generate_page_contents(int pageno) +{ + std::string contents = + "BT /F1 24 Tf 72 720 Td (page " + QUtil::int_to_string(pageno) + + ") Tj ET\n" + "q 468 0 0 468 72 72 cm /Im1 Do Q\n"; + return contents; +} + +static QPDFObjectHandle create_page_contents(QPDF& pdf, int pageno) +{ + return QPDFObjectHandle::newStream(&pdf, generate_page_contents(pageno)); +} + +QPDFObjectHandle newName(std::string const& name) +{ + return QPDFObjectHandle::newName(name); +} + +QPDFObjectHandle newInteger(int val) +{ + return QPDFObjectHandle::newInteger(val); +} + +static void create_pdf(char const* filename) +{ + QPDF pdf; + + pdf.emptyPDF(); + + QPDFObjectHandle font = pdf.makeIndirectObject( + QPDFObjectHandle::newDictionary()); + font.replaceKey("/Type", newName("/Font")); + font.replaceKey("/Subtype", newName("/Type1")); + font.replaceKey("/Name", newName("/F1")); + font.replaceKey("/BaseFont", newName("/Helvetica")); + font.replaceKey("/Encoding", newName("/WinAnsiEncoding")); + + QPDFObjectHandle procset = + pdf.makeIndirectObject(QPDFObjectHandle::newArray()); + procset.appendItem(newName("/PDF")); + procset.appendItem(newName("/Text")); + procset.appendItem(newName("/ImageC")); + + QPDFObjectHandle rfont = QPDFObjectHandle::newDictionary(); + rfont.replaceKey("/F1", font); + + QPDFObjectHandle mediabox = QPDFObjectHandle::newArray(); + mediabox.appendItem(newInteger(0)); + mediabox.appendItem(newInteger(0)); + mediabox.appendItem(newInteger(612)); + mediabox.appendItem(newInteger(792)); + + for (int pageno = 1; pageno <= npages; ++pageno) + { + QPDFObjectHandle image = QPDFObjectHandle::newStream(&pdf); + QPDFObjectHandle image_dict = image.getDict(); + image_dict.replaceKey("/Type", newName("/XObject")); + image_dict.replaceKey("/Subtype", newName("/Image")); + image_dict.replaceKey("/ColorSpace", newName("/DeviceGray")); + image_dict.replaceKey("/BitsPerComponent", newInteger(8)); + image_dict.replaceKey("/Width", newInteger(width)); + image_dict.replaceKey("/Height", newInteger(height)); + ImageProvider* p = new ImageProvider(pageno); + PointerHolder provider(p); + image.replaceStreamData(provider, + QPDFObjectHandle::newNull(), + QPDFObjectHandle::newNull()); + + QPDFObjectHandle xobject = QPDFObjectHandle::newDictionary(); + xobject.replaceKey("/Im1", image); + + QPDFObjectHandle resources = QPDFObjectHandle::newDictionary(); + resources.replaceKey("/ProcSet", procset); + resources.replaceKey("/Font", rfont); + resources.replaceKey("/XObject", xobject); + + QPDFObjectHandle contents = create_page_contents(pdf, pageno); + + QPDFObjectHandle page = pdf.makeIndirectObject( + QPDFObjectHandle::newDictionary()); + page.replaceKey("/Type", newName("/Page")); + page.replaceKey("/MediaBox", mediabox); + page.replaceKey("/Contents", contents); + page.replaceKey("/Resources", resources); + + pdf.addPage(page, false); + } + + QPDFWriter w(pdf, filename); + w.setStaticID(true); // for testing only + w.setStreamDataMode(qpdf_s_preserve); + w.setObjectStreamMode(qpdf_o_disable); + w.write(); +} + +static void check_page_contents(int pageno, QPDFObjectHandle page) +{ + PointerHolder buf = + page.getKey("/Contents").getStreamData(); + std::string actual_contents = + std::string((char *)(buf->getBuffer()), buf->getSize()); + std::string expected_contents = generate_page_contents(pageno); + if (expected_contents != actual_contents) + { + std::cout << "page contents wrong for page " << pageno << std::endl + << "ACTUAL: " << actual_contents + << "EXPECTED: " << expected_contents + << "----\n"; + } +} + +static void check_image(int pageno, QPDFObjectHandle page) +{ + QPDFObjectHandle image = + page.getKey("/Resources").getKey("/XObject").getKey("/Im1"); + ImageChecker ic(pageno); + image.pipeStreamData(&ic, true, false, false); +} + +static void check_pdf(char const* filename) +{ + QPDF pdf; + pdf.processFile(filename); + std::vector const& pages = pdf.getAllPages(); + assert(pages.size() == (size_t)npages); + for (int i = 0; i < npages; ++i) + { + int pageno = i + 1; + std::cout << "page " << pageno << " of " << npages << std::endl; + check_page_contents(pageno, pages[i]); + check_image(pageno, pages[i]); + } +} + +int main(int argc, char* argv[]) +{ + whoami = QUtil::getWhoami(argv[0]); + QUtil::setLineBuf(stdout); + + // For libtool's sake.... + if (strncmp(whoami, "lt-", 3) == 0) + { + whoami += 3; + } + if (argc != 4) + { + usage(); + } + char const* operation = argv[1]; + char const* size = argv[2]; + char const* filename = argv[3]; + + bool op_write = false; + bool size_large = false; + + if (strcmp(operation, "write") == 0) + { + op_write = true; + } + else if (strcmp(operation, "read") == 0) + { + op_write = false; + } + else + { + usage(); + } + + if (strcmp(size, "large") == 0) + { + size_large = true; + } + else if (strcmp(size, "small") == 0) + { + size_large = false; + } + else + { + usage(); + } + + set_parameters(size_large); + + try + { + if (op_write) + { + create_pdf(filename); + } + else + { + check_pdf(filename); + } + } + catch (std::exception& e) + { + std::cerr << e.what() << std::endl; + exit(2); + } + + delete [] buf; + + return 0; +} diff --git a/qtest/QTC/perl/QTC.pm b/qtest/QTC/perl/QTC.pm new file mode 100644 index 0000000..2f78b3a --- /dev/null +++ b/qtest/QTC/perl/QTC.pm @@ -0,0 +1,26 @@ +# -*- perl -*- + +require 5.005; +use strict; +use FileHandle; + +package QTC; + +sub TC +{ + my ($scope, $case, $n) = @_; + local $!; + $n = 0 unless defined $n; + return unless ($scope eq ($ENV{'TC_SCOPE'} || "")); + my $filename = $ENV{'TC_FILENAME'} || return; + my $fh = new FileHandle(">>$filename") or + die "open test coverage file: $!\n"; + print $fh "$case $n\n"; + $fh->close(); +} + +1; + +# +# END OF QTC +# diff --git a/qtest/README.txt b/qtest/README.txt new file mode 100644 index 0000000..a4e21b0 --- /dev/null +++ b/qtest/README.txt @@ -0,0 +1,3 @@ +This is a copy of qtest (http://qtest.qbilt.org) which is distributed +under the terms of the Artistic license and has the same author as +qpdf. diff --git a/qtest/bin/qtest-driver b/qtest/bin/qtest-driver new file mode 100755 index 0000000..b115b94 --- /dev/null +++ b/qtest/bin/qtest-driver @@ -0,0 +1,815 @@ +#!/usr/bin/env perl +# +# This file is part of qtest. +# +# Copyright 1993-2007, Jay Berkenbilt +# +# QTest is distributed under the terms of version 2.0 of the Artistic +# license which may be found in the source distribution. +# +require 5.008; +BEGIN { $^W = 1; } +use strict; +use IO::Handle; +use IO::File; +use IO::Socket; +use Cwd 'abs_path'; +use Cwd; +use Config; +use File::Copy; +use File::Basename; +use File::Spec; + +my $whoami = basename($0); +my $dirname = dirname(abs_path($0)); +my $cwd = getcwd(); +my $top = dirname($dirname); +my $module_dir = "$top/module"; +my $qtc_dir = "$top/QTC/perl"; + +unshift(@INC, $module_dir, $qtc_dir); +require QTC; +require TestDriver; + +if ((@ARGV == 1) && ($ARGV[0] eq '--version')) +{ + print "$whoami version 1.4\n"; + exit 0; +} +if ((@ARGV == 1) && ($ARGV[0] eq '--print-path')) +{ + print $top, "\n"; + exit 0; +} + +my @bindirs = (); +my $datadir = undef; +my $covdir = '.'; +my $stdout_tty = (-t STDOUT) ? "1" : "0"; + +while (@ARGV) +{ + my $arg = shift(@ARGV); + if ($arg eq '-bindirs') + { + usage() unless @ARGV; + push(@bindirs, split(':', shift(@ARGV))); + } + elsif ($arg eq '-datadir') + { + usage() unless @ARGV; + $datadir = shift(@ARGV); + } + elsif ($arg eq '-covdir') + { + usage() unless @ARGV; + $covdir = shift(@ARGV); + } + elsif ($arg =~ m/^-stdout-tty=([01])$/) + { + $stdout_tty = $1; + } + else + { + usage(); + } +} +usage() unless defined($datadir); +if (@bindirs) +{ + my @path = (); + foreach my $d (@bindirs) + { + my $abs = abs_path($d) or + fatal("can't canonicalize path to bindir $d: $!"); + push(@path, $abs); + } + my $sep = ($^O eq 'MSWin32' ? ';' : ':'); + my $path = join($sep, @path) . $sep . $ENV{'PATH'}; + # Delete and explicitly recreate the PATH environment variable. + # This seems to be more reliable. If we just reassign, in some + # cases, the modified environment is not inherited by the child + # process. (This happens when qtest-driver is invoked from ant + # running from gjc-compat. I have no idea how or why.) + delete $ENV{'PATH'}; + $ENV{'PATH'} = $path; +} + +if ($stdout_tty) +{ + TestDriver::get_tty_features(); +} + +my $pid = undef; +my $pid_cleanup = new TestDriver::PidKiller(\$pid); + +# $in_testsuite is whether the test driver itself is being run from a +# test suite! Check before we set the environment variable. +my $in_testsuite = $ENV{'IN_TESTSUITE'} || 0; + +$ENV{'IN_TESTSUITE'} = 1; + +# Temporary path is intended to be easy to locate so its contents can +# be inspected by impatient test suite runners. It is not intended to +# be a "secure" (unpredictable) path. +my $tempdir = File::Spec->tmpdir() . "/testtemp.$$"; +my $thispid = $$; + +END +{ + # We have to make sure we don't call this from the child + # qtest-driver when fork is called. + if ((defined $thispid) && ($$ == $thispid) && (defined $tempdir)) + { + local $?; + TestDriver::rmrf($tempdir) if -d $tempdir; + } +} + +$| = 1; +$SIG{'PIPE'} = 'IGNORE'; +$SIG{'INT'} = $SIG{'HUP'} = $SIG{'TERM'} = $SIG{'QUIT'} = sub { exit 2 }; + +TestDriver::rmrf($tempdir); +fatal("removal of $tempdir failed") if -e "$tempdir"; + +mkdir($tempdir, 0777) || die "mkdir $tempdir: $!\n"; +$tempdir = abs_path($tempdir) or + fatal("can't canonicalize path to $tempdir: $!"); + +my $errors = 0; + +my $tc_input = undef; +my $tc_scope = undef; +my @testcov = (<$covdir/*.testcov>); +if (@testcov > 1) +{ + fatal("more than one testcov file exists"); +} +elsif (@testcov) +{ + &QTC::TC("testdriver", "coverage directory", + ($covdir eq '.' ? 1 : 0)); + $tc_input = $testcov[0]; + $tc_input =~ s,^\./,,; + $tc_scope = basename($tc_input); + $tc_scope =~ s/\.testcov$// or + fatal("can't get scope from testcov filename"); +} + +my $testlogfile = 'qtest.log'; +my $testxmlfile = 'qtest-results.xml'; +unlink $testlogfile; +unlink $testxmlfile; + +my $totmissing = 0; +my $totextra = 0; +my $tottests = 0; +my $totpasses = 0; +my $totfails = 0; +my $totxpasses = 0; +my $totxfails = 0; + +my $now = ($in_testsuite ? '---timestamp---' : localtime(time)); +my $msg = "STARTING TESTS on $now"; +print "\n"; +print_and_log(('*' x length($msg)) . "\n$msg\n" . + ('*' x length($msg)) . "\n\n"); + +my $tc_log = undef; +my $tc_winlog = undef; +my %tc_cases = (); +my %tc_ignored_scopes = (); +parse_tc_file(); +tc_do_initial_checks(); + +my $tests_to_run; +defined($tests_to_run = $ENV{"TESTS"}) or $tests_to_run = ""; +my @tests = (); +if ($tests_to_run ne "") +{ + @tests = split(/\s+/, $tests_to_run); + for (@tests) + { + &QTC::TC("testdriver", "driver tests specified"); + $_ = "$datadir/$_.test"; + } +} +else +{ + &QTC::TC("testdriver", "driver tests not specified"); + @tests = <$datadir/*.test>; +} + +print_xml("\n" . + "\n"); +foreach my $test (@tests) +{ + print_and_log("\nRunning $test\n"); + print_xml(" \n"); + my @results = run_test($test); + if (scalar(@results) != 5) + { + error("test driver $test returned invalid results"); + } + else + { + my ($ntests, $passes, $fails, $xpasses, $xfails) = @results; + my $actual = $passes + $fails + $xpasses + $xfails; + my $extra = 0; + my $missing = 0; + if ($actual > $ntests) + { + &QTC::TC("testdriver", "driver extra tests"); + my $n = ($actual - $ntests); + print_and_log(sprintf("\n*** WARNING: saw $n extra test%s\n\n", + ($n == 1 ? "" : "s"))); + $extra = $n; + } + elsif ($actual < $ntests) + { + &QTC::TC("testdriver", "driver missing tests"); + my $n = ($ntests - $actual); + print_and_log(sprintf("\n*** WARNING: missing $n test%s\n\n", + ($n == 1 ? "" : "s"))); + $missing = $n; + } + + $totmissing += $missing; + $totextra += $extra; + $totpasses += $passes; + $totfails += $fails; + $totxpasses += $xpasses; + $totxfails += $xfails; + $tottests += ($passes + $fails + $xpasses + $xfails); + + my $passed = (($extra == 0) && ($missing == 0) && + ($fails == 0) && ($xpasses == 0)); + + print_xml(" \n"); + } + print_xml(" \n"); +} + +my $coverage_okay = 1; +tc_do_final_checks(); + +my $okay = ((($totpasses + $totxfails) == $tottests) && + ($errors == 0) && ($totmissing == 0) && ($totextra == 0) && + ($coverage_okay)); + +print "\n"; +print_and_pad("Overall test suite"); +if ($okay) +{ + &QTC::TC("testdriver", "driver overall pass"); + print_results(pass(), pass()); +} +else +{ + &QTC::TC("testdriver", "driver overall fail"); + print_results(fail(), pass()); + print "\nFailure summary may be found in $testlogfile\n"; +} + +my $summary = "\nTESTS COMPLETE. Summary:\n\n"; +$summary .= + sprintf("Total tests: %d\n" . + "Passes: %d\n" . + "Failures: %d\n" . + "Unexpected Passes: %d\n" . + "Expected Failures: %d\n" . + "Missing Tests: %d\n" . + "Extra Tests: %d\n", + $tottests, $totpasses, $totfails, $totxpasses, $totxfails, + $totmissing, $totextra); + +print_and_log($summary); +print "\n"; + +print_xml(" \n" . + "\n"); + +exit ($okay ? 0 : 2); + +sub run_test +{ + my $prog = shift; + my @results = (); + + # Open a socket for communication with subsidiary test drivers. + # Exchange some handshaking information over this socket. When + # the subsidiary test suite exits, it reports its results over the + # socket. + + my $use_socketpair = (defined $Config{d_sockpair}); + if ($Config{'osname'} eq 'cygwin') + { + $use_socketpair = 0; + } + + my $listensock; + my $for_parent; + my $for_child; + + my @comm_args = (); + + if ($use_socketpair) + { + socketpair($for_child, $for_parent, AF_UNIX, SOCK_STREAM, PF_UNSPEC) + or fatal("socketpair: $!"); + my $fd = fileno($for_child); + close($for_child); + close($for_parent); + local $^F = $fd; # prevent control fd from being closed on exec + socketpair($for_child, $for_parent, AF_UNIX, SOCK_STREAM, PF_UNSPEC) + or fatal("socketpair: $!"); + if (fileno($for_child) != $fd) + { + fatal("FOR_CHILD socket has wrong file descriptor number: got " . + fileno($for_child) . "; wanted $fd"); + } + $for_parent->autoflush(1); + $for_child->autoflush(1); + binmode $for_parent; + binmode $for_child; + @comm_args = ('-fd', $fd); + } + else + { + $listensock = IO::Socket::INET->new( + Listen => 1, Proto => 'tcp', LocalPort => 0) or + fatal("listen: $!"); + my ($s_port, $s_addr) = unpack_sockaddr_in($listensock->sockname()); + @comm_args = ('-port', $s_port); + } + + my $pid = fork; + fatal("fork failed: $!") unless defined $pid; + if ($pid == 0) + { + if ($use_socketpair) + { + close($for_parent); + } + chdir($datadir) or fatal("chdir $datadir failed: $!"); + + if (defined $tc_log) + { + # Set these environment variables in the child process so + # that we can actually use the coverage system + # successfully to test the test driver itself. + $ENV{'TC_SCOPE'} = $tc_scope; + $ENV{'TC_FILENAME'} = $tc_log; + if (defined $tc_winlog) + { + $ENV{'TC_WIN_FILENAME'} = $tc_winlog; + } + } + + # Clear this environment variable so that nested test suites + # don't inherit the value from this test suite. Note that as + # of perl 5.8.7 in cygwin, deleting an environment variable + # doesn't work. + $ENV{'TESTS'} = ""; + + exec +('perl', '-I', $module_dir, '-I', $qtc_dir, + basename($prog), + @comm_args, + '-origdir', $cwd, + '-tempdir', $tempdir, + '-testlog', "$cwd/$testlogfile", + '-testxml', "$cwd/$testxmlfile", + "-stdout-tty=$stdout_tty") or + fatal("exec $prog failed: $!"); + } + if ($use_socketpair) + { + close($for_child); + } + else + { + $for_parent = $listensock->accept() or die $!; + $for_parent->autoflush(); + $listensock->close(); + } + + eval + { + # Either CHLD or PIPE here indicates premature exiting of + # subsidiary process which will be detected by either a + # protocol error or a timeout on the select below. + local $SIG{'CHLD'} = local $SIG{'PIPE'} = 'IGNORE'; + print $for_parent "TEST_DRIVER 1\n" + or die "--child--\n"; + my $rin = ''; + vec($rin, fileno($for_parent), 1) = 1; + my $nfound = select($rin, '', '', 60); + if ($nfound == 0) + { + fatal("timed out waiting for input on $for_parent"); + } + # Setting to DEFAULT should be unnecessary because of "local" + # above, but there seems to be a race condition that this + # helps to correct. + $SIG{'CHLD'} = $SIG{'PIPE'} = 'DEFAULT'; + }; + if ($@) + { + if ($@ =~ m/--child--/) + { + error("subsidiary test driver exited"); + } + else + { + die $@; + } + } + else + { + my $line = <$for_parent>; + if (! ((defined $line) && ($line =~ m/^TEST_DRIVER_CLIENT 1$/))) + { + error("invalid protocol with subdiary test driver"); + kill 1, $pid; + } + waitpid $pid, 0; + my $results = <$for_parent>; + close($for_parent); + if (! ((defined $results) && ($results =~ m/^\d+(?: \d+){4}$/))) + { + &QTC::TC("testdriver", "driver test returned invalid results"); + error("invalid results from subsidiary test driver"); + } + else + { + @results = split(/ /, $results); + } + } + @results; +} + +sub parse_tc_file +{ + return unless defined $tc_input; + + my $tc = new IO::File("<$tc_input") or fatal("can't read $tc_input: $!"); + binmode $tc; + while (<$tc>) + { + s/\r?\n$//s; + next if m/^\#/; + next if m/^\s*$/; + if (m/^ignored-scope: (\S+)$/) + { + $tc_ignored_scopes{$1} = 1; + } + elsif (m/^\s*?(\S.+?)\s+(\d+)\s*$/) + { + my ($case, $n) = ($1, $2); + if (exists $tc_cases{$case}) + { + &QTC::TC("testdriver", "driver duplicate coverage case"); + error("$tc_input:$.: duplicate case"); + } + $tc_cases{$case} = $n; + } + else + { + error("$tc_input:$.: invalid syntax"); + } + } + $tc->close(); +} + +sub tc_do_initial_checks +{ + return unless defined $tc_input; + + if (! exists $ENV{'TC_SRCS'}) + { + fatal("TC_SRCS must be set"); + } + + my @tc_srcs = (grep { m/\S/ } (split(/\s+/, $ENV{'TC_SRCS'}))); + + my %seen_cases = (); + foreach my $src (@tc_srcs) + { + my $s = new IO::File("<$src") or die "$whoami: open $src: $!\n"; + binmode $s; + while (<$s>) + { + # Look for coverage calls in the source subject to certain + # lexical constraints + my ($lscope, $case); + if (m/^\s*\&?QTC(?:::|\.)TC\(\"([^\"]+)\",\s*\"([^\"]+)\"/) + { + # C++, Java, Perl, etc. + ($lscope, $case) = ($1, $2); + } + elsif (m/^[^\#]*\$\(call QTC.TC,([^,]+),([^,\)]+)/) + { + # make + ($lscope, $case) = ($1, $2); + } + if ((defined $lscope) && (defined $case)) + { + if ($lscope eq $tc_scope) + { + push(@{$seen_cases{$case}}, [$src, $.]); + } + elsif (exists $tc_ignored_scopes{$lscope}) + { + &QTC::TC("testdriver", "driver ignored scope"); + } + else + { + &QTC::TC("testdriver", "driver out-of-scope case"); + error("$src:$.: out-of-scope coverage case"); + } + } + } + $s->close(); + } + + my %wanted_cases = %tc_cases; + foreach my $case (sort keys %seen_cases) + { + my $wanted = 1; + my $whybad = undef; + if (exists $wanted_cases{$case}) + { + delete $wanted_cases{$case}; + } + else + { + &QTC::TC("testdriver", "driver unregistered coverage case"); + $wanted = 0; + $whybad = "unregistered"; + } + if (scalar(@{$seen_cases{$case}}) > $wanted) + { + $whybad = $whybad || "duplicate"; + foreach my $d (@{$seen_cases{$case}}) + { + my ($file, $lineno) = @$d; + &QTC::TC("testdriver", "driver coverage error in src", + ($whybad eq 'unregistered' ? 0 : + $whybad eq 'duplicate' ? 1 : + 9999)); + error("$file:$lineno: $whybad coverage case \"$case\""); + } + } + } + foreach my $case (sort keys %wanted_cases) + { + &QTC::TC("testdriver", "driver unseen coverage case"); + error("$whoami: coverage case \"$case\" was not seen"); + } + + fatal("errors detected; exiting") if $errors; + + $tc_log = "$cwd/$tc_scope.cov_out"; + if ($^O eq 'cygwin') + { + chop(my $f = `cygpath --windows $tc_log`); + $tc_winlog = $f; + } + elsif ($^O eq 'MSWin32') + { + $tc_winlog = $tc_log; + } + unlink $tc_log; + print_and_log("Test coverage active in scope $tc_scope\n"); +} + +sub tc_do_final_checks +{ + return unless (defined $tc_log); + + my %seen_cases = (); + my $tc = new IO::File("<$tc_log"); + binmode $tc; + if ($tc) + { + binmode $tc; + while (<$tc>) + { + s/\r?\n$//s; + next if m/^\#/; + next if m/^\s*$/; + if (m/^(.+) (\d+)\s*$/) + { + $seen_cases{$1}{$2} = 1; + } + } + $tc->close(); + } + + my $testlog = open_log(); + + $testlog->print("\nTest coverage results:\n"); + + my @problems = (); + foreach my $c (sort keys %tc_cases) + { + my ($case, $n) = ($c, $tc_cases{$c}); + for (my $i = 0; $i <= $n; ++$i) + { + if (exists $seen_cases{$c}{$i}) + { + delete $seen_cases{$c}{$i}; + } + else + { + &QTC::TC("testdriver", "driver missing coverage case"); + push(@problems, "missing: $c $i"); + } + } + } + foreach my $c (sort keys %seen_cases) + { + foreach my $n (sort { $a <=> $b } (keys %{$seen_cases{$c}})) + { + &QTC::TC("testdriver", "driver extra coverage case"); + push(@problems, "extra: $c $n"); + } + } + + if (@problems) + { + my $testxml = open_xml(); + $testxml->print(" \n"); + foreach my $p (@problems) + { + $testlog->print("$p\n"); + $testxml->print(" \n"); + } + $testxml->print(" \n"); + $testxml->close(); + $testlog->print("coverage errors: " . scalar(@problems) . "\n"); + } + my $passed = (@problems == 0); + $testlog->print("\nCoverage analysis: ", ($passed ? 'PASSED' : 'FAILED'), + "\n"); + $testlog->close(); + + print "\n"; + print_and_pad("Coverage analysis"); + if ($passed) + { + print_results(pass(), pass()); + my $passlog = $tc_log; + $passlog =~ s/(\.[^\.]+)$/-passed$1/; + copy($tc_log, $passlog); + } + else + { + $coverage_okay = 0; + print_results(fail(), pass()); + } +} + +sub open_binary +{ + my $file = shift; + my $fh = new IO::File(">>$file") or fatal("can't open $file: $!"); + binmode $fh; + $fh; +} + +sub open_log +{ + open_binary($testlogfile); +} + +sub open_xml +{ + open_binary($testxmlfile); +} + +sub print_and_log +{ + my $fh = open_log(); + print @_; + print $fh @_; + $fh->close(); +} + +sub print_xml +{ + my $fh = open_xml(); + print $fh @_; + $fh->close(); +} + +sub print_and_pad +{ + TestDriver::print_and_pad(@_); +} + +sub print_results +{ + TestDriver::print_results(@_); +} + +sub pass +{ + TestDriver->PASS; +} + +sub fail +{ + TestDriver->FAIL; +} + +sub error +{ + my $msg = shift; + warn $msg, "\n"; + ++$errors; +} + +sub fatal +{ + my $msg = shift; + warn "$whoami: $msg\n"; + exit 2; +} + +sub usage +{ + warn " +Usage: $whoami --print-path + +Prints full path to ${whoami}'s installation directory and exits. + + - OR - + +Usage: $whoami options + +Options include: + + -datadir datadir + -bindirs bindir[:bindir...] + [ -covdir [coverage-dir] ] + [ -stdout-tty=[01] ] + +Subsidiary test programs are run with the -bindirs argument (a +colon-separated list of directories, which may be relative but will be +internally converted to absolute) prepended to the path and with the +-datadir argument set as the current working directory. + +By default, this program runs datadir/*.test as subsidiary test +suites. If the TESTS environment variable is set, it is taken to be a +space-separated list of test suite names. For each name n, +datadir/n.test is run. + +Test coverage support is built in. If a file whose name matches +*.testcov in the coverage directory (which defaults to \".\") that is +a valid test coverage file, the full path to the file into which test +coverage results are written will be placed in the TC_FILENAME +environment variable. (If running under cygwin, the Windows path will +be in TC_WIN_FILENAME.) The test coverage scope, which is equal to +the part of the testcov file name excluding the extension, is placed +in the TC_SCOPE environment variable. + +If the -stdout-tty option is passed, its value overrides ${whoami}'s +determination of whether standard output is a terminal. This can be +useful for cases in which another program is invoking ${whoami} and +passing its output through a pipe to a terminal. + +"; + exit 2; + +} diff --git a/qtest/module/TestDriver.pm b/qtest/module/TestDriver.pm new file mode 100644 index 0000000..d581216 --- /dev/null +++ b/qtest/module/TestDriver.pm @@ -0,0 +1,1783 @@ +# -*- perl -*- +# +# This file is part of qtest. +# +# Copyright 1993-2007, Jay Berkenbilt +# +# QTest is distributed under the terms of version 2.0 of the Artistic +# license which may be found in the source distribution. +# + +# Search for "PUBLIC METHODS" to find the public methods and +# documentation on how to use them. + +require 5.008; +use strict; + +package TestDriver::PidKiller; + +use vars qw($f_pid); +$f_pid = 'pid'; + +sub new +{ + my $class = shift; + my $rep = +{+__PACKAGE__ => {} }; + $rep->{+__PACKAGE__}{$f_pid} = shift; + bless $rep, $class; +} + +sub DESTROY +{ + my $rep = shift; + my $pid = $rep->{+__PACKAGE__}{$f_pid}; + defined($$pid) && $$pid && kill 15, $$pid; +} + +package TestDriver; + +use IO::Handle; +use IO::File; +use IO::Socket; +use IO::Select; +use POSIX ':sys_wait_h'; +use File::Copy; +use File::Find; +use Carp; +use Cwd; +require QTC; + +# Constants + +# Possible test case outcomes +use constant PASS => 'PASS'; +use constant FAIL => 'FAIL'; + +# Input/Output keys +use constant STRING => 'STRING'; +use constant FILE => 'FILE'; +use constant COMMAND => 'COMMAND'; +use constant FILTER => 'FILTER'; +use constant REGEXP => 'REGEXP'; +use constant EXIT_STATUS => 'EXIT_STATUS'; +use constant THREAD_DATA => 'THREAD_DATA'; +use constant TD_THREADS => 'TD_THREADS'; +use constant TD_SEQGROUPS => 'TD_SEQGROUPS'; + +# Flags +use constant NORMALIZE_NEWLINES => 1 << 0; +use constant NORMALIZE_WHITESPACE => 1 << 1; +use constant EXPECT_FAILURE => 1 << 2; + +# Field names +use vars qw($f_socket $f_origdir $f_tempdir $f_testlog $f_testxml $f_suitename); +$f_socket = 'socket'; +$f_origdir = 'origdir'; +$f_tempdir = 'tempdir'; +$f_testlog = 'testlog'; +$f_testxml = 'testxml'; +$f_suitename = 'suitename'; + +use vars qw($f_passes $f_fails $f_xpasses $f_xfails $f_testnum); +$f_passes = 'passes'; # expected passes +$f_fails = 'fails'; # unexpected failures +$f_xpasses = 'xpasses'; # unexpected passes +$f_xfails = 'xfails'; # expected failures +$f_testnum = 'testnum'; + +# Static Variables + +# QTEST_MARGIN sets the number of spaces to after PASSED or FAILED and +# before the rightmost column of the screen. +my $margin = $ENV{'QTEST_MARGIN'} || 8; +$margin += $ENV{'QTEST_EXTRA_MARGIN'} || 0; + +my $ncols = 80; + +my $color_reset = ""; +my $color_green = ""; +my $color_yellow = ""; +my $color_red = ""; +my $color_magenta = ""; +my $color_emph = ""; + +# MSWin32 support +my $in_windows = 0; +my $winbin = undef; +if ($^O eq 'MSWin32') +{ + $in_windows = 1; +} + +sub get_tty_features +{ + my $got_size = 0; + eval + { + require Term::ReadKey; + ($ncols, undef, undef, undef) = Term::ReadKey::GetTerminalSize(); + $got_size = 1; + }; + if (! $got_size) + { + eval + { + # Get screen columns if possible + no strict; + local $^W = 0; + local *X; + { + local $SIG{'__WARN__'} = sub {}; + require 'sys/ioctl.ph'; + } + if ((defined &TIOCGWINSZ) && open(X, "+ {} }; + + if (@_ != 1) + { + croak "Usage: ", __PACKAGE__, "->new(\"test-suite name\")\n"; + } + my $suitename = shift; + + if (! ((@ARGV == 11) && + (($ARGV[0] eq '-fd') || ($ARGV[0] eq '-port')) && + ($ARGV[2] eq '-origdir') && + ($ARGV[4] eq '-tempdir') && + ($ARGV[6] eq '-testlog') && + ($ARGV[8] eq '-testxml') && + ($ARGV[10] =~ m/^-stdout-tty=([01])$/) && + (-d $ARGV[5]))) + { + die +__PACKAGE__, ": improper invocation of test driver $0 (" . + join(' ', @ARGV) . ")\n"; + } + my $fd = ($ARGV[0] eq '-fd') ? $ARGV[1] : undef; + my $port = ($ARGV[0] eq '-port') ? $ARGV[1] : undef; + my $origdir = $ARGV[3]; + my $tempdir = $ARGV[5]; + my $testlogfile = $ARGV[7]; + my $testxmlfile = $ARGV[9]; + my $testlog = new IO::File(">>$testlogfile"); + binmode $testlog; + my $testxml = new IO::File(">>$testxmlfile"); + binmode $testxml; + $ARGV[10] =~ m/=([01])/ or die +__PACKAGE__, ": INTERNAL ERROR in ARGV[10]"; + my $stdout_is_tty = $1; + if ($stdout_is_tty) + { + get_tty_features(); + } + + my $socket; + if (defined $fd) + { + $socket = new IO::Handle; + if (! $socket->fdopen($fd, "w+")) + { + warn +__PACKAGE__, ": unable to open file descriptor $fd.\n"; + warn +__PACKAGE__, " must be created from a program invoked by" . + " the test driver system\n"; + die +__PACKAGE__, ": initialization failed"; + } + } + else + { + $socket = IO::Socket::INET->new( + PeerAddr => '127.0.0.1', PeerPort => $port) or + die "unable to connect to port $port: $!\n"; + } + $socket->autoflush(); + binmode $socket; + + # Do some setup that would ordinarily be reserved for a main + # program. We want test suites to behave in a certain way so tha + # the overall system works as desired. + + # Killing the driver should cause to to exit. Without this, it + # may cause whatever subsidiary program is being run to exit and + # the driver to continue to the next test case. + $SIG{'INT'} = $SIG{'HUP'} = $SIG{'TERM'} = $SIG{'QUIT'} = sub { exit 2 }; + + # Unbuffer our output. + $| = 1; + + $rep->{+__PACKAGE__}{$f_socket} = $socket; + $rep->{+__PACKAGE__}{$f_origdir} = $origdir; + $rep->{+__PACKAGE__}{$f_tempdir} = $tempdir; + $rep->{+__PACKAGE__}{$f_testlog} = $testlog; + $rep->{+__PACKAGE__}{$f_testxml} = $testxml; + $rep->{+__PACKAGE__}{$f_suitename} = $suitename; + $rep->{+__PACKAGE__}{$f_passes} = 0; + $rep->{+__PACKAGE__}{$f_fails} = 0; + $rep->{+__PACKAGE__}{$f_xpasses} = 0; + $rep->{+__PACKAGE__}{$f_xfails} = 0; + $rep->{+__PACKAGE__}{$f_testnum} = 1; + + # Do protocol handshaking with the test driver system + my $init = scalar(<$socket>); + if ($init !~ m/^TEST_DRIVER 1$/) + { + die +__PACKAGE__, ": incorrect protocol with test driver system\n"; + } + $socket->print("TEST_DRIVER_CLIENT 1\n"); + + bless $rep, $class; +} + +sub _socket +{ + my $rep = shift; + $rep->{+__PACKAGE__}{$f_socket}; +} + +sub _tempdir +{ + my $rep = shift; + $rep->{+__PACKAGE__}{$f_tempdir}; +} + +sub _testlog +{ + my $rep = shift; + $rep->{+__PACKAGE__}{$f_testlog}; +} + +sub _testxml +{ + my $rep = shift; + $rep->{+__PACKAGE__}{$f_testxml}; +} + +sub _suitename +{ + my $rep = shift; + $rep->{+__PACKAGE__}{$f_suitename}; +} + +sub _testnum +{ + my $rep = shift; + $rep->{+__PACKAGE__}{$f_testnum} = $_[0] if @_; + $rep->{+__PACKAGE__}{$f_testnum}; +} + +# PUBLIC METHODS + +# Usage: report(n) +# Specify the number of tests that are expected to have been run. +# Please note: the purpose of reporting the number of test cases with +# "report" is as an extra check to make sure that the test suite +# itself didn't have a logic error that caused some test cases to be +# skipped. The argument to "report" should therefore be a hard-coded +# number or a number computed only from static features in the test +# suite. It should not be a number that is counted up during the +# process of running the test suite. Computing this number as a side +# effect of running test cases would defeat the purpose of the number. +# For example, if the test suite consists of an array of test cases, +# and the test suite code iterates through that loop and calls +# "runtest" twice for each element, it would be reasonable to pass an +# expression that includes the size of the array as an argument to +# "report", but it would not be appropriate to have a variable called +# "$ntests" that is incremented each time "runtest" is called and then +# passed to "report". +sub report +{ + my $rep = shift; + croak "Usage: ", __PACKAGE__, "->report(num-tests-expected)\n" + unless @_ && $_[0] =~ m/^\d+$/; + + # Message to test driver system: + # n-expected-tests passes fails unexpected-passes expected-fails + + my @vals = (shift); + push(@vals, map { $rep->{+__PACKAGE__}{$_} } ($f_passes, $f_fails, + $f_xpasses, $f_xfails)); + my $socket = $rep->_socket(); + $socket->print(join(' ', @vals)), "\n"; +} + +# Usage: notify(string) +# Prints the string followed by a newline to standard output of the +# test suite. +sub notify +{ + my $rep = shift; + my $msg = shift; + &QTC::TC("testdriver", "TestDriver notify"); + print $msg, "\n"; +} + +# Usage: emphasize(string) +# Prints the string followed by a newline to standard output of the +# test suite. The string is printed with emphasis if the terminal +# supports color. +sub emphasize +{ + my $rep = shift; + my $msg = shift; + &QTC::TC("testdriver", "TestDriver emphasize"); + print $color_emph, $msg, $color_reset, "\n"; +} + +# Usage: prompt(msg, env, default) +# If the environment variable "env" is set, its value is returned. +# Otherwise, if STDIN is a tty, the user is prompted for an answer +# using msg as the prompt, or if STDIN is not a tty, the value +# specified in "default" is returned. Note that careless use of +# prompt in test suites may make the test suites unable to be run in +# batch mode. +sub prompt +{ + my $rep = shift; + my ($msg, $env, $default) = @_; + &QTC::TC("testdriver", "TestDriver prompt"); + my $answer = $ENV{$env}; + if (defined $answer) + { + print "$msg\n"; + print "[Question answered from environment variable \$$env: $answer]\n"; + } + else + { + print "To avoid question, place answer in" . + " environment variable \$$env\n"; + # Note: ActiveState perl 5.10.1 gives the wrong answer for -t + # STDIN. + if ((-t STDIN) && (-t STDOUT)) + { + print "$msg "; + chop($answer = ); + if ($answer eq '') + { + print "[Using default answer for question: $default]\n"; + $answer = $default; + } + } + else + { + print "$msg\n"; + print "[Using default answer for question: $default]\n"; + $answer = $default; + } + } + $answer; +} + +# Usage: get_start_dir() +# Returns the name of the directory from which the test driver was +# originally invoked. This can be useful for test suites that are +# designed to be run from read-only areas or from multiple locations +# simultaneously: they can get the original invocation directory and +# use it as a place to write temporary files. +sub get_start_dir +{ + my $rep = shift; + $rep->{+__PACKAGE__}{$f_origdir}; +} + +# Usage: runtest description input output [ flags ] +# Returns true iff test passes; i.e., input matches output + +# Parameters: + +# description: a short textual description of the test case + +# input: a hash reference that defines the input to the test case +# input keys and associated values: + +# STRING: a string that is used verbatim as the test input + +# FILE: a file whose contents are used as the test input + +# COMMAND: an array reference containing a command and arguments +# or a string representing the command. This is passed to exec, +# so the rules that exec uses to determine whether to pass this +# to a shell are followed. The command is run with STDIN set to +# /dev/null, STDOUT redirected to an internal file, and STDERR +# copied to STDOUT. + +# Note that exactly one of STRING, FILE, or COMMAND must appear. + +# FILTER: if specified, it is a program that is run on the test +# input specified above to generate the true test input. + +# output: a hash reference that defines the expected output of the +# test case + +# STRING: a string that contains the expected test output + +# FILE: a file that contains the expected test output + +# REGEXP: a regular expression that must match the test output + +# Note that exactly one of STRING, FILE, or REGEXP must appear. + +# EXIT_STATUS: the exit status of the command. Required iff the +# intput is specified by COMMAND. A value of undef means that we +# don't care about the exit status of a command. The special +# value of '!0' means we allow any abnormal exit status but we +# don't care what the specific exit status is. An integer value +# is the ordinary exit status of a command. A string of the form +# SIG:n indicates that the program has exited with signal n. +# Note that SIG:n is not reliable in a Windows (non-Cygwin) +# environment. + +# THREAD_DATA: If specified, the test output is expected to +# contain multithreaded output with output lines marked by thread +# and sequence group identifiers. The value must be a hash that +# contains required key TD_THREADS and optional key TD_SEQGROUPS. +# The value of each key is an array reference containing a list +# of threads or sequence groups as appropriate. When THREAD_DATA +# is specified, the single call to runtest actually generates t + +# s + 3 tests where "t" is the number of threads and "s" is the +# number of sequence groups specified. See the documentation for +# full details on how multithreaded output is handled by the test +# driver. + +# flags: additional flags to control the test case; should be +# logically orred together (e.g. NORMALIZE_WHITESPACE | EXPECT_FAILURE) + +# NORMALIZE_NEWLINES: If specified, all newlines or carriage +# return/newline combinations in the input are translated to +# straight UNIX-style newlines. This is done before writing +# through any filter. Newlines are also normalized in the +# expected output. + +# NORMALIZE_WHITESPACE: If specified, all carriage returns are +# removed, and all strings of one or more space or tab characters +# are replaced by a single space character in the input. This is +# done before writing through any filter. The expected output +# must be normalized in this way as well in order for the test to +# pass. + +# EXPECT_FAILURE: If specified, the test case is expected to +# fail. In this case, a test case failure will not generate +# verbose output or cause overall test suite failure, and a pass +# will generate test suite failure. This should be used for +# place-holder test cases that exercise a known bug that cannot +# yet be fixed. + +sub runtest +{ + my $rep = shift; + + if (! ((@_ == 3) || (@_ == 4))) + { + croak +("Usage: ", +__PACKAGE__, + "->runtest(description, input, output[, flags])\n"); + } + + my ($description, $input, $output, $flags) = @_; + $flags = 0 unless defined $flags; + + my $tempdir = $rep->_tempdir(); + + if (ref($description) ne '') + { + &QTC::TC("testdriver", "TestDriver description not string"); + croak +__PACKAGE__, "->runtest: description must be a string\n"; + } + if (ref($input) ne 'HASH') + { + &QTC::TC("testdriver", "TestDriver input not hash"); + croak +__PACKAGE__, "->runtest: input must be a hash reference\n"; + } + if (ref($output) ne 'HASH') + { + &QTC::TC("testdriver", "TestDriver output not hash"); + croak +__PACKAGE__, "->runtest: output must be a hash reference\n"; + } + if ((ref($flags) ne '') || ($flags !~ m/^\d+$/)) + { + &QTC::TC("testdriver", "TestDriver flags not integer"); + croak +__PACKAGE__, "->runtest: flags must be an integer\n"; + } + + my ($extra_in_keys, $in_string, $in_file, $in_command, $in_filter) = + check_hash_keys($input, $rep->STRING, + $rep->FILE, $rep->COMMAND, $rep->FILTER); + if ($extra_in_keys) + { + &QTC::TC("testdriver", "TestDriver extraneous input keys"); + croak +(+__PACKAGE__, + "->runtest: extraneous keys in intput hash: $extra_in_keys\n"); + } + my ($extra_out_keys, $out_string, $out_file, $out_regexp, + $out_exit_status, $thread_data) = + check_hash_keys($output, $rep->STRING, + $rep->FILE, $rep->REGEXP, $rep->EXIT_STATUS, + $rep->THREAD_DATA); + if ($extra_out_keys) + { + &QTC::TC("testdriver", "TestDriver extraneous output keys"); + croak +(+__PACKAGE__, + "->runtest: extraneous keys in output hash: $extra_out_keys\n"); + } + + if ((((defined $in_string) ? 1 : 0) + + ((defined $in_file) ? 1 : 0) + + ((defined $in_command) ? 1 : 0)) != 1) + { + &QTC::TC("testdriver", "TestDriver invalid input"); + croak +__PACKAGE__, "->runtest: exactly one of" . + " STRING, FILE, or COMMAND must be present for input\n"; + } + if ((((defined $out_string) ? 1 : 0) + + ((defined $out_file) ? 1 : 0) + + ((defined $out_regexp) ? 1 : 0)) != 1) + { + &QTC::TC("testdriver", "TestDriver invalid output"); + croak +__PACKAGE__, "->runtest: exactly one of" . + " STRING, FILE, or REGEXP must be present for output\n"; + } + if ((defined $in_command) != (exists $output->{$rep->EXIT_STATUS})) + { + &QTC::TC("testdriver", "TestDriver invalid status"); + croak +__PACKAGE__, "->runtest: input COMMAND and output EXIT_STATUS" + . " must either both appear both not appear\n"; + } + + my ($threads, $seqgroups) = (undef, undef); + if (defined $thread_data) + { + if (ref($thread_data) ne 'HASH') + { + &QTC::TC("testdriver", "TestDriver thread_data not hash"); + croak +__PACKAGE__, "->runtest: THREAD_DATA" . + " must be a hash reference\n"; + } + my $extra_thread_keys; + ($extra_thread_keys, $threads, $seqgroups) = + check_hash_keys($thread_data, $rep->TD_THREADS, $rep->TD_SEQGROUPS); + if ($extra_thread_keys) + { + &QTC::TC("testdriver", "TestDriver extraneous thread_data keys"); + croak +(+__PACKAGE__, + "->runtest: extraneous keys in THREAD_DATA hash:" . + " $extra_thread_keys\n"); + } + if (! defined $threads) + { + &QTC::TC("testdriver", "TestDriver thread_data no threads"); + croak +__PACKAGE__, "->runtest: THREAD_DATA" . + " must contain TD_THREADS\n"; + } + elsif (ref($threads) ne 'ARRAY') + { + &QTC::TC("testdriver", "TestDriver threads not array ref"); + croak +__PACKAGE__, "->runtest: TD_THREADS" . + " must be an array reference\n"; + } + if ((defined $seqgroups) && (ref($seqgroups) ne 'ARRAY')) + { + &QTC::TC("testdriver", "TestDriver seqgroups not array ref"); + croak +__PACKAGE__, "->runtest: TD_SEQGROUPS" . + " must be an array reference\n"; + } + } + + # testnum is incremented by print_testid + my $testnum = $rep->_testnum(); + my $category = $rep->_suitename(); + $rep->print_testid($description); + + # Open a file handle to read the raw (unfiltered) test input + my $pid = undef; + my $pid_killer = new TestDriver::PidKiller(\$pid); + my $in = new IO::Handle; + my $use_tempfile = $in_windows; + my $tempout_status = undef; + if (defined $in_string) + { + &QTC::TC("testdriver", "TestDriver input string"); + open($in, '<', \$in_string) or + die +(+__PACKAGE__, + "->runtest: unable to read from input string: $!\n"); + } + elsif (defined $in_file) + { + &QTC::TC("testdriver", "TestDriver input file"); + open($in, '<', $in_file) or + croak +(+__PACKAGE__, + "->runtest: unable to read from input file $in_file: $!\n"); + } + elsif (defined $in_command) + { + if (ref($in_command) eq 'ARRAY') + { + &QTC::TC("testdriver", "TestDriver input command array"); + } + elsif (ref($in_command) eq '') + { + &QTC::TC("testdriver", "TestDriver input command string"); + } + + if ($use_tempfile) + { + my $tempout = "$tempdir/tempout"; + $tempout_status = $rep->winrun( + $in_command, File::Spec->devnull(), $tempout); + open($in, "<$tempout") or + croak +(+__PACKAGE__, + "->runtest: unable to read from" . + " input file $tempout: $!\n"); + } + else + { + $pid = open($in, "-|"); + croak +__PACKAGE__, "->runtest: fork failed: $!\n" + unless defined $pid; + if ($pid == 0) + { + open(STDERR, ">&STDOUT"); + open(STDIN, '<', \ ""); + if (ref($in_command) eq 'ARRAY') + { + exec @$in_command or + croak+(+__PACKAGE__, + "->runtest: unable to run command ", + join(' ', @$in_command), "\n"); + } + else + { + exec $in_command or + croak+(+__PACKAGE__, + "->runtest: unable to run command ", + $in_command, "\n"); + } + } + } + } + else + { + die +__PACKAGE__, ": INTERNAL ERROR: invalid test input"; + } + binmode $in; + + # Open file handle into which to write the actual output + my $actual = new IO::File; + my $actual_file = "$tempdir/actual"; + + if (defined $in_filter) + { + &QTC::TC("testdriver", "TestDriver filter defined"); + if ($use_tempfile) + { + my $filter_file = "$tempdir/filter"; + open(F, ">$filter_file.1") or + croak+(+__PACKAGE__, + "->runtest: unable to create $filter_file.1: $!\n"); + binmode F; + while (<$in>) + { + print F; + } + $in->close(); + close(F); + $rep->winrun($in_filter, "$filter_file.1", $filter_file); + open($in, "<$filter_file") or + croak +(+__PACKAGE__, + "->runtest: unable to read from" . + " input file $filter_file: $!\n"); + binmode $in; + $in_filter = undef; + } + } + if (defined $in_filter) + { + # Write through filter to actual file + open($actual, "| $in_filter > $actual_file") or + croak +(+__PACKAGE__, + ": pipe to filter $in_filter failed: $!\n"); + } + else + { + &QTC::TC("testdriver", "TestDriver filter not defined"); + open($actual, ">$actual_file") or + die +(+__PACKAGE__, ": write to $actual_file failed: $!\n"); + } + binmode $actual; + + # Write from input to actual output, normalizing spaces and + # newlines if needed + my $exit_status = undef; + while (1) + { + my ($line, $status) = read_line($in, $pid); + $exit_status = $status if defined $status; + last unless defined $line; + if ($flags & $rep->NORMALIZE_WHITESPACE) + { + &QTC::TC("testdriver", "TestDriver normalize whitespace"); + $line =~ s/[ \t]+/ /g; + } + else + { + &QTC::TC("testdriver", "TestDriver no normalize whitespace"); + } + if ($flags & $rep->NORMALIZE_NEWLINES) + { + &QTC::TC("testdriver", "TestDriver normalize newlines"); + $line =~ s/\r$//; + } + else + { + &QTC::TC("testdriver", "TestDriver no normalize newlines"); + } + $actual->print($line); + $actual->flush(); + last if defined $exit_status; + } + $in->close(); + if (defined $tempout_status) + { + $exit_status = $tempout_status; + } + if (defined $in_command) + { + if (! defined $exit_status) + { + $exit_status = $?; + } + my $exit_status_number = 0; + my $exit_status_signal = 0; + if ($in_windows) + { + # WIFSIGNALED et al are not defined. This is emperically + # what happens with MSYS 1.0.11 and ActiveState Perl + # 5.10.1. + if ($exit_status & 0x8000) + { + $exit_status_signal = 1; + $exit_status = ($exit_status & 0xfff) >> 8; + $exit_status = "SIG:$exit_status"; + } + elsif ($exit_status >= 256) + { + $exit_status_number = 1; + $exit_status = $exit_status >> 8; + } + } + elsif (WIFSIGNALED($exit_status)) + { + $exit_status_signal = 1; + $exit_status = "SIG:" . WTERMSIG($exit_status); + } + elsif (WIFEXITED($exit_status)) + { + $exit_status_number = 1; + $exit_status = WEXITSTATUS($exit_status); + } + if ($exit_status_number) + { + &QTC::TC("testdriver", "TestDriver exit status number"); + } + if ($exit_status_signal) + { + &QTC::TC("testdriver", "TestDriver exit status signal"); + } + } + $? = 0; + $actual->close(); + $pid = undef; + if ($?) + { + die +(+__PACKAGE__, + "->runtest: failure closing actual output; status = $?\n"); + } + + # Compare exit statuses. This expression is always true when the + # input was not from a command. + if ((defined $out_exit_status) && ($out_exit_status eq '!0')) + { + &QTC::TC("testdriver", "TestDriver non-zero exit status"); + } + my $status_match = + ((! defined $out_exit_status) || + ((defined $exit_status) && + ( (($out_exit_status eq '!0') && ($exit_status ne 0)) || + ($exit_status eq $out_exit_status) ))); + + # Compare actual output with expected output. + my $expected_file = undef; + my $output_match = undef; + if (defined $out_string) + { + &QTC::TC("testdriver", "TestDriver output string"); + # Write output string to a file so we can run diff + $expected_file = "$tempdir/expected"; + my $e = new IO::File; + open($e, ">$expected_file") or + die +(__PACKAGE__, + "->runtest: unable to write to $expected_file: $!\n"); + binmode $e; + $e->print($out_string); + $e->close(); + } + elsif (defined $out_file) + { + &QTC::TC("testdriver", "TestDriver output file"); + if ($flags & $rep->NORMALIZE_NEWLINES) + { + # Normalize newlines in expected output file + $expected_file = "$tempdir/expected"; + unlink $expected_file; + my $in = new IO::File; + if (open($in, "<$out_file")) + { + binmode $in; + my $e = new IO::File; + open($e, ">$expected_file") or + die +(__PACKAGE__, + "->runtest: unable to write to $expected_file: $!\n"); + binmode $e; + while (<$in>) + { + s/\r?$//; + $e->print($_); + } + $e->close(); + $in->close(); + } + } + else + { + $expected_file = $out_file; + } + } + elsif (defined $out_regexp) + { + &QTC::TC("testdriver", "TestDriver output regexp"); + # No expected file; do regexp test to determine whether output + # matches + $actual = new IO::File; + open($actual, "<$actual_file") or + die +(__PACKAGE__, + "->runtest: unable to read $actual_file: $!\n"); + binmode $actual; + local $/ = undef; + my $actual_output = <$actual>; + $actual->close(); + $output_match = ($actual_output =~ m/$out_regexp/); + } + else + { + die +__PACKAGE__, ": INTERNAL ERROR: invalid test output"; + } + + my $output_diff = undef; + if (! defined $output_match) + { + if (! defined $expected_file) + { + die +__PACKAGE__, ": INTERNAL ERROR: expected_file not defined"; + } + if (defined $threads) + { + # Real output comparisons are done later. + $output_match = 1; + } + else + { + $output_diff = "$tempdir/difference"; + my $r = $rep->safe_pipe(['diff', '-a', '-u', + $expected_file, $actual_file], + $output_diff); + $output_match = ($r == 0); + } + } + + my $outcome = ($output_match && $status_match) ? PASS : FAIL; + my $exp_outcome = (($flags & $rep->EXPECT_FAILURE) ? FAIL : PASS); + my $outcome_text = print_results($outcome, $exp_outcome); + my $passed = $rep->update_counters($outcome, $exp_outcome); + + my $testxml = $rep->_testxml(); + my $testlog = $rep->_testlog(); + # $outcome_text is for the human-readable. We need something + # different for the xml file. + $testxml->print(" print(" >\n"); + $testlog->printf("$category test %d (%s) FAILED\n", + $testnum, $description); + my $cwd = getcwd(); + $testlog->print("cwd: $cwd\n"); + $testxml->print(" " . xmlify($cwd) . "\n"); + my $cmd = $in_command; + if ((defined $cmd) && (ref($cmd) eq 'ARRAY')) + { + $cmd = join(' ', @$cmd); + } + if (defined $cmd) + { + $testlog->print("command: $cmd\n"); + $testxml->print(" " . xmlify($cmd) . "\n"); + } + if (defined $out_file) + { + # Use $out_file, not $expected_file -- we are only + # interested in dispaying this information if the user's + # real output was original in a file. + $testlog->print("expected output in $out_file\n"); + $testxml->print( + " " . xmlify($out_file) . + "\n"); + } + + # It would be nice if we could filter out internal calls for + # times when runtest is called inside of the module for + # multithreaded testing. + $testlog->print(Carp::longmess()); + + $testxml->print(" test failure" . + xmlify(Carp::longmess()) . + "\n"); + + if (! $status_match) + { + &QTC::TC("testdriver", "TestDriver status mismatch"); + $testlog->printf("\tExpected status: %s\n", $out_exit_status); + $testlog->printf("\tActual status: %s\n", $exit_status); + $testxml->print( + " $out_exit_status\n"); + $testxml->print( + " $exit_status\n"); + } + if (! $output_match) + { + &QTC::TC("testdriver", "TestDriver output mismatch"); + $testlog->print("--> BEGIN EXPECTED OUTPUT <--\n"); + $testxml->print(" "); + if (defined $expected_file) + { + write_file_to_fh($expected_file, $testlog); + xml_write_file_to_fh($expected_file, $testxml); + } + elsif (defined $out_regexp) + { + $testlog->print("regexp: " . $out_regexp); + if ($out_regexp !~ m/\n$/s) + { + $testlog->print("\n"); + } + $testxml->print("regexp: " . xmlify($out_regexp)); + } + else + { + die +(+__PACKAGE__, + "->runtest: INTERNAL ERROR: no expected output\n"); + } + $testlog->print("--> END EXPECTED OUTPUT <--\n" . + "--> BEGIN ACTUAL OUTPUT <--\n"); + $testxml->print("\n" . + " "); + write_file_to_fh($actual_file, $testlog); + xml_write_file_to_fh($actual_file, $testxml); + $testlog->print("--> END ACTUAL OUTPUT <--\n"); + $testxml->print("\n"); + if (defined $output_diff) + { + &QTC::TC("testdriver", "TestDriver display diff"); + $testlog->print("--> DIFF EXPECTED ACTUAL <--\n"); + $testxml->print(" "); + write_file_to_fh($output_diff, $testlog); + xml_write_file_to_fh($output_diff, $testxml); + $testlog->print("--> END DIFFERENCES <--\n"); + $testxml->print("\n"); + } + else + { + &QTC::TC("testdriver", "TestDriver display no diff"); + } + } + $testxml->print(" \n"); + } + else + { + $testxml->print(" />\n"); + } + + if (defined $threads) + { + if (! defined $expected_file) + { + &QTC::TC("testdriver", "TestDriver thread data but no exp output"); + croak +(+__PACKAGE__, + "->runtest: thread data invalid". + " without fixed test output\n"); + } + + my $thread_expected = "$tempdir/thread-expected"; + my $thread_actual = "$tempdir/thread-actual"; + copy($actual_file, $thread_actual); + filter_seqgroups($expected_file, $thread_expected); + + $passed = + $rep->analyze_thread_data($description, + $expected_file, $actual_file, + $threads, $seqgroups) + && $passed; + + if ($passed) + { + $rep->runtest($description . ": all subcases passed", + {$rep->STRING => ""}, + {$rep->STRING => ""}); + } + else + { + $rep->runtest($description . ": original output", + {$rep->FILE => $thread_actual}, + {$rep->FILE => $thread_expected}); + } + + unlink $thread_expected, $thread_actual; + } + + $passed; +} + +sub read_line +{ + my ($fh, $pid) = @_; + my $line = undef; + my $status = undef; + + if (defined $pid) + { + # It doesn't work to just call <$fh> in this case. For some + # unknown reason, some programs occasionally exit and cause an + # interrupted system call return from read which perl just + # ignores, making the call to <$fh> hang. To protect + # ourselves, we explicitly check for the program having exited + # periodically if read hasn't returned anything. + + while (1) + { + my $s = new IO::Select(); + $s->add($fh); + my @ready = $s->can_read(1); + if (@ready == 0) + { + if (waitpid($pid, WNOHANG) > 0) + { + $status = $?; + last; + } + next; + } + else + { + my $buf = ""; + my $status = sysread($fh, $buf, 1); + if ((defined $status) && ($status == 1)) + { + $line = "" unless defined $line; + $line .= $buf; + last if $buf eq "\n"; + } + else + { + last; + } + } + } + } + else + { + $line = <$fh>; + } + ($line, $status); +} + +sub write_file_to_fh +{ + my ($file, $out) = @_; + my $in = new IO::File("<$file"); + if (defined $in) + { + binmode $in; + my $ended_with_newline = 1; + while (<$in>) + { + $out->print($_); + $ended_with_newline = m/\n$/s; + } + if (! $ended_with_newline) + { + $out->print("[no newline at end of data]\n"); + } + $in->close(); + } + else + { + $out->print("[unable to open $file: $!]\n"); + } +} + +sub xmlify +{ + my ($str, $attr) = @_; + $attr = 0 unless defined $attr; + $str =~ s/\&/\&/g; + $str =~ s//>/g; + $str =~ s/\"/"/g if $attr; + $str =~ s/([\000-\010\013-\037\177-\377])/sprintf("&#x%02x;", ord($1))/ge; + $str; +} + +sub xml_write_file_to_fh +{ + my ($file, $out) = @_; + my $in = new IO::File("<$file"); + if (defined $in) + { + binmode $in; + while (defined ($_ = <$in>)) + { + $out->print(xmlify($_)); + } + $in->close(); + } + else + { + $out->print("[unable to open $file: $!]"); + } +} + +sub check_hash_keys +{ + my ($hash, @keys) = @_; + my %actual_keys = (); + foreach my $k (keys %$hash) + { + $actual_keys{$k} = 1; + } + foreach my $k (@keys) + { + delete $actual_keys{$k}; + } + my $extra_keys = join(', ', sort (keys %actual_keys)); + ($extra_keys, (map { $hash->{$_} } @keys)); +} + +sub print_testid +{ + my $rep = shift; + my ($description) = @_; + + my $testnum = $rep->_testnum(); + my $category = $rep->_suitename(); + print_and_pad(sprintf("$category %2d (%s)", $testnum, $description)); + my $tc_filename = $ENV{'TC_FILENAME'} || ""; + if ($tc_filename && open(F, ">>$tc_filename")) + { + binmode F; + printf F "# $category %2d (%s)\n", $testnum, $description; + close(F); + } + $rep->_testnum(++$testnum); +} + +sub update_counters +{ + my $rep = shift; + my ($outcome, $exp_outcome) = @_; + + (($outcome eq PASS) && ($exp_outcome eq PASS)) && + $rep->{+__PACKAGE__}{$f_passes}++; + (($outcome eq PASS) && ($exp_outcome eq FAIL)) && + $rep->{+__PACKAGE__}{$f_xpasses}++; + (($outcome eq FAIL) && ($exp_outcome eq PASS)) && + $rep->{+__PACKAGE__}{$f_fails}++; + (($outcome eq FAIL) && ($exp_outcome eq FAIL)) && + $rep->{+__PACKAGE__}{$f_xfails}++; + + ($outcome eq PASS); +} + +sub analyze_thread_data +{ + my $rep = shift; + my ($description, $expected, $actual, + $expected_threads, $expected_seqgroups) = @_; + + my $tempdir = $rep->_tempdir(); + + my %actual_threads = (); + my %actual_seqgroups = (); + my @errors = (); + + $rep->thread_cleanup(); + $rep->split_combined($expected); + $rep->analyze_threaded_output + ($actual, \%actual_threads, \%actual_seqgroups, \@errors); + + # Make sure we saw the right threads and sequences + + my $desired = "threads:\n"; + $desired .= join('', map { " $_\n" } (sort @$expected_threads)); + $desired .= "sequence groups:\n"; + if (defined $expected_seqgroups) + { + $desired .= join('', map { " $_\n" } (sort @$expected_seqgroups)); + } + + my $observed = "threads:\n"; + $observed .= join('', map { " $_\n" } (sort keys %actual_threads)); + $observed .= "sequence groups:\n"; + $observed .= join('', map { " $_\n" } (sort keys %actual_seqgroups)); + + if (@errors) + { + $observed .= join('', @errors); + } + + my $passed = + $rep->runtest("$description: multithreaded data", + {$rep->STRING => $observed}, + {$rep->STRING => $desired}); + + + foreach my $th (@{$expected_threads}) + { + create_if_missing("$tempdir/$th.thread-actual", + "[no actual output]\n"); + filter_seqgroups("$tempdir/$th.thread-expected", + "$tempdir/$th.thread-filtered"); + $passed = + $rep->runtest($description . ": thread $th", + {$rep->FILE => "$tempdir/$th.thread-actual"}, + {$rep->FILE => "$tempdir/$th.thread-filtered"}) + && $passed; + } + if (defined $expected_seqgroups) + { + foreach my $sg (@{$expected_seqgroups}) + { + create_if_missing("$tempdir/$sg.seq-actual", + "[no actual output]\n"); + $passed = + $rep->runtest($description . ": seqgroup $sg", + {$rep->FILE => "$tempdir/$sg.seq-actual"}, + {$rep->FILE => "$tempdir/$sg.seq-expected"}) + && $passed; + } + } + + $rep->thread_cleanup(); + + $passed; +} + +sub analyze_threaded_output +{ + my $rep = shift; + my ($file, $threads, $seqgroups, $errors) = @_; + my $sequence_checking = 1; + open(F, "<$file") or die +__PACKAGE__, ": can't open $file: $!\n"; + binmode F; + my $cur_thread = undef; + while () + { + if (m/^(\[\[(.+?)\]\]:)/) + { + my $tag = $1; + my $thread = $2; + my $rest = $'; #' [unconfuse emacs font lock mode] + + $rep->handle_line($file, $., $tag, $thread, $rest, + \$sequence_checking, $threads, $seqgroups, + $errors); + + $cur_thread = $thread; + } + else + { + $rep->handle_line($file, $., "", $cur_thread, $_, + \$sequence_checking, $threads, $seqgroups, + $errors); + } + } + close(F); +} + +sub handle_line +{ + my $rep = shift; + my ($file, $lineno, $tag, $thread, $rest, + $sequence_checking, $threads, $seqgroups, $errors) = @_; + + my $tempdir = $rep->_tempdir(); + + if (! exists $threads->{$thread}) + { + my $fh = new IO::File("<$tempdir/$thread.thread-expected"); + if (! $fh) + { + &QTC::TC("testdriver", "TestDriver no input file for thread"); + $fh = undef; + $$sequence_checking = 0; + push(@$errors, + "$file:$.: no input file for thread $thread; " . + "sequence checking abandoned\n"); + } + else + { + binmode $fh; + } + $threads->{$thread} = $fh; + } + my $known = defined($threads->{$thread}); + + my $seqs = ""; + if ($$sequence_checking) + { + my $fh = $threads->{$thread}; + my $next_input_line = scalar(<$fh>); + if (! defined $next_input_line) + { + $next_input_line = "[EOF]\n"; + } + $seqs = $rep->strip_seqs(\$next_input_line); + if ($next_input_line eq $rest) + { + if ($seqs ne "") + { + $rep->handle_seqs($seqs, $tag . $rest, $seqgroups); + } + } + else + { + &QTC::TC("testdriver", "TestDriver thread mismatch"); + $$sequence_checking = 0; + push(@$errors, + "$file:$.: thread $thread mismatch; " . + "sequencing checking abandoned\n" . + "actual $rest" . + "expected $next_input_line"); + } + } + output_line("$tempdir/$thread.thread-actual", $rest); + if (! $known) + { + &QTC::TC("testdriver", "TestDriver output from unknown thread"); + push(@$errors, "[[$thread]]:$rest"); + } +} + +sub strip_seqs +{ + my $rep = shift; + my $linep = shift; + my $seqs = ""; + if ($$linep =~ s/^\(\(.*?\)\)//) + { + $seqs = $&; + } + $seqs; +} + +sub handle_seqs +{ + my $rep = shift; + my ($seqs, $line, $seqgroups) = @_; + my $tempdir = $rep->_tempdir(); + $seqs =~ s/^\(\((.*?)\)\)/$1/; + foreach my $seq (split(',', $seqs)) + { + $seqgroups->{$seq} = 1; + output_line("$tempdir/$seq.seq-actual", $line); + } +} + +sub filter_seqgroups +{ + my ($infile, $outfile) = @_; + open(F, "<$infile") or + die +__PACKAGE__, ": can't open $infile: $!\n"; + binmode F; + open(O, ">$outfile") or + die +__PACKAGE__, ": can't create $outfile: $!\n"; + binmode O; + while () + { + s/^((?:\[\[.+?\]\]:)?)\(\(.+?\)\)/$1/; + print O; + } + close(O); + close(F); +} + +sub output_line +{ + my ($file, $line) = @_; + open(O, ">>$file") or die +__PACKAGE__, ": can't open $file: $!\n"; + binmode O; + print O $line or die +__PACKAGE__, ": can't append to $file: $!\n"; + close(O) or die +__PACKAGE__, ": close $file failed: $!\n"; +} + +sub create_if_missing +{ + my ($file, $line) = @_; + if (! -e $file) + { + open(O, ">$file") or die +__PACKAGE__, ": can't create $file: $!\n"; + binmode O; + print O $line; + close(O); + } +} + +sub split_combined +{ + my $rep = shift; + my $combined = shift; + my $tempdir = $rep->_tempdir(); + + open(C, "<$combined") or die +__PACKAGE__, ": can't open $combined: $!\n"; + binmode C; + my %files = (); + my $last_thread_fh = undef; + while () + { + my $thread_fh = $last_thread_fh; + my $thread_out = undef; + if (m/^(\[\[(.+?)\]\]:)(\(\((.+?)\)\))?(.*\n?)$/) + { + my $thread_full = $1; + my $thread = $2; + my $seq_full = $3; + my $seq = $4; + my $rest = $5; + my $seq_out = undef; + $thread_out = $rest; + + my @seq_files = (); + my $thread_file = "$tempdir/$thread.thread-expected"; + if (defined $seq_full) + { + $thread_out = $seq_full . $thread_out; + $seq_out = $thread_full . $rest; + foreach my $s (split(/,/, $seq)) + { + my $f = "$tempdir/$s.seq-expected"; + my $fh = cache_open(\%files, $f); + $fh->print($seq_out); + } + } + + $thread_fh = cache_open(\%files, $thread_file); + } + else + { + $thread_out = $_; + } + if ((defined $thread_out) && (! defined $thread_fh)) + { + die +__PACKAGE__, ": no place to put output lines\n"; + } + $thread_fh->print($thread_out) if defined $thread_out; + $last_thread_fh = $thread_fh; + } + close(C); + map { $_->close() } (values %files); +} + +sub cache_open +{ + my ($cache, $file) = @_; + if (! defined $file) + { + return undef; + } + if (! exists $cache->{$file}) + { + unlink $file; + my $fh = new IO::File(">$file") or + die +__PACKAGE__, ": can't open $file: $!\n"; + binmode $fh; + $cache->{$file} = $fh; + } + $cache->{$file}; +} + +sub thread_cleanup +{ + my $rep = shift; + my $dir = $rep->_tempdir(); + my @files = +(grep { m/\.(thread|seq)-(actual|expected|filtered)$/ } + (glob("$dir/*"))); + if (@files) + { + unlink @files; + } +} + +sub rmrf +{ + my $path = shift; + return unless -e $path; + my $wanted = sub + { + if ((-d $_) && (! -l $_)) + { + rmdir $_ or die "rmdir $_ failed: $!\n"; + } + else + { + unlink $_ or die "unlink $_ failed: $!\n"; + } + }; + finddepth({wanted => $wanted, no_chdir => 1}, $path); +} + +sub safe_pipe +{ + my $rep = shift; + my ($cmd, $outfile) = @_; + my $result = 0; + + if ($in_windows) + { + $result = $rep->winrun($cmd, File::Spec->devnull(), $outfile); + } + else + { + my $pid = open(C, "-|"); + + if ($pid) + { + # parent + my $out = new IO::File(">$outfile") or + die +__PACKAGE__, ": can't open $outfile: $!\n"; + binmode C; + while () + { + $out->print($_); + } + close(C); + $result = $?; + $out->close(); + } + else + { + # child + open(STDERR, ">&STDOUT"); + exec(@$cmd) || die +__PACKAGE__, ": $cmd->[0] failed: $!\n"; + } + } + + $result; +} + +sub winrun +{ + # This function does several things to make running stuff on + # Windows look sort of like running things on UNIX. It assumes + # MinGW perl is running in an MSYS/MinGW environment. + # + # * When an MSYS/MinGW program is run with system("..."), its + # newlines generate \r\n, but when it's run from MSYS sh, its + # newlines generate \n. We want \n for UNIX-like programs. + # + # * system("...") in perl doesn't have any special magic to + # handle #! lines in scripts. A lot of test suites will count + # on that. + # + # * There's no Windows equivalent to execve with separate + # arguments, so all sorts of fancy quoting is necessary when * + # dealing with arguments with spaces, etc. + # + # * Pipes work unreliably. Fork emulation is very incomplete. + # + # To work around these issues, we ensure that everything is + # actually executed from the MSYS /bin/sh. We find the actual + # path of that and then write a shell script which we explicitly + # invoke as an argument to /bin/sh. If we have a string that we + # want executed with /bin/sh, we include the string in the shell + # script. If we have an array, we pass the array on the + # commandline to the shell script and let it preserve spacing. We + # also do our output redirection in the shell script itself since + # redirection of STDOUT and STDERR doesn't carry forward to + # programs invoked by programs we invoke. Finally, we filter out + # errors generated by the script itself, since it is supposed to + # be an invisible buffer for smoother execution of programs. + # Experience shows that its output comes from things like printing + # the names of signals generated by subsidiary programs. + + my $rep = shift; + my ($in_command, $in, $out) = @_; + my $tempdir = $rep->_tempdir(); + my $tempfilename = "$tempdir/winrun.tmp"; + if (! defined $winbin) + { + my $comspec = $ENV{'COMSPEC'}; + $comspec =~ s,\\,/,g; + if ((system("sh -c 'cd /bin; $comspec /c cd'" . + " > $tempfilename") == 0) && + open(F, "<$tempfilename")) + { + $winbin = ; + close(F); + $winbin =~ s,[\r\n],,g; + $winbin =~ s,\\,/,g; + } + if (! defined $winbin) + { + die +__PACKAGE__, ": unable to find windows path to /bin\n"; + } + } + my $script = "$tempdir/tmpscript"; + open(F, ">$script") or + croak +(+__PACKAGE__, + "->runtest: unable to open $script to write: $!\n"); + binmode F; + print F "exec >$tempfilename\n"; + print F "exec 2>&1\n"; + print F "exec <$in\n"; + my @cmd = ("$winbin/sh", $script); + if (ref($in_command) eq 'ARRAY') + { + # For debugging, write out the args + foreach my $arg (@$in_command) + { + print F "# $arg\n"; + } + print F '"$@"', "\n"; + push(@cmd, @$in_command); + } + else + { + print F "$in_command\n"; + } + close(F); + my $status = system @cmd; + if (open(IN, "<$tempfilename") && + open(OUT, ">$out")) + { + binmode IN; + binmode OUT; + while () + { + next if m/^$script:/; + print OUT; + } + close(IN); + close(OUT); + } + $status; +} + +1; + +# +# END OF TestDriver +# diff --git a/zlib-flate/Makefile b/zlib-flate/Makefile new file mode 100644 index 0000000..9089905 --- /dev/null +++ b/zlib-flate/Makefile @@ -0,0 +1 @@ +include ../make/proxy.mk diff --git a/zlib-flate/build.mk b/zlib-flate/build.mk new file mode 100644 index 0000000..3a17f94 --- /dev/null +++ b/zlib-flate/build.mk @@ -0,0 +1,22 @@ +TARGETS_zlib-flate = \ + zlib-flate/$(OUTPUT_DIR)/$(call binname,zlib-flate) + +$(TARGETS_zlib-flate): $(TARGETS_libqpdf) + +INCLUDES_zlib-flate = include + +SRCS_zlib-flate = zlib-flate/zlib-flate.cc + +# ----- + +OBJS_zlib-flate = $(call src_to_obj,$(SRCS_zlib-flate)) + +ifeq ($(GENDEPS),1) +-include $(call obj_to_dep,$(OBJS_zlib-flate)) +endif + +$(OBJS_zlib-flate): zlib-flate/$(OUTPUT_DIR)/%.$(OBJ): zlib-flate/%.cc + $(call compile,$<,$(INCLUDES_zlib-flate)) + +zlib-flate/$(OUTPUT_DIR)/$(call binname,zlib-flate): $(OBJS_zlib-flate) + $(call makebin,$(OBJS_zlib-flate),$@,$(LDFLAGS) $(LDFLAGS_libqpdf),$(LIBS_libqpdf) $(LIBS)) diff --git a/zlib-flate/qtest/1.compressed b/zlib-flate/qtest/1.compressed new file mode 100644 index 0000000..3d05ab1 Binary files /dev/null and b/zlib-flate/qtest/1.compressed differ diff --git a/zlib-flate/qtest/1.uncompressed b/zlib-flate/qtest/1.uncompressed new file mode 100644 index 0000000..0446561 --- /dev/null +++ b/zlib-flate/qtest/1.uncompressed @@ -0,0 +1,5 @@ +Once upon a time there lived three qowws. They didn't like poridge +much, so they had salad for breakfast. Goldilocks, upon breaking and +entering, found this to be distasteful and so she just went away +without eating any. This somewhat short-circuited the story. The +End. diff --git a/zlib-flate/qtest/zf.test b/zlib-flate/qtest/zf.test new file mode 100644 index 0000000..39271e1 --- /dev/null +++ b/zlib-flate/qtest/zf.test @@ -0,0 +1,26 @@ +#!/usr/bin/env perl +require 5.008; +BEGIN { $^W = 1; } +use strict; + +require TestDriver; + +my $td = new TestDriver('zlib-flate'); + +$td->runtest("compress", + {$td->COMMAND => "zlib-flate -compress < 1.uncompressed"}, + {$td->FILE => "1.compressed", + $td->EXIT_STATUS => 0}); + +$td->runtest("uncompress", + {$td->COMMAND => "zlib-flate -uncompress < 1.compressed"}, + {$td->FILE => "1.uncompressed", + $td->EXIT_STATUS => 0}); + +$td->runtest("error", + {$td->COMMAND => "zlib-flate -uncompress < 1.uncompressed"}, + {$td->REGEXP => "flate: inflate: data: .*\n", + $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); + +$td->report(3); diff --git a/zlib-flate/zlib-flate.cc b/zlib-flate/zlib-flate.cc new file mode 100644 index 0000000..9d4a62e --- /dev/null +++ b/zlib-flate/zlib-flate.cc @@ -0,0 +1,94 @@ +#include +#include +#include + +#include +#include +#include +#include +#include + +static char const* whoami = 0; + +void usage() +{ + std::cerr << "Usage: " << whoami << " { -uncompress | -compress }" + << std::endl; + exit(2); +} + +int main(int argc, char* argv[]) +{ + if ((whoami = strrchr(argv[0], '/')) == NULL) + { + whoami = argv[0]; + } + else + { + ++whoami; + } + // For libtool's sake.... + if (strncmp(whoami, "lt-", 3) == 0) + { + whoami += 3; + } + + if ((argc == 2) && (strcmp(argv[1], "--version") == 0)) + { + std::cout << whoami << " version 1.0" << std::endl; + exit(0); + } + + if (argc != 2) + { + usage(); + } + + Pl_Flate::action_e action = Pl_Flate::a_inflate; + + if ((strcmp(argv[1], "-uncompress") == 0)) + { + // okay + } + else if ((strcmp(argv[1], "-compress") == 0)) + { + action = Pl_Flate::a_deflate; + } + else + { + usage(); + } + + QUtil::binary_stdout(); + QUtil::binary_stdin(); + Pl_StdioFile* out = new Pl_StdioFile("stdout", stdout); + Pl_Flate* flate = new Pl_Flate("flate", out, action); + + try + { + unsigned char buf[10000]; + bool done = false; + while (! done) + { + size_t len = fread(buf, 1, sizeof(buf), stdin); + if (len <= 0) + { + done = true; + } + else + { + flate->write(buf, len); + } + } + flate->finish(); + delete flate; + delete out; + } + catch (std::exception& e) + { + std::cerr << e.what() << std::endl; + exit(2); + } + + return 0; +} -- cgit v1.2.3